A Telegram bot that downloads media from Instagram, YouTube, TikTok, and Facebook and sends it back to you.
Features
- Instagram — reels, posts (images, videos, carousels)
- YouTube — videos and Shorts
- TikTok — videos
- Facebook — videos
- Oversized videos (>50 MB) are automatically compressed with ffmpeg before sending
- Non-MP4 videos (WebM, MKV, MOV, AVI) are converted to MP4 for inline playback
- Typing indicator while downloading/processing
Requirements
brew install yt-dlp gallery-dl ffmpeg
Configuration
# config.yml
telegram:
token: YOUR_TELEGRAM_BOT_TOKEN
instagram:
cookies: BASE64_ENCODED_COOKIES_JSON # required
youtube:
cookies: BASE64_ENCODED_COOKIES_JSON # optional
facebook:
cookies: BASE64_ENCODED_COOKIES_JSON # optional
proxy: "http://user:pass@host:port" # optional
Cookies
Instagram requires authentication. YouTube and Facebook cookies are optional but may be needed for age-restricted or
private content.
Export your browser cookies as JSON using an extension
like EditThisCookie,
then base64-encode the JSON array:
cat cookies.json | base64
Running
go run main.go
Usage
Send an Instagram, YouTube, TikTok, or Facebook URL to the bot — it replies with the media files.
License
MIT