- Download YouTube videos in any quality (360p, 480p, 720p, 1080p, 1440p, 4K)
- Download audio only as MP3 (192kbps)
- Clip specific portions of a video (e.g. only from 1:35 to 4:24)
- Upload files, videos, or photos directly to Drive (up to 20MB)
- Progress bar for downloads and uploads
- Get notified when your video is watchable on Google Drive
- Restrict access to specific Telegram users
- All credentials stay on your machine — nothing stored externally
- Send a YouTube link — downloads the video and uploads it to your Drive
- /quality — choose your preferred download quality
- /clip 1:35 4:24 https://youtu.be/abc123 — download only a specific portion
- Send any file — uploads it directly to your Drive (max 20MB)
| Software | How to Install |
|---|---|
| Python 3.10+ | python.org — check "Add Python to PATH" during install |
| FFmpeg | winget install Gyan.FFmpeg |
| Deno | winget install DenoLand.Deno then run yt-dlp --remote-components ejs:github once |
- Click the green Code button at the top of this page
- Click Download ZIP
- Unzip it to a folder on your computer (e.g.
C:\Users\YourName\Documents\youtube-to-drive-bot) - Remember where you put this folder — you'll need it later
- Open Telegram and search for
@BotFather - Send
/newbotand follow the prompts - Copy the bot token (looks like
1234567890:ABCdefGHIjklMNOpqrsTUVwxyz)
- Go to Google Cloud Console
- Create a new project
- Enable the Google Drive API (APIs & Services → Library → search "Google Drive API")
- Create OAuth credentials:
- Go to APIs & Services → Credentials → Create Credentials → OAuth client ID
- Configure the consent screen if prompted (External, add your email as test user)
- Application type: Desktop app
- Download the credentials JSON file
- Rename it to
client_secret.jsonand place it in the bot folder
- Open Telegram and search for
@userinfobot - Send it any message — it will reply with your user ID
- Rename
.env.exampleto.env - Fill in your values:
TELEGRAM_BOT_TOKEN=your_bot_token_here
GOOGLE_DRIVE_FOLDER_ID=
ALLOWED_USER_IDS=your_telegram_user_id_here
GOOGLE_DRIVE_FOLDER_IDis optional. Leave empty to upload to your Drive root. For multiple users, separate IDs with commas:123456,789012
pip install -r requirements.txt
python bot.pyOr double-click start_bot_generic.bat
On the first run, a browser window will open to sign in with your Google account. This only happens once.
invalid_granterror — Deletetoken.jsonand restart the bot to re-authenticate- "Video not available" for public videos — Make sure Deno is installed and run
yt-dlp --remote-components ejs:github - Bot not responding — Make sure only one instance is running (check Task Manager for extra
python.exe) - SSL certificate errors — Run
pip install --upgrade certifi