Skip to content

A powerful Python-based Instagram/Youtube downloader & Telegram bot that runs in the background, supports premium links, and download reels, multi-posts, profile scraping, and more.

License

Notifications You must be signed in to change notification settings

samay825/Reels-Shorts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

27 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– Instagram-Youtube Telegram Bot

Python Telegram Bot API License Status

A powerful Telegram bot that allows users to download content from Instagram and YouTube platforms with ease.

This bot provides a user-friendly interface with inline keyboards and supports various content types including reels, posts, stories, profile photos, and YouTube videos/audio.


โœจ Features

๐Ÿ“ท Instagram Downloader

  • ๐ŸŽž๏ธ Reels: Download Instagram reels in high quality
  • ๐Ÿ“ธ Posts: Download Instagram posts (single/multiple images)
  • ๐Ÿ“– Stories: Download Instagram stories
  • ๐Ÿ‘ค Profile Photos: Download profile pictures in full resolution
  • ๐Ÿ“Š Analytics: Get detailed profile analytics and download statistics

๐ŸŽฅ YouTube Downloader

  • ๐Ÿ”— Video Links: Generate download links for YouTube videos
  • ๐Ÿ“น Video Files: Download YouTube videos and shorts directly (up to 50MB)
  • ๐ŸŽต Audio Only: Extract and download audio from YouTube videos
  • ๐Ÿ“Š Analytics: Track download statistics

๐Ÿ”ง Additional Features

  • ๐Ÿ“Š Real-time Statistics: Track usage and download counts
  • ๐Ÿ”— URL Shortening: Automatic URL shortening and masking
  • โšก Background Mode: Run bot 24/7 in background
  • ๐Ÿ›ก๏ธ Error Handling: Robust error handling and user feedback
  • ๐Ÿ“ฑ Responsive UI: Clean inline keyboard interface

๐Ÿš€ Installation

Prerequisites

  • Python 3.13.3 or higher
  • Windows OS (for batch file management)
  • Telegram Bot Token (from @BotFather)

Quick Setup

  1. Clone or Download the project to your local machine

  2. Navigate to the project directory:

  3. Run the Bot Manager:

    Reels-Shorts.bat
  4. Configure Bot Token:

    • Select option [4] Configure Bot Token
    • Enter your Telegram Bot Token from @BotFather
    • The token will be automatically saved to telegram_config.json
  5. Start the Bot:

    • Select option [1] Start Bot 24/7 (Background Mode)
    • The bot will automatically install dependencies and start running

Manual Installation

If you prefer manual setup:

  1. Install Python Dependencies:

    pip install -r requirements.txt
  2. Configure Bot Token: Create telegram_config.json with your bot token:

    {"token": "YOUR_BOT_TOKEN_HERE"}
  3. Run the Bot:

    double click on bat file 

๐Ÿ“‹ Dependencies

The bot uses the following Python packages:

pyTelegramBotAPI==4.15.4    # Telegram Bot API
requests==2.31.0            # HTTP requests
pytube==15.0.0              # YouTube downloader
instaloader==4.10.2         # Instagram content loader
instagrapi>=2.1.0           # Instagram API
yt-dlp>=2023.12.30          # YouTube/media downloader
httpx>=0.25.0               # Async HTTP client
pyshorteners>=1.0.1         # URL shortening

๐ŸŽฎ Usage

Getting Started

  1. Start a conversation with your bot on Telegram
  2. Send /start to see the main menu

Supported Link Formats

Instagram:

  • https://www.instagram.com/p/xxx/ (Posts)
  • https://www.instagram.com/reel/xxx/ (Reels)
  • https://www.instagram.com/stories/username/xxx/ (Stories)
  • @username or https://www.instagram.com/username/ (Profile)

YouTube:

  • https://youtube.com/watch?v=xxx
  • https://youtu.be/xxx
  • https://m.youtube.com/watch?v=xxx

๐Ÿ› ๏ธ Bot Management

The project includes a comprehensive bot management system:

Bot Manager (Reels-Shorts.bat)

  • Start Bot: Launch bot in background mode
  • Stop Bot: Safely stop the running bot
  • Check Status: View current bot status
  • Configure Token: Set up or update bot token
  • Exit: Close the manager

Background Scripts

  • start_bot_background.bat: Start bot in background mode
  • stop_bot.bat: Stop the running bot
  • check_bot.bat: Check if bot is running

๐Ÿ“ Project Structure

๐Ÿ“ฆ Instagram Telegram Bot
โ”œโ”€โ”€ ๐Ÿ“„ main.py                          # Main bot application
โ”œโ”€โ”€ ๐Ÿ“„ requirements.txt                 # Python dependencies
โ”œโ”€โ”€ ๐Ÿ“„ telegram_config.json             # Bot token configuration
โ”œโ”€โ”€ ๐Ÿ“„ bot_manager.bat                  # Bot management interface
โ”œโ”€โ”€ ๐Ÿ“‚ bot_scripts/                     # Bot management scripts
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ start_bot_background.bat
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ stop_bot.bat
โ”‚   โ””โ”€โ”€ ๐Ÿ“„ check_bot.bat
โ”œโ”€โ”€ ๐Ÿ“‚ configuration/                   # Bot modules
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ __init__.py                  # Configuration loader
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ stats.py                     # Statistics management
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ instagram_reel.py            # Instagram reels handler
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ instagram_post.py            # Instagram posts handler
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ instagram_stories.py         # Instagram stories handler
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ instagram_profile_photo.py   # Profile photo handler
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ instagram_profile_analytics.py # Profile analytics
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ instagram_caption.py         # Caption extraction
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ youtube_video.py             # YouTube video handler
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ youtube_music.py             # YouTube audio handler
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ session_id.json              # Session management
โ”‚   โ””โ”€โ”€ ๐Ÿ“„ stats.json                   # Usage statistics
โ””โ”€โ”€ ๐Ÿ“„ README.md                        # This file

โš™๏ธ Configuration

Environment Setup

The bot automatically handles most configuration, but you can customize:

  1. API Settings: Edit configuration/__init__.py for API endpoints
  2. Download Paths: Modify download directories in respective modules
  3. Rate Limits: Adjust request delays in configuration files
  4. Statistics: Configure tracking in configuration/stats.py

Session Management

  • Instagram sessions are managed automatically
  • Session data is stored in configuration/session_id.json
  • Sessions are refreshed as needed to maintain functionality

๐Ÿ”ง Troubleshooting

Common Issues

Bot Token Error:

  • Ensure your token is correctly configured in telegram_config.json
  • Verify the token is active and valid from @BotFather

Download Failures:

  • Check if the content is public and accessible
  • Verify the URL format is correct
  • Some private content may not be downloadable

Python Not Found:

  • Ensure Python 3.13.3+ is installed and added to PATH
  • Try running python --version in command prompt

Dependencies Issues:

  • Run pip install -r requirements.txt manually
  • Check for any error messages during installation

Performance Tips

  • Run bot in background mode for 24/7 operation
  • Monitor system resources for heavy usage
  • Regular restart recommended for optimal performance

๐Ÿ›ก๏ธ Security & Privacy

  • Bot tokens are stored locally and encrypted
  • No user data is permanently stored
  • Download links are automatically shortened and masked
  • Session data is managed securely

๐Ÿ“ License

This project is for educational purposes. Please respect platform terms of service and copyright laws when using this bot.

๐Ÿ“ž Support

For issues or questions:

  • Check the troubleshooting section
  • Review error messages carefully
  • Ensure all dependencies are properly installed
  • Verify bot token configuration

โšก Quick Start: Run bot_manager.bat โ†’ Configure Token โ†’ Start Bot โ†’ Enjoy! ๐ŸŽ‰

Releases

No releases published

Packages

No packages published