Skip to content

Bot Settings (/botset) ​

This page explains every single setting in /botset. Each one is numbered so you can easily find it.

Who can use this: Only the bot owner and sudo users.


The 5 Buttons in /botset ​

When you send /botset to the bot, you see 5 buttons:

ButtonWhat you can do there
Config VariablesChange any setting from config.py
Module SettingsTurn features on or off with one tap
Private FilesUpload or delete sensitive files (rclone.conf, token.pickle, etc.)
Qbit SettingsChange qBittorrent options
Aria2c SettingsChange Aria2 download options

Section 1 — Config Variables ​

This is the complete list of every variable from config.py. They are listed in the exact same order as in the config_sample.py file. Each one has a serial number.

In /botset: Click Config Variables → you see pages of buttons labeled with variable names. Click any to edit it.


1.1 — Required (bot WILL NOT start without these) ​

1. BOT_TOKEN ​

What: Your bot's ID. Telegram uses this to know which bot is yours.

Where to get: Talk to @BotFather on Telegram:

  1. Send /newbot
  2. Pick a name and username
  3. BotFather gives you a token
1234567890:ABCdefGHIjklmNOPqrstUVwxyz-1234567
  1. Copy the whole thing

Put this in config.py:

python
BOT_TOKEN = "1234567890:ABCdefGHIjklmNOPqrstUVwxyz-1234567"

Default: "" (empty string).

If empty: Bot won't start. Can't connect to Telegram.


2. OWNER_ID ​

What: Your Telegram user ID number. This tells the bot "this person is the boss (owner)."

Where to get: Open Telegram → search @userinfobot → send /start → it shows your ID (a number like 123456789).

python
OWNER_ID = 123456789   # Replace with your actual user ID

Default: 0.

If empty (0): Bot won't start.


3. TELEGRAM_API ​

What: An ID number for your app, from Telegram's website.

Where to get: Go to my.telegram.org → log in with your phone → see "App api_id."

python
TELEGRAM_API = 1234567   # Replace with your actual API ID

Default: 0.

If empty (0): Bot won't start.


4. TELEGRAM_HASH ​

What: A secret key for your app (goes with TELEGRAM_API).

Where to get: Same website as above. It says "App api_hash."

python
TELEGRAM_HASH = "1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p"

Default: "" (empty string).

If empty: Bot won't start.


5. DATABASE_URL ​

What: The address of your MongoDB database. The bot stores all user data, settings, and tasks here.

Where to get:

  1. Go to MongoDB Atlas → create free account → create cluster
  2. Click "Connect" → "Connect your application" → copy the connection string
mongodb+srv://username:password@cluster0.abcde.mongodb.net/?retryWrites=true&w=majority
  1. Replace username and password with your MongoDB login
python
DATABASE_URL = "mongodb+srv://myuser:mypassword@cluster0.abcde.mongodb.net/?retryWrites=true&w=majority"

Default: "" (empty string).

If empty: The bot might start, but no data saves. /userset won't work.


1.2 — Optional Config (extra settings, in order) ​

6. DEFAULT_LANG ​

What: The language the bot speaks.

python
DEFAULT_LANG = "en"

Currently only "en" (English) is available.


7. TG_PROXY ​

What: A proxy for Telegram. Use this if Telegram is blocked in your area.

Don't need one? Leave it empty:

python
TG_PROXY = {}

Need one? Put the proxy details (username and password are optional):

python
TG_PROXY = {"scheme": "socks5", "hostname": "192.168.1.1", "port": 1080, "username": "user", "password": "pass"}

8. USER_SESSION_STRING ​

What: A session string that lets the bot use YOUR Telegram account for downloading files from Telegram.

This is advanced. If you don't know what this is, leave it empty.

python
USER_SESSION_STRING = ""

If empty: Bot uses its own account (some features won't work).


9. CMD_SUFFIX ​

What: A letter added to the end of every command.

Why: If you run two bots in the same group, /mirror would trigger both. With a suffix, one bot uses /mirrorx and the other uses /mirrory.

python
CMD_SUFFIX = "x"

Now you type /mirrorx instead of /mirror.

If empty: Commands work normally, no suffix.


10. AUTHORIZED_CHATS ​

What: A list of user IDs or chat IDs that are allowed to use the bot.

Put: IDs separated by spaces.

python
AUTHORIZED_CHATS = "123456789 987654321"

For groups with topics/threads: Use | to separate thread IDs.

python
AUTHORIZED_CHATS = "-100123456789|3"

This means "chat ID -100123456789, only thread 3."

If empty: Only the owner and sudo users can use the bot.


11. SUDO_USERS ​

What: User IDs with admin access (can use /botset, /admin, etc.).

python
SUDO_USERS = "123456789 987654321"

If empty: Only you (the owner) has admin access.


12. STATUS_LIMIT ​

What: How many task status messages show at once.

python
STATUS_LIMIT = 10

If 10: If 20 tasks are running, only the first 10 show in /status.

If 0: Shows ALL tasks.


13. DEFAULT_UPLOAD ​

What: Where files go by default (when you don't use -up in the command).

ValueDestination
"rc"Rclone cloud storage
"gd"Google Drive
python
DEFAULT_UPLOAD = "rc"

14. STATUS_UPDATE_INTERVAL ​

What: How often (in seconds) the status messages refresh.

python
STATUS_UPDATE_INTERVAL = 15

If 15: Refreshes every 15 seconds. Lower = more frequent updates (uses more resources).


15. FILELION_API ​

What: Your FileLion.cc API key. Needed to upload files to FileLion.

python
FILELION_API = "your-api-key"

If empty: FileLion uploads won't work.


16. STREAMWISH_API ​

What: Your StreamWish API key. Needed to upload files to StreamWish.

python
STREAMWISH_API = "your-api-key"

If empty: StreamWish uploads won't work.


17. EXCLUDED_EXTENSIONS ​

What: File types the bot should SKIP during upload.

python
EXCLUDED_EXTENSIONS = "exe msi bat tmp"

This skips .exe, .msi, .bat, .tmp files.

If empty: All file types are uploaded.


18. INC_TASK_NOTIFY ​

What: Whether the bot tells you about unfinished tasks when it restarts.

python
INC_TASK_NOTIFY = False

If True: Bot sends a message listing tasks that didn't finish.

If False: No notification.


19. YT_DLP_OPTIONS ​

What: Default options for yt-dlp (the tool that downloads videos from YouTube and other sites).

Format: key:value|key:value

python
YT_DLP_OPTIONS = "format:best|outtmpl:%(title)s.%(ext)s"

If empty: yt-dlp uses its own defaults.


20. USE_SERVICE_ACCOUNTS ​

What: Whether to use Google Service Accounts. These are multiple "fake" Google Drive accounts that share the upload work to avoid daily limits.

python
USE_SERVICE_ACCOUNTS = False

If True: You also need to upload accounts.zip through Private Files.


21. NAME_SWAP ​

What: Automatically rename files by swapping old text with new text.

Format: old:new|old2:new2

python
NAME_SWAP = "1080p:HD|x265:HEVC"

This replaces "1080p" with "HD" and "x265" with "HEVC" in filenames.

If empty: No renaming.


22. FFMPEG_CMDS ​

What: Custom FFmpeg command presets for processing media files.

Format: A dictionary {name: command}.

python
FFMPEG_CMDS = {"compress": "-crf 28", "screenshot": "-vf fps=1/60"}

Now users can use /leech link -ff compress or /leech link -ff screenshot.

If empty: No custom presets available.


23. UPLOAD_PATHS ​

What: Custom upload folders for different file types.

python
UPLOAD_PATHS = {".mp4": "Videos", ".mp3": "Music"}

.mp4 files go to Videos/, .mp3 files go to Music/.

If empty: All files go to the root folder.


24. WEB_ACCESS_PASSWORD ​

What: A secret used to generate proxy passwords for the web UI. The bot logs the derived passwords at startup.

python
WEB_ACCESS_PASSWORD = "mysecretkey"

If empty: The bot generates one automatically. You'll see it in the startup logs.


1.3 — Hyper TG Downloader ​

25. USE_HYPER ​

What: Enable or disable the Hyper Downloader / Hyper Uploader system. When ON, the bot uses parallel connections for much faster Telegram file transfers.

python
USE_HYPER = True

If True: Faster downloads and uploads from Telegram (recommended).

If False: Falls back to standard single-threaded transfer.


26. HELPER_TOKENS ​

What: Extra bot tokens (from @BotFather) for handling tasks in parallel. Each extra bot can work on its own task.

python
HELPER_TOKENS = "123:abc 456:def"

If empty: Only the main bot handles all tasks.


26b. HELPER_STRINGS ​

What: Extra Pyrogram user session strings, space-separated. Paired with the helper bots so large files can be split across several user accounts too.

python
HELPER_STRINGS = "session1 session2"

Generate them with /exportsession.


26c. HELPER_BOT_PROXIES / HELPER_USER_PROXIES ​

What: Proxies for the helper bot tokens and helper user sessions, in the same order as the tokens/strings above. Space-separated.

python
HELPER_BOT_PROXIES = "socks5://host:port socks5://host2:port"
HELPER_USER_PROXIES = "socks5://host3:port"

If empty: Helpers connect directly.


1.4 — Mega.nz ​

26. MEGA_EMAIL ​

What: Your Mega.nz account email. A free Mega account gives you more download bandwidth.

python
MEGA_EMAIL = "youremail@example.com"

27. MEGA_PASSWORD ​

What: Your Mega.nz account password.

python
MEGA_PASSWORD = "yourpassword"

If both empty: Mega downloads still work but with limited free bandwidth.


28. DISABLE_MEGA ​

What: Turn OFF Mega.nz support completely.

python
DISABLE_MEGA = False

If True: Bot ignores all Mega links.


1.5 — Disable Options (turn features OFF) ​

These can also be toggled in Module Settings (Section 2 below). Here they are as config.py variables.

29. DISABLE_TORRENTS ​

python
DISABLE_TORRENTS = True

If True: All torrent downloads are blocked. Default: False.


30. DISABLE_LEECH ​

python
DISABLE_LEECH = True

If True: All leech commands are blocked — the user gets "The Leech command is currently disabled." Default: False.


31. DISABLE_MIRROR ​

python
DISABLE_MIRROR = True

If True: All mirror commands are blocked. /uphoster still works. Default: False.


32. DISABLE_BULK ​

python
DISABLE_BULK = True

If True: The -b flag is blocked — users can't queue many links from one message or text file. Default: False.


33. DISABLE_MULTI ​

python
DISABLE_MULTI = True

If True: The -i flag is blocked — users can't chain multiple replied links into one task run. Default: False.


34. DISABLE_SEED ​

python
DISABLE_SEED = True

If True: The -d flag is blocked, so torrents never seed after downloading. Default: False.


35. DISABLE_FF_MODE ​

python
DISABLE_FF_MODE = True

If True: The -ff flag is blocked — no custom FFmpeg commands. Default: False.


36. DISABLE_MEGA ​

python
DISABLE_MEGA = True

If True: Mega.nz downloads are blocked. Default: False.


39. DISABLE_RSS ​

python
DISABLE_RSS = True

If True: RSS feed monitoring stops. Saves CPU. Default: False.


python
DISABLE_SEARCH = True

If True: /search is blocked. Default: False.


41. DISABLE_YTDLP ​

python
DISABLE_YTDLP = True

If True: /ytdl and /ytdlleech refuse to run. Default: False.


1.6 — Telegraph ​

35. AUTHOR_NAME ​

What: The author name shown on Telegraph pages (the web pages the bot creates for search results).

python
AUTHOR_NAME = "HKML-X"

36. AUTHOR_URL ​

What: A clickable link on Telegraph pages. Put your Telegram channel URL here so people can click to join.

python
AUTHOR_URL = "https://t.me/HKML_X"

1.7 — Task Limits (size caps per source type) ​

Most limits are in GB. Set to 0 for no limit.

#VariableWhat it limits
37DIRECT_LIMITDirect link downloads
38MEGA_LIMITMega.nz downloads
39TORRENT_LIMITTorrent downloads
40GD_DL_LIMITGoogle Drive downloads
41RC_DL_LIMITRclone downloads
42CLONE_LIMITGoogle Drive clone (copy)
45YTDLP_LIMITyt-dlp (YouTube, etc.) downloads
46PLAYLIST_LIMITMax items from a playlist (count, not GB)
47LEECH_LIMITLeech (Telegram upload) size
48EXTRACT_LIMITExtracted (unzipped) file size
49ARCHIVE_LIMITArchive (zip/rar) creation size
50STORAGE_LIMITMin free disk space on server (GB). Stops new downloads if exceeded

Example:

python
DIRECT_LIMIT = 5   # Max 5 GB for direct links
TORRENT_LIMIT = 20 # Max 20 GB for torrents
STORAGE_LIMIT = 10 # Keep at least 10 GB free on server

1.8 — Image Display ​

51. USE_IMAGES ​

What: Whether the bot shows random background images on its messages.

python
USE_IMAGES = False

If True: Bot messages show nice backgrounds. You also need IMG_SEARCH set.


What: Keywords to search for wallpaper images. The bot downloads these on startup.

python
IMG_SEARCH = "anime, nature, space"

If empty: No images are auto-searched.


53. IMG_PAGE ​

What: How many pages of images to search per keyword. Each page has about 70 images.

python
IMG_PAGE = 1   # 70 images per keyword

54. IMG_SOURCES ​

What: Which websites to fetch images from.

OptionSite
"wallpaperflare"wallpaperflare.com
"peapix"peapix.com
"wallhaven"wallhaven.cc
python
IMG_SOURCES = ["wallpaperflare"]

1.9 — Instagram Downloader ​

55. INSTADL_API ​

What: API key for downloading Instagram videos.

python
INSTADL_API = "your-api-key"

If empty: Instagram downloads won't work.


58. IMDB_TEMPLATE ​

What: The HTML template used to display movie/TV show search results.

Leave this as-is unless you know HTML.

python
IMDB_TEMPLATE = """<b>Title: </b> {title} [{year}]
<b>Also Known As:</b> {aka}
<b>Rating ⭐️:</b> <i>{rating}</i>
<b>Release Info: </b> <a href="{url_releaseinfo}">{release_date}</a>
<b>Genre: </b>{genres}
<b>IMDb URL:</b> {url}
<b>Language: </b>{languages}
<b>Country of Origin : </b> {countries}

<b>Story Line: </b><code>{plot}</code>

<a href="{url_cast}">Read More ...</a>"""

1.12 — Task Tools ​

59. FORCE_SUB_IDS ​

What: Channel or group IDs that users MUST join before using the bot.

Why: To grow your Telegram channel. Users can't mirror/leech until they join.

python
FORCE_SUB_IDS = "-100123456789 -100987654321"

If empty: No force subscription. Anyone can use the bot.


60. MEDIA_STORE ​

What: Whether the bot stores info about uploaded media files so it can re-upload them faster later.

python
MEDIA_STORE = True

If True: Media info is cached. Re-uploading is faster.

If False: No caching. Each upload processes from scratch.


What: Whether the bot deletes the original link message as soon as the task starts.

python
DELETE_LINKS = False

If True: Keeps chats clean by removing the link message immediately.


1.13 — Limiters ​

63. BOT_MAX_TASKS ​

What: Maximum total tasks (including queued ones) the bot handles at once.

python
BOT_MAX_TASKS = 0   # 0 = unlimited
BOT_MAX_TASKS = 10  # Max 10 tasks total

64. USER_MAX_TASKS ​

What: Maximum concurrent tasks per user.

python
USER_MAX_TASKS = 0   # 0 = unlimited
USER_MAX_TASKS = 2   # Max 2 tasks per user

65. USER_TIME_INTERVAL ​

What: Cooldown (in seconds) between a user's tasks.

python
USER_TIME_INTERVAL = 30  # 30 seconds between tasks

If 0: No cooldown. Users can spam tasks.


66. VERIFY_TIMEOUT ​

What: Time limit (in seconds) for users to complete verification.

python
VERIFY_TIMEOUT = 0    # 0 = disabled
VERIFY_TIMEOUT = 300  # 5 minutes

If 0: Verification is disabled.


67. LOGIN_PASS ​

What: A password that lets users skip the verification system.

python
LOGIN_PASS = "mypassword123"

If empty: No password bypass available.


1.14 — Bot Settings ​

68. BOT_PM ​

What: Force all files/links to be sent to the bot owner's private messages.

python
BOT_PM = False

If True: Files go to owner's PM instead of the group where the command was used.


69. SET_COMMANDS ​

What: Whether the bot tells Telegram what commands it supports (the list you see when typing /).

python
SET_COMMANDS = True

If False: You'll have to remember commands manually.


70. TIMEZONE ​

What: Timezone for all timestamps.

python
TIMEZONE = "Asia/Kolkata"

Common values:

LocationValue
IndiaAsia/Kolkata
US EastAmerica/New_York
US WestAmerica/Los_Angeles
UKEurope/London
JapanAsia/Tokyo

1.15 — Google Drive ​

71. GDRIVE_ID ​

What: Your default Google Drive folder ID.

How to find: Open the folder in your browser. The URL looks like:

https://drive.google.com/drive/u/0/folders/1a2b3c4d5e6f7g8h9i0j

The folder ID is the long string at the end: 1a2b3c4d5e6f7g8h9i0j

python
GDRIVE_ID = "1a2b3c4d5e6f7g8h9i0j"

If empty: Google Drive uploads will fail unless users specify a custom destination.


72. GD_DESP ​

What: Description text shown on files uploaded to Google Drive.

python
GD_DESP = "Uploaded with WZ Bot"

73. IS_TEAM_DRIVE ​

What: Set this to True if your GDRIVE_ID is a Team Drive (shared drive).

python
IS_TEAM_DRIVE = False

If True: Bot handles it as a Team Drive (different API behavior).


74. STOP_DUPLICATE ​

What: If a file with the same name already exists in Google Drive, the bot skips the upload instead of duplicating.

python
STOP_DUPLICATE = False

If True: Bot checks for existing files and skips if found. Saves space.


75. INDEX_URL ​

What: Your Google Drive Index URL. Lets the bot generate direct download links.

python
INDEX_URL = "https://example-workers.example.workers.dev/0:/"

If empty: Bot won't show "Open in browser" links for Google Drive files.


75b. DRIVE_CATEGORY_MODE ​

What: Enable categories for Google Drive uploads. Users can organize uploads into different folders by content type (Movies, TV, Music, etc.).

python
DRIVE_CATEGORY_MODE = False

If True: Users can select a category before uploading. Categories are set up via categories.txt in Private Files or user drive categories in /userset.


75c. DRIVE_CATEGORY_SA ​

What: Service account to use specifically for drive category uploads.

python
DRIVE_CATEGORY_SA = ""

If empty: Uses the default service account or token.pickle.


1.16 — YouTube Tools ​

76. YT_DESP ​

What: Description text for YouTube uploads.

python
YT_DESP = "Uploaded to YouTube by HKML-X bot"

77. YT_TAGS ​

What: Tags for YouTube videos (helps people find them).

python
YT_TAGS = ["telegram", "bot", "youtube"]

You can also use a comma-separated string: "telegram, bot, youtube".


78. YT_CATEGORY_ID ​

What: YouTube video category.

IDCategory
22People & Blogs
1Film & Animation
10Music
20Gaming
python
YT_CATEGORY_ID = 22

79. YT_PRIVACY_STATUS ​

What: Privacy setting for YouTube uploads.

ValueWho can see it
"public"Everyone
"unlisted"Only people with the link
"private"Only you
python
YT_PRIVACY_STATUS = "unlisted"

1.17 — Rclone ​

80. RCLONE_PATH ​

What: Default Rclone destination path.

python
RCLONE_PATH = "main:folder/subfolder"

main = the remote name from rclone.conf. folder/subfolder = path inside that remote.

If empty: Rclone uploads need a path specified in the command.


81. RCLONE_FLAGS ​

What: Extra flags for Rclone. Format: key:value|key

python
RCLONE_FLAGS = "ignore-case:true|skip-links"

If empty: Rclone uses default flags.


82. RCLONE_SERVE_URL ​

What: Public URL for Rclone serve web access. Lets users download files via browser.

python
RCLONE_SERVE_URL = "http://123.123.123.123"

If empty: No Rclone serve web access.


What: Show a "Cloud Link" button on leeched files.

python
SHOW_CLOUD_LINK = True

84. RCLONE_SERVE_PORT ​

What: Port for Rclone serve.

python
RCLONE_SERVE_PORT = 8081

If 0: Uses default port 8081.


85. RCLONE_SERVE_USER ​

What: Username for Rclone serve login.

python
RCLONE_SERVE_USER = "admin"

86. RCLONE_SERVE_PASS ​

What: Password for Rclone serve login.

python
RCLONE_SERVE_PASS = "mypassword"

If both empty: No login required for Rclone serve.


1.20 — Updates ​

90. UPSTREAM_REPO ​

What: Your GitHub repo URL for auto-updates. The bot checks here for new versions.

python
UPSTREAM_REPO = "https://github.com/your-username/mirror-leech-telegram-bot"

If empty: Auto-update is disabled.


91. UPSTREAM_BRANCH ​

What: Which branch of your repo to track.

python
UPSTREAM_BRANCH = "master"

1.20b — Telemetry ​

92b. ENABLE_TELEMETRY ​

What: Whether the bot sends crash reports to a remote server. This helps developers fix bugs faster.

python
ENABLE_TELEMETRY = True

If True: Crash traces are sent to a remote worker. No personal data is collected.

If False: No data is sent. Crashes are silent.


1.21 — Leech Settings (Telegram upload) ​

93. LEECH_SPLIT_SIZE ​

What: Max file size per piece (in bytes) when splitting. Telegram limit is ~2GB (4GB for premium).

Common values:

  • 2097152000 = 2 GB
  • 1073741824 = 1 GB
  • 536870912 = 512 MB
python
LEECH_SPLIT_SIZE = 2097152000

If 0: Uses the maximum Telegram allows.


94. AS_DOCUMENT ​

What: Send all files as documents (raw files, no preview).

python
AS_DOCUMENT = False

If False: Videos play inline, images show in chat.

If True: Everything is a raw file.


95. EQUAL_SPLITS ​

What: Split files into equal-sized parts.

python
EQUAL_SPLITS = False

If True: All parts are exactly the same size instead of having one smaller leftover part.


96. MEDIA_GROUP ​

What: Group split parts as a single media album in Telegram.

python
MEDIA_GROUP = False

If True: Split parts appear as one album instead of separate messages.


97. TRANSMISSION_MODE ​

What: Which account uploads leeched files by default.

python
TRANSMISSION_MODE = "both"
ValueMeaningPer-task flag
"bot"The bot account uploads everything. Capped at 2GB per file.-bt
"user"Your user account uploads everything. Needs USER_SESSION_STRING.-ut
"both"Hybrid — bot handles files ≤2GB, user handles bigger ones. Default.-hl

Users can override this for themselves in /userset → Leech Settings, or for one task with the flag above.


99. LEECH_PREFIX ​

What: Text added BEFORE the filename.

python
LEECH_PREFIX = "[WZML] "

video.mp4 becomes [WZML] video.mp4.

Default: "" (empty).

If empty: No prefix added.


100. LEECH_SUFFIX ​

What: Text added AFTER the filename.

python
LEECH_SUFFIX = " - by bot"

video.mp4 becomes video.mp4 - by bot.

Default: "" (empty).

If empty: No suffix added.


101. LEECH_FONT ​

What: Text formatting for captions.

CodeEffect
"b"Bold
"i"Italic
"u"Underline
"s"Strikethrough
"code"monospace
"spoiler"||spoiler||
python
LEECH_FONT = "b"

If empty: No formatting.


102. LEECH_CAPTION ​

What: Custom caption text on every leeched file. Supports HTML.

python
LEECH_CAPTION = "Downloaded by <b>HKML-X Bot</b>"

If empty: No caption.


103. THUMBNAIL_LAYOUT ​

What: Thumbnail image size. Format: WxH in pixels.

python
THUMBNAIL_LAYOUT = "1280x720"

If empty: Uses default dimensions.


1.22 — Log Channels ​

104. LEECH_DUMP_CHAT ​

What: A chat/group ID where ALL leeched files are automatically sent.

python
LEECH_DUMP_CHAT = ""

Example with a value:

python
LEECH_DUMP_CHAT = "-100123456789"

If empty: Files appear wherever the command was run.


What: Chat ID where the bot logs all links users send.

python
LINKS_LOG_ID = ""

Example with a value:

python
LINKS_LOG_ID = "-100123456789"

If empty: No link logging.


106. MIRROR_LOG_ID ​

What: Chat ID(s) for task completion logs. Space-separated for multiple.

python
MIRROR_LOG_ID = "-100123456789 -100987654321"

If empty: No mirror logging.


1.23 — qBittorrent & Aria2c ​

107. TORRENT_TIMEOUT ​

What: How long (seconds) before a dead torrent is canceled.

python
TORRENT_TIMEOUT = 3600  # 1 hour

If 0: Dead torrents wait forever.


107b. CPU_LIMIT ​

What: Maximum CPU usage for background services like FFmpeg and file processing.

python
CPU_LIMIT = 20

If 20: Services use at most 20% CPU. Increase for faster processing on powerful servers.


107c. THROTTLE_SERVICES ​

What: Whether to pause background services during heavy download/upload operations.

ValueBehavior
"auto"Pause services when CPU or disk usage is high
"off"Never pause services
python
THROTTLE_SERVICES = "auto"

108. BASE_URL ​

What: Your server's public URL for the web file-selection UI (choose which files to download from a torrent).

python
BASE_URL = "http://123.123.123.123:8080"

If empty: No web UI. Torrents download all files.


109. WEB_PINCODE ​

What: Whether the web UI asks for a pincode.

python
WEB_PINCODE = True

If True: You enter a pincode to access the web UI.

If False: Anyone with the URL can access it.


1.24 — Queue System ​

110. QUEUE_ALL ​

What: Max total tasks (download + upload) running at once.

python
QUEUE_ALL = 0    # Unlimited
QUEUE_ALL = 5    # Max 5 tasks total

111. QUEUE_DOWNLOAD ​

What: Max downloads running at once.

python
QUEUE_DOWNLOAD = 0   # Unlimited
QUEUE_DOWNLOAD = 3   # Max 3 downloads

112. QUEUE_UPLOAD ​

What: Max uploads running at once.

python
QUEUE_UPLOAD = 0   # Unlimited
QUEUE_UPLOAD = 3   # Max 3 uploads

1.25 — RSS ​

113. RSS_DELAY ​

What: How often (seconds) the bot checks RSS feeds.

python
RSS_DELAY = 600   # Every 10 minutes

114. RSS_CHAT ​

What: Chat ID where RSS notifications are sent.

python
RSS_CHAT = ""

Example with a value:

python
RSS_CHAT = "-100123456789"

If empty: Notifications go nowhere.


115. RSS_SIZE_LIMIT ​

What: Max download size per RSS item (GB).

python
RSS_SIZE_LIMIT = 0   # Unlimited
RSS_SIZE_LIMIT = 10  # Max 10 GB per item

What: URL of a search API app. Lets users search multiple torrent sites from the bot.

python
SEARCH_API_LINK = "https://your-search-api.com"

If empty: /search command won't work.


117. SEARCH_LIMIT ​

What: Max search results per site.

python
SEARCH_LIMIT = 0   # 0 = use API default limit

118. SEARCH_PLUGINS ​

What: List of plugin URLs for qBittorrent search (lets the bot search different torrent sites).

Default: 17 plugins (PirateBay, 1337x, YTS, etc.)

python
SEARCH_PLUGINS = [
    "https://raw.githubusercontent.com/.../piratebay.py",
    "https://raw.githubusercontent.com/.../leetx.py",
]

1.27 — Extra Variables (in /botset but not in config_sample.py) ​

These variables exist in the bot's database system. You can edit them in /botset even though they aren't in the sample config file.

119. COLORED_BTNS ​

What: Whether buttons have colors or are plain gray.

python
COLORED_BTNS = False

If True: Buttons show in green/red colors. Looks nicer.


120. INC_TASK_RESUME ​

What: Whether the bot auto-resumes incomplete tasks on restart.

python
INC_TASK_RESUME = False

If True: Bot tries to continue unfinished tasks after restart.


120b. ALLDEBRID_API_KEY ​

What: Your AllDebrid API key. This is what powers the -ad flag.

python
ALLDEBRID_API_KEY = "your-api-key"

What -ad does:

  • /mirror <filehost link> -ad — unlocks premium hosts (1fichier, rapidgator, mega, ...) and hands a direct link to the normal downloader.
  • /leech <magnet> -ad (or reply to a .torrent with -ad) — uploads the torrent to AllDebrid, waits for it to finish there, then pulls every file from AllDebrid's CDN. aria2 and qBittorrent are bypassed entirely, so dead torrents finish faster on a debrid plan.

If empty: Any task using -ad fails with ALLDEBRID_API_KEY is not configured. Tasks without -ad are unaffected.

Magnets stop after 3 minutes with no seeders, and 2 hours overall. Failed tasks are removed from your AllDebrid history.


What: API key for Debrid-Link.com (premium hoster support).

python
DEBRID_LINK_API = "your-api-key"

122. GOFILE_API ​

What: Gofile.io API token for uploads.

python
GOFILE_API = "your-api-token"

123. GOFILE_FOLDER_ID ​

What: Gofile.io folder ID for uploads.

python
GOFILE_FOLDER_ID = "your-folder-id"

123b. GOFILE_AUTO_CREATE_FOLDER ​

What: Whether to automatically create a new folder for each upload on Gofile.

python
GOFILE_AUTO_CREATE_FOLDER = False

If True: Each upload gets its own folder. Helps keep files organized.


124. PIXELDRAIN_KEY ​

What: PixelDrain API key.

python
PIXELDRAIN_KEY = "your-api-key"

125. PROTECTED_API ​

What: ProtectedFiles.cc API key.

python
PROTECTED_API = "your-api-key"

126. BUZZHEAVIER_API ​

What: BuzzHeavier API key.

python
BUZZHEAVIER_API = "your-api-key"

127. DEVUPLOADS_KEY ​

What: DevUploads API key.

python
DEVUPLOADS_KEY = "your-api-key"

128. DEVUPLOADS_FOLDER ​

What: DevUploads folder ID.

python
DEVUPLOADS_FOLDER = "your-folder-id"

129. VIKINGFILE_HASH ​

What: VikingFile.to hash.

python
VIKINGFILE_HASH = "your-hash"

130. VIKINGFILE_FOLDER ​

What: VikingFile.to folder ID.

python
VIKINGFILE_FOLDER = "your-folder-id"

131. HYPER_THREADS ​

What: Number of parallel download parts for the Hyper Downloader.

python
HYPER_THREADS = 0   # 0 = auto (bot decides)

132. HYPER_PIPELINE ​

What: Concurrent file requests per Hyper DL part.

python
HYPER_PIPELINE = 32

133. HYPER_CHUNK ​

What: Download chunk size in bytes.

python
HYPER_CHUNK = 262144   # 256 KB

135. IMAGES ​

What: A list of image URLs or file_ids used as background images on bot messages.

How to manage: Use the /addimage command in the bot.

This is not edited directly in config.py. Manage it through the bot's /addimage command.


Line-by-line recap: config_sample.py order ​

#VariableFrom section in config_sample.py
1–5BOT_TOKEN through DATABASE_URLREQUIRED CONFIG
6–24DEFAULT_LANG through WEB_ACCESS_PASSWORDOPTIONAL CONFIG
25HELPER_TOKENSHyper Tg Downloader
26–28MEGA_EMAIL through DISABLE_MEGAMegaAPI
29–41DISABLE_TORRENTS through DISABLE_YTDLPDisable Options
35–36AUTHOR_NAME, AUTHOR_URLTelegraph
37–50DIRECT_LIMIT through STORAGE_LIMITTask Limits
51–54USE_IMAGES through IMG_SOURCESImage Search
55INSTADL_APIInsta downloader
58IMDB_TEMPLATEMedia Search
59–61FORCE_SUB_IDS through DELETE_LINKSTask Tools
63–67BOT_MAX_TASKS through LOGIN_PASSLimiters
68–70BOT_PM through TIMEZONEBot Settings
71–75GDRIVE_ID through INDEX_URLGDrive Tools
76–79YT_DESP through YT_PRIVACY_STATUSYT Tools
80–86RCLONE_PATH through RCLONE_SERVE_PASSRclone
90–91UPSTREAM_REPO, UPSTREAM_BRANCHUpdate
93–103LEECH_SPLIT_SIZE through THUMBNAIL_LAYOUTLeech
104–106LEECH_DUMP_CHAT through MIRROR_LOG_IDLog Channels
107–109TORRENT_TIMEOUT through WEB_PINCODEqBittorrent/Aria2c
110–112QUEUE_ALL through QUEUE_UPLOADQueueing system
113–115RSS_DELAY through RSS_SIZE_LIMITRSS
116–118SEARCH_API_LINK through SEARCH_PLUGINSTorrent Search
119–135COLORED_BTNS through IMAGESExtra (not in sample)

Section 2 — Module Settings ​

These are the same DISABLE_* variables from Section 1 (numbers 29–39), shown as one-tap toggles.

ToggleVariableWhat it turns OFF
TorrentsDISABLE_TORRENTSAll torrent downloads
LeechDISABLE_LEECHAll leech commands
MirrorDISABLE_MIRRORAll mirror commands
BulkDISABLE_BULKThe -b flag (many links from one message)
MultiDISABLE_MULTIThe -i flag (multiple replied links)
SeedDISABLE_SEEDThe -d flag (torrent seeding)
FF ModeDISABLE_FF_MODEThe -ff flag (custom FFmpeg commands)
MegaDISABLE_MEGAMega.nz downloads
RSSDISABLE_RSSRSS feed monitoring
SearchDISABLE_SEARCH/search
YT-DLPDISABLE_YTDLP/ytdl and /ytdlleech

How to use: Tap the toggle. Read it as "is this feature disabled?" — so the toggle being on means the feature is off.


Section 3 — Private Files ​

Upload or delete sensitive files that the bot needs.

How to upload:

  1. Click Private Files → Create New File
  2. Send the file as a document
  3. Bot saves it

How to delete:

  1. Click Add/Delete File
  2. Send the filename as text (e.g., rclone.conf)

Files you can manage ​

FileWhy you'd upload it
config.pyYour bot config (uploading reloads it)
token.pickleGoogle Drive login
rclone.confRclone cloud storage settings
accounts.zipGoogle Service Accounts (zip of .json files)
list_drives.txtCustom drives for /list command
shortener.txtURL shortener API keys
categories.txtUpload categories with different drive IDs
cookies.txtBrowser cookies for restricted sites (YouTube etc.)
terabox.txtTerabox session cookies

File formats ​

list_drives.txt — each line: Name drive_id index_url

Main 1a2b3c4d5e https://driveindex.com/1a2b/
Movies 2b3c4d5e6f

shortener.txt — each line: domain api_key

gplinks.in abc123def456

categories.txt — each line: Name drive_id index_url

Movies 1a2b3c4d5e https://driveindex.com/movies/
TV 2b3c4d5e6f

Section 4 — Qbit Settings ​

qBittorrent options. Click any to edit.

Common optionWhat it does
max_ratioStop seeding at this ratio (e.g., 2.0 = seed until 2x uploaded)
max_seeding_timeStop seeding after N minutes (e.g., 1440 = 24 hours)
max_active_downloadsMax torrents downloading at once
max_active_torrentsMax torrents total (downloading + seeding)
queueing_enabledTurn torrent queue on/off

Sync Qbittorrent button: Reloads options from qBittorrent.


Section 5 — Aria2c Settings ​

Aria2 options. Click any to edit.

Common optionWhat it does
max-connection-per-serverConnections per server (default 16)
splitHow many parts per download
max-concurrent-downloadsDownloads at once
bt-stop-timeoutStop dead torrents (seconds)
seed-ratioStop seeding at this ratio
seed-timeStop seeding after N minutes

Add new key button: Add custom Aria2 options not already listed.


Important Notes ​

  • Restart needed for these variables: BOT_TOKEN, DATABASE_URL, OWNER_ID, TELEGRAM_HASH, TELEGRAM_API, TG_PROXY, AUTHORIZED_CHATS, CMD_SUFFIX, USER_SESSION_STRING. The bot will tell you.

  • Use /botset in a private chat with the bot, not in a group.

  • Only owner and sudo users can access /botset.

  • Made a mistake? Click Reset to go back to the default value.