How it works
The bot automatically detects Instagram URLs in your messages and downloads the content without requiring any special commands.This feature is automatic - no command needed! Just send an Instagram link.
Supported formats
The bot can download from these Instagram URL formats:- Reels:
https://www.instagram.com/reel/[id]orhttps://www.instagram.com/reels/[id] - Posts:
https://www.instagram.com/p/[id]
Usage
Implementation details
FrommessageHandler.ts:32-61, the bot uses a regex pattern to detect Instagram links:
InstagramService uses yt-dlp to download videos in the best available quality (preferring MP4 format).
Requirements
FromInstagramService.ts:10-31:
Error handling
If the download fails, you’ll receive an error message:- The post is from a private account
- The URL is invalid or expired
- The content has been deleted
- Network connectivity issues
yt-dlpis not properly installed
Privacy considerations
Downloaded videos are temporarily stored during processing and automatically deleted after being sent to you. The bot does not permanently store Instagram content.
messageHandler.ts:52-55:
Advanced configuration
Cookie authentication
For accessing content from accounts you follow (useful for private accounts), you can provide Instagram cookies:- Create a
cookie.txtfile in the project root - Export your Instagram cookies using a browser extension
- Place the cookies in the file
InstagramService.ts:21-36:
Troubleshooting
Video download is very slow
Video download is very slow
Instagram throttles download speeds. Large videos may take 30-60 seconds to process. The bot will send a processing message while it works.
Getting 'Failed to process' error
Getting 'Failed to process' error
- Check that
yt-dlpis installed inbin/yt-dlp - Verify the Instagram URL is valid and public
- Try updating
yt-dlpto the latest version
Private account content not downloading
Private account content not downloading
You need to provide Instagram cookies in
cookie.txt to download content from accounts you follow. See the Advanced Configuration section above.Related features
- !sticker - Convert downloaded videos to WhatsApp stickers
- Spotify Controls - Another integration feature