r2
Free open-source Cloudflare R2 desktop client and S3 GUI for macOS, Windows, and Linux. Manage Cloudflare R2, AWS S3, M…
A Telegram bot for transferring files between cloud storage services and Telegram.
An asynchronous Telegram bot for transferring files between cloud storage services and Telegram.
Mirror → Cloud | Leech → Telegram | Clone → Cloud to Cloud
Features • Commands • Deployment • Configuration
⚠️ Stability Notice: The project is currently in a large refactor phase. During this period, behavior may be unstable and breaking changes can happen between updates until the refactor is completed.
| Feature | Description |
|---|---|
| Queue System | Advanced queuing with QUEUE_ALL, QUEUE_DOWNLOAD, QUEUE_UPLOAD limits |
| Private Channels | Mirror/leech from private Telegram channels |
| Upload Templates | Dynamic paths with variables like {username}, {date}, {category} |
| Media Metadata | Rich media captions and live status details |
| Screenshots | User-configurable screenshot generation |
| Name Substitution | Pattern-based filename renaming (old::new) |
| Force Start | Bypass queue for urgent tasks |
| JDownloader | Integration with JDownloader |
| Status Filters | Per-chat pagination with DL/UL/Seed/Clone/Queue filters |
.txt fileamd64, arm64/v8, arm/v7Set these commands through @BotFather.
| Command | Description |
|---|---|
mirror or /m |
Mirror to selected cloud |
mirror_batch or /mb |
Mirror Telegram files/links in batch |
mirror_select or /ms |
Select a fixed cloud/folder for mirror |
jdmirror or /jm |
Mirror via JDownloader |
ytdl or /y |
Mirror yt-dlp supported link |
ytdleech or /yl |
Leech yt-dlp supported link |
jdleech or /jl |
Leech via JDownloader |
| Command | Description |
|---|---|
leech or /l |
Leech from cloud/link to Telegram |
leech_batch or /lb |
Leech Telegram files/links in batch |
| Command | Description |
|---|---|
copy |
Copy from cloud to cloud |
clone |
Clone Google Drive link file/folder |
count |
Count file/folder from Google Drive link |
rcfm |
Rclone File Manager |
sync |
Sync two clouds |
bisync |
Bidirectional cloud sync |
cleanup |
Clean cloud trash |
storage |
Cloud storage details |
serve |
Serve cloud as web index |
| Command | Description |
|---|---|
files or /bf |
Bot configuration files |
cancel |
Cancel a task |
force_start or /fs |
Force start a queued task |
usetting |
User settings |
bsetting |
Owner settings |
tmdb |
Search titles |
torrsch |
Search for torrents |
cancel_all |
Cancel all tasks |
| Command | Description |
|---|---|
status |
Status message of tasks |
stats |
Bot statistics |
log |
Bot log |
ip |
Show IP address |
ping |
Ping bot |
| Command | Description |
|---|---|
shell |
Run commands in shell |
exec |
Run Python code |
restart |
Restart bot |
Clone the repository:
git clone https://github.com/Sam-Max/rcmltb rcmltb/ && cd rcmltb
For Debian-based distros:
sudo apt install python3 python3-pip
Install Docker by following the official Docker docs
For Arch and derivatives:
sudo pacman -S docker python
Install dependencies for setup scripts:
pip3 install -r requirements-cli.txt
Copy the sample config file:
cp sample_config.env config.env
NOTE: All values must be filled between quotes, even if it's
Int,Bool, orList.
| Variable | Description | Type |
|---|---|---|
TELEGRAM_API_ID |
Get from https://my.telegram.org | Int |
TELEGRAM_API_HASH |
Get from https://my.telegram.org | Str |
BOT_TOKEN |
Telegram Bot Token from @BotFather | Str |
OWNER_ID |
Your Telegram User ID (not username) | Int |
| Variable | Description | Type |
|---|---|---|
DOWNLOAD_DIR |
Path to local downloads folder | Str |
SUDO_USERS |
User IDs with sudo permission (space-separated) | Str |
ALLOWED_CHATS |
Allowed chat IDs (space-separated) | Str |
AUTO_MIRROR |
Auto mirror files sent to bot. Default: False |
Bool |
DATABASE_URL |
MongoDB connection string | Str |
CMD_INDEX |
Index number added to commands | Str |
GD_INDEX_URL |
Google Drive Index URL | Str |
VIEW_LINK |
View link button instead of direct download. Default: False |
Bool |
STATUS_LIMIT |
Number of tasks shown in status | Int |
LOCAL_MIRROR |
Keep files on host. Default: False |
Bool |
TORRENT_TIMEOUT |
Timeout for dead torrents (qBittorrent) | Int |
AUTO_DELETE_MESSAGE_DURATION |
Auto-delete messages after X seconds. -1 to disable |
Int |
TMDB_API_KEY |
TMDB API key (Get here) | Str |
TMDB_LANGUAGE |
TMDB search language. Default: en |
Str |
PARALLEL_TASKS |
Number of parallel tasks for queue | Int |
| Variable | Description | Type |
|---|---|---|
UPSTREAM_REPO |
GitHub repository link (supports private repos with token) | Str |
UPSTREAM_BRANCH |
Upstream branch. Default: master |
Str |
NOTE: If docker or requirements change, rebuild the image for changes to apply.
| Variable | Description | Type |
|---|---|---|
DEFAULT_OWNER_REMOTE |
Default remote for owner | Str |
DEFAULT_GLOBAL_REMOTE |
Default remote from global config | Str |
MULTI_RCLONE_CONFIG |
Allow each user their own config. Default: False |
Bool |
REMOTE_SELECTION |
Select cloud each mirror. Default: False |
Bool |
MULTI_REMOTE_UP |
Upload to multiple clouds. Default: False |
Bool |
USE_SERVICE_ACCOUNTS |
Enable Service Accounts. Default: False |
Bool |
SERVICE_ACCOUNTS_REMOTE |
Shared drive remote name | Str |
SERVER_SIDE |
Enable server-side copy. Default: False |
Bool |
RCLONE_COPY_FLAGS |
Copy flags (key:value,key) | Str |
RCLONE_UPLOAD_FLAGS |
Upload flags | Str |
RCLONE_DOWNLOAD_FLAGS |
Download flags | Str |
RC_INDEX_URL |
Public IP/domain for index | Str |
RC_INDEX_PORT |
Index port. Default: 8080 |
Str |
RC_INDEX_USER |
Index user. Default: admin |
Str |
RC_INDEX_PASS |
Index password. Default: admin |
Str |
UPLOAD_PATH_TEMPLATE |
Dynamic path template (e.g., "remote:/{username}/{category}/{date}/") |
Str |
Template Variables: {username}, {user_id}, {date}, {year}, {month}, {day}, {category}, {task_type}
| Variable | Description | Type |
|---|---|---|
GDRIVE_FOLDER_ID |
Folder/TeamDrive ID or root |
Str |
IS_TEAM_DRIVE |
Set True if TeamDrive |
Bool |
EXTENSION_FILTER |
Excluded file extensions (space-separated) | Str |
Note: Add
token.pickleto root for cloning. Use/filescommand to add via bot.
| Variable | Description | Type |
|---|---|---|
LEECH_SPLIT_SIZE |
Upload limit (2GB non-premium, 4GB premium) | Int |
EQUAL_SPLITS |
Split into equal parts. Default: False |
Bool |
USER_SESSION_STRING |
Pyrogram session string (Generate) | Str |
LEECH_LOG |
Chat ID(s) for uploads (space-separated, add -100 prefix) |
Str |
BOT_PM |
Send files to user's PM. Default: False |
Bool |
NAME_SUBSTITUTE |
Filename substitution pattern (old::new|old2::new2) |
Str |
| Variable | Description | Type |
|---|---|---|
MEGA_EMAIL |
MEGA account email | Str |
MEGA_PASSWORD |
MEGA account password | Str |
| Variable | Description | Type |
|---|---|---|
JD_EMAIL |
JDownloader account email | Str |
JD_PASSWORD |
JDownloader account password | Str |
| Variable | Description | Type |
|---|---|---|
QUEUE_ALL |
Max total concurrent tasks (0 = unlimited) |
Int |
QUEUE_DOWNLOAD |
Max concurrent downloads (0 = unlimited) |
Int |
QUEUE_UPLOAD |
Max concurrent uploads (0 = unlimited) |
Int |
| Variable | Description | Type |
|---|---|---|
QB_BASE_URL |
Bot URL for qBittorrent web selection | Str |
QB_SERVER_PORT |
Port. Default: 80 |
Int |
WEB_PINCODE |
Require pincode for torrent selection. Default: False |
Bool |
qBittorrent Note: For RAM issues, limit
MaxConnecs, decreaseAsyncIOThreadsCount, and setDiskWriteCacheSizeto 32.
| Variable | Description | Type |
|---|---|---|
SEARCH_API_LINK |
Torrent search API (Deploy) | Str |
SEARCH_LIMIT |
Results per site. Default: 0 |
Int |
SEARCH_PLUGINS |
qBittorrent search plugin URLs | List |
Build Docker image:
sudo docker build . -t rcmltb
Run the image:
sudo docker run -p 80:80 -p 8080:8080 rcmltb
Stop container:
sudo docker ps sudo docker stop <container_id>
Clear container:
sudo docker container prune
Delete images:
sudo docker image prune -a
NOTE: Change ports in
docker-compose.ymlif not using 80 (torrents) or 8080 (rclone).
Install docker-compose:
sudo apt install docker-compose
Build and run:
sudo docker-compose up
After editing files:
sudo docker-compose up --build
Stop/Start:
sudo docker-compose stop sudo docker-compose start
To generate USER_SESSION_STRING:
python3 session_generator.py
Run this on your PC from the repository folder.
docker-compose.yml includes a local mongo service with persistent storage.
DATABASE_URL in config.env:DATABASE_URL="mongodb://mongo:27017/rcmltb"
docker compose up -d
docker compose ps
MongoDB data persists in the mongo_data volume.
username and password, click Add my current IP AddressConnect → Connect your application<password> with your user's passwordNetwork Access, click Edit → Allow access from anywhere → ConfirmVideo Tutorial: YouTube Guide
rclone.conf for cloud-to-cloud copy1Fichier, 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, and more.
Requirements: OS with a browser. Windows users need Python3 and pip.
credentials.jsonpip3 install google-api-python-client google-auth-httplib2 google-auth-oauthlib python3 generate_drive_token.py
Using -d alone uses global options for aria2c/qBittorrent.
GlobalMaxRatio and GlobalMaxSeedingMinutes in qbittorrent.conf-1 = no limitMaxRatioActionSet
USE_SERVICE_ACCOUNTS="True"to enable. Recommended for Team Drive only.
List projects:
python3 gen_sa_accounts.py --list-projects
Enable services:
python3 gen_sa_accounts.py --enable-services $PROJECTID
Create Service Accounts:
python3 gen_sa_accounts.py --create-sas $PROJECTID
Download keys:
python3 gen_sa_accounts.py --download-keys $PROJECTID
Quick setup (new project):
python3 gen_sa_accounts.py --quick-setup 1 --new-only
Method 1: Via Google Group (Recommended)
cd accounts # Extract emails grep -oPh '"client_email": "\K[^"]+' *.json > emails.txt cd .. # Add emails.txt to Google Group, then add Group to Team Drive as Manager
Method 2: Direct add:
python3 add_to_team_drive.py -d SharedTeamDriveSrcID
For yt-dlp premium accounts or protected Index Links, create .netrc:
machine host login username password my_password
Example:
machine instagram login user.name password mypassword
Notes:
Aria2c index link example:
machine example.workers.dev password index_password
more like this
Free open-source Cloudflare R2 desktop client and S3 GUI for macOS, Windows, and Linux. Manage Cloudflare R2, AWS S3, M…
meine 🌒 - A CLI file manager and system utility built with Textual. It combines intuitive command parsing with rich t…
MTT File Manager is a Rust-based Windows file manager with tabbed navigation, rich media previews, deep system integrat…
search projects, people, and tags