- Qbittorrent support for torrent and magnets
- Aria support for direct download links
- 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 file/folder from cloud to Telegram
- Leech 4gb file with premium account
- Leech torrent/magnets to Telegram using qBittorrent
- Copy file/folder from cloud to cloud
- Progress bar for download and upload
- Status for tasks
- 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
- 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
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
- 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
- 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 quotesAPI_HASH
: get this from https://my.telegram.orgBOT_TOKEN
: The Telegram Bot Token (get from @BotFather)OWNER_ID
: your Telegram User ID (not username) of the owner of the botDOWNLOAD_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 cmdALLOWED_USERS
: list of IDs of allowed users who can use this bot separated by spacesALLOWED_CHATS
: list of IDs of allowed chats who can use this bot separated by spacesUPSTREAM_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 settingsCMD_INDEX
: index number that will be added at the end of all commands.Str
UPSTREAM_BRANCH
: Upstream branch for updateUSER_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 commandpython3 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 channelEDIT_SLEEP_SECS
: Seconds for update regulary rclone progress message. Default to 10TORRENT_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 is2GB
for non premium account or4GB
if your account is premiumAS_DOCUMENT
: Default type of Telegram file upload. Default isFalse
mean as media.Bool
-
MEGA
MEGA_API_KEY
: Mega.nz API key to mirror mega.nz links. Get it from Mega SDK PageMEGA_EMAIL_ID
: E-Mail ID used to sign up on mega.nz for using premium accountMEGA_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). StrSERVER_PORT
: Port. StrWEB_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
-
- 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
- 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
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.
1- TorToolkit-Telegram. Base repository.
2- Rclone
3- Telethon
4- Pyrogram
4- and many others mentioned in code.