Advanced Usage
This guide covers advanced BDrive configuration options to enhance performance and security.
Multi-Threaded Streams
If you experience buffering issues, enable multi-threaded options to significantly improve streaming performance:
[tg.stream]
multi-threads = 6
stream-buffers = 20For Rclone use these options:
--vfs-read-chunk-size=32M
--vfs-read-chunk-streams=4
--teldrive-threaded-streams=1NOTE
- You may not need this if your telegram dc is close to your location.
- Keep
multi-threadsvalue at 8 or lower to prevent excessive CPU usage. - You can tweak these params to find the best performance for your connection.Don't set
vfs-read-chunk-sizetoo high, as it may cause buffering issues.
File Encryption
Enable file encryption to secure your data:
[tg.uploads]
encryption-key = "your-key"You can generate a secure random encryption key using the key generator tool in the usage guide.
NOTE
- Add
encrypt_files = truein your rclone config when enabling encryption - Store your encryption key securely - you can't recover files without it
- BDrive's encryption is more secure than rclone's crypt implementation as it generates a random salt for each file part rather than using the same salt for all files
- Enabling encryption in BDrive makes the UI fully compatible with encrypted files
Adding Bot Tokens
Bot tokens are essential for optimal Telegram API interaction. To create and add bot tokens:
- Open Telegram and search for
@BotFather - Start a chat and type
/newbot - Follow the prompts to set a name and username (must end with
bot) - BotFather will provide your bot token
- Add 7-8 bot tokens in the BDrive UI Settings for better upload/download speeds
WARNING
Bots will be automatically added as admins in your channel when set through the UI. If this fails, add them manually. For newly created Telegram sessions, you must wait 20-30 minutes before adding bots to a channel. You'll see a FRESH_CHANGE_ADMINS_FORBIDDEN error if you try too soon.
Using a Thumbnail Resizer
BDrive supports on-the-fly image resizing using imgproxy for thumbnail viewing:
services:
imgproxy:
image: darthsim/imgproxy
container_name: imgproxy
environment:
IMGPROXY_ALLOW_ORIGIN: "*"
IMGPROXY_ENFORCE_WEBP: true
IMGPROXY_MALLOC: "jemalloc"
restart: always
ports:
- 8000:8080Start the service:
docker compose up -dFor better performance:
- Deploy imgproxy behind Cloudflare or another web server with caching
- Enter the URL of your deployed resizer service in the BDrive UI settings
Zip Downloads
BDrive bundles multiple files — or a whole folder — into a single archive on the server and streams it straight to the browser. Nothing is buffered to disk or to memory, so a folder larger than the server's RAM downloads fine.
This is on by default. Only set these if you want to change that:
[files]
enable-archive-browsing = true
enable-zip-browsing = false
enable-cbz-browsing = true
enable-unitypkg-browsing = true
enable-zip-download = true
zip-max-files = 10000
zip-max-size = 0
zip-max-concurrent = 4enable-archive-browsing— master switch for all archive browsing (zip, CBZ, Unity packages). Turning this off disables all archive browsing regardless of the per-format flags below.enable-zip-browsing— enable zip virtual folder browsing. Off by default.enable-cbz-browsing— enable the CBZ comic reader with ComicInfo.xml metadata.enable-unitypkg-browsing— enable Unity package virtual folder browsing.enable-zip-download— turn the zip download feature off entirely. The Download as Zip action disappears from the UI, and both zip endpoints return403.zip-max-files— reject a request that would bundle more than this many files. Set0for no limit.zip-max-size— reject a request whose total uncompressed size exceeds this many bytes. Set0for no limit.zip-max-concurrent— how many archives may stream at once. Requests beyond this get503rather than queueing. Set0for no limit.
Both limits are checked before the response starts, so an oversized request gets a proper 413 instead of a download that dies part-way through.
NOTE
Already-compressed files (video, images, audio, archives) are stored in the zip rather than deflated. Re-compressing them costs CPU and saves nothing.
TIP
Share links can be zipped too. If the share owner has no bot tokens configured, BDrive falls back to their own Telegram session, so zipping works either way.
