Giter VIP home page Giter VIP logo

rclonetg's Introduction

An Rclone Telegram bot to transfer to and from many clouds

Features:

qBittorrent

  • Qbittorrent support for torrent and magnets

Aria2c

  • Aria support for direct download links

Mirror

  • Mirror from Telegram to cloud
  • Mirror torrent/magnets to cloud using qBittorrent
  • Mirror directs links to cloud using Aria2
  • Mirror Mega.nz links to cloud
  • Mirror batch files from Telegram to cloud

Leech

  • Leech file/folder from cloud to Telegram
  • Leech 4gb file with premium account
  • Leech torrent/magnets to Telegram using qBittorrent

Copy

  • Copy file/folder from cloud to cloud

Status

  • Progress bar for download and upload
  • Status for tasks

Others

  • Telegram Navigation Bottom Menus to interact with cloud
  • Renaming of Telegram files
  • Change rclone config file from bot.
  • Zip file/folder from cloud to Telegram
  • Extract file from cloud to Telegram
  • Extract and Zip file from Telegram to cloud

From Other Repositories (with some changes)

  • Search on torrents with Torrent Search API or with variable plugins using qBittorrent search engine
  • Select files from Torrent before downloading
  • Get restricted messages from private channels.
  • Clone Google Drive files/folders from link to cloud using gclone
  • Thumbnail support
  • Set upload as document or as media
  • Update bot at startup and with restart command using UPSTREAM_REPO
  • Own users settings when using bot or added to supergroup (thumbnail, as document/as media, rclone.conf)
  • Direct links Supported:

    letsupload.io, hxfile.co, anonfiles.com, bayfiles.com, antfiles, fembed.com, fembed.net, femax20.com, layarkacaxxi.icu, fcdn.stream, sbplay.org, naniplay.com, naniplay.nanime.in, naniplay.nanime.biz, sbembed.com, streamtape.com, streamsb.net, feurl.com, pixeldrain.com, racaty.net, 1fichier.com, 1drv.ms (Only works for file not folder or business account), uptobox.com (Uptobox account must be premium) and solidfiles.com

Commands for bot(set through @BotFather)

mirror - mirror to selected cloud 
unzipmirror - mirror and extract to cloud 
zipmirror - mirror and zip to cloud 
qbmirror - mirror torrent to cloud
mirrorbatch - mirror files in batch to cloud 
mirrorset - select cloud/folder where to mirror
leech - leech from cloud to Telegram
unzipleech - leech and extract to Telegram 
zipleech - leech and zip to Telegram 
qbleech - leech torrent to Telegram
leechset - leech settings
copy - copy from cloud to cloud
gclone - clone gdrive files/folder to cloud
config - change rclone config file
myfiles - file manager
search - search for torrents
status - get status message of tasks
logs - get logs from server
server - get server info
speedtest - test server speed
restart - restart bot

Deploy on VPS:

  1. Installing requirements
  • Clone repo:

     git clone https://github.com/Sam-Max/Rclone-Tg-Bot rclonetgbot/ && cd rclonetgbot
    
  • Install Docker(skip this if deploying without docker).

     sudo apt install snapd
     sudo snap install docker
    
  1. Set up config file
  • cp config_sample.env config.env

  • Fill up variables:

    • Mandatory variables:

      • API_ID: get this from https://my.telegram.org. Don't put this in quotes
      • API_HASH: get this from https://my.telegram.org
      • BOT_TOKEN: The Telegram Bot Token (get from @BotFather)
      • OWNER_ID: your Telegram User ID (not username) of the owner of the bot
      • DOWNLOAD_DIR: The path to the local folder where the downloads will go
    • Non mandatory variables:

      • RCLONE_CONFIG: content of the rclone.conf file. Set this surrounded by single quotes. You can also skip this and load rclone.conf file from bot with /config cmd
      • ALLOWED_USERS: list of IDs of allowed users who can use this bot separated by spaces
      • ALLOWED_CHATS: list of IDs of allowed chats who can use this bot separated by spaces
      • UPSTREAM_REPO: if your repo is private add your github repo link with format: https://username:{githubtoken}@github.com/{username}/{reponame}, so you can update your app from private repository on each restart. Get token from Github settings
      • CMD_INDEX: index number that will be added at the end of all commands. Str
      • UPSTREAM_BRANCH: Upstream branch for update
      • USER_SESSION_STRING: Pyrogram session string for using mirrorbatch command and to download/upload using your telegram account (needed for telegram premium upload). To generate string session use this command python3 session_generator.py on command line on your pc from repository folder. NOTE: when using string session you can't use bot, use it with group or channel
      • EDIT_SLEEP_SECS: Seconds for update regulary rclone progress message. Default to 10
      • TORRENT_TIMEOUT: Timeout of dead torrents downloading with qBittorrent
    • LEECH

      • TG_SPLIT_SIZE: Telegram upload limit in bytes, to automatically slice the file bigger that this size into small parts to upload to Telegram. Default is 2GB for non premium account or 4GB if your account is premium
      • AS_DOCUMENT: Default type of Telegram file upload. Default is False mean as media. Bool
    • MEGA

      • MEGA_API_KEY: Mega.nz API key to mirror mega.nz links. Get it from Mega SDK Page
      • MEGA_EMAIL_ID: E-Mail ID used to sign up on mega.nz for using premium account
      • MEGA_PASSWORD: Password for mega.nz account
    • qBittorrent

      • BASE_URL_OF_BOT: Valid BASE URL where the bot is deployed to use qbittorrent web selection. Format of URL should be http://myip, where myip is the IP/Domain(public). If you have chosen port other than 80 so write it in this format http://myip:port (http and not https). Str
      • SERVER_PORT: Port. Str
      • WEB_PINCODE: If empty or False means no more pincode required while qbit web selection. Bool Qbittorrent NOTE: If your facing ram exceeded issue then set limit for MaxConnecs, decrease AsyncIOThreadsCount in qbittorrent config and set limit of DiskWriteCacheSize to 32
    • Torrent Search

      • SEARCH_API_LINK: Search api app link. Get your api from deploying this repository. Str
      • SEARCH_LIMIT: Search limit for search api, limit for each site. Default is zero. Str
      • SEARCH_PLUGINS: List of qBittorrent search plugins (github raw links). Str
      • Supported Sites:

      1337x, Piratebay, Nyaasi, Torlock, Torrent Galaxy, Zooqle, Kickass, Bitsearch, MagnetDL, Libgen, YTS, Limetorrent, TorrentFunk, Glodls, TorrentProject and YourBittorrent

  1. Deploying on VPS Using Docker
  • Start Docker daemon (skip if already running), if installed by snap then use 2nd command:

      sudo dockerd
      sudo snap start docker
    

    Note: If not started or not starting, run the command below then try to start.

      sudo apt install docker.io
    
  • Build Docker image:

      sudo docker build . -t rclonetg-bot 
    
  • Run the image:

      sudo docker run rclonetg-bot 
    
  • To stop the image:

      sudo docker ps
      sudo docker stop id
    
  • To clear the container:

      sudo docker container prune
    
  • To delete the images:

      sudo docker image prune -a
    
  1. Deploying on VPS Using docker-compose

NOTE: If you want to use port other than 80, change it in docker-compose.yml

sudo apt install docker-compose
  • Build and run Docker image:
sudo docker-compose up
  • After editing files with nano for example (nano start.sh):
sudo docker-compose up --build
  • To stop the image:
sudo docker-compose stop
  • To run the image:
sudo docker-compose start

How to create rclone config file

Check this youtube video (not mine, credits to author):

Notes:

  • When you create rclone.conf file add at least two accounts if you want to copy from cloud to cloud.
  • For those on android phone, you can use RCX app app to create rclone.conf file. Use "Export rclone config" option in app menu to get config file.
  • Rclone supported providers:

    1Fichier, Amazon Drive, Amazon S3, Backblaze B2, Box, Ceph, DigitalOcean Spaces, Dreamhost, Dropbox, Enterprise File Fabric, FTP, GetSky, Google Cloud Storage, Google Drive, Google Photos, HDFS, HTTP, Hubic, IBM COS S3, Koofr, Mail.ru Cloud, Mega, Microsoft Azure Blob Storage, Microsoft OneDrive, Nextcloud, OVH, OpenDrive, Oracle Cloud Storage, ownCloud, pCloud, premiumize.me, put.io, Scaleway, Seafile, SFTP, WebDAV, Yandex Disk, etc. Check all providers on official site: Click here.

Deploying on Heroku

Bot Screenshot:

button menu example

Repositories used to develop this bot:

1- TorToolkit-Telegram. Base repository.

2- Rclone

3- Telethon

4- Pyrogram

4- and many others mentioned in code.

rclonetg's People

Contributors

sam-max avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.