π± InstaSave
A powerful Telegram bot that allows users to anonymously view Instagram Stories without logging into Instagram. Built with Python, aiogram, and Selenium for reliable story fetching and delivery.
- π Anonymous Story Viewing - View Instagram stories without logging in
- π€ Telegram Integration - Easy-to-use Telegram bot interface
- β‘ Automated Checking - Set up automatic story checking with custom intervals
- πΌοΈ Media Support - Handles both images and videos
- π€ Profile Information - Shows user profile details and statistics
- π Privacy Aware - Respects private account limitations
- π User Settings - Persistent user preferences and configurations
- π‘οΈ Error Handling - Robust error handling and recovery mechanisms
- Python 3.8 or higher
- Google Chrome browser installed
- Telegram Bot Token (from @BotFather)
-
Clone the repository
git clone https://github.com/kyemets/insta-save-telegram-bot.git cd instagram-story-bot
-
Install dependencies
pip install -r requirements.txt
-
Configure your bot token Create a file named
tg_token.py
:TOKEN = "YOUR_TELEGRAM_BOT_TOKEN_HERE"
-
Run the bot
python main.py
Create a requirements.txt
file with these dependencies:
aiogram==2.25.1
aiohttp==3.8.5
selenium==4.15.0
webdriver-manager==4.0.1
You can also use environment variables instead of tg_token.py
:
export TELEGRAM_BOT_TOKEN="your_bot_token_here"
The bot automatically creates a user_settings.json
file to store user preferences:
{
"user_id": {
"auto_enabled": false,
"interval": 3,
"last_check": "2024-01-01T00:00:00",
"target_username": "example_user"
}
}
Command | Description |
---|---|
/start |
Welcome message and bot introduction |
/story |
Request stories for a username |
/help |
Show all available commands |
/auto_on |
Enable automatic story checking |
/auto_off |
Disable automatic story checking |
/status |
Check your current settings |
- Start the bot: Send
/start
to get started - View stories: Simply send an Instagram username (without @)
- Set auto-check: Use
/auto_on
and select your preferred interval - Get help: Use
/help
for detailed command information
User: /start
Bot: π Welcome to Instagram Stories Bot!
π Send me an Instagram username to view their stories anonymously.
User: johndoe
Bot: π Looking up @johndoe...
π Launching browser...
β Fetching story data...
π± [Profile information with photo]
π² Found 3 stories. Sending...
π [Story 1/3 - Image]
π [Story 2/3 - Video]
π [Story 3/3 - Image]
The bot is built with a modular architecture:
βββ main.py # Main bot class and entry point
βββ tg_token.py # Bot token configuration
βββ user_settings.json # User preferences storage
βββ bot.log # Application logs
βββ requirements.txt # Python dependencies
StoryBot
- Main bot orchestratorSettingsManager
- Handles user settings persistenceBrowserManager
- Manages Selenium browser operationsAPIClient
- Handles API communication with retry logicAuthTokenManager
- Generates authentication tokensURLDecoder
- Decodes embedded media URLs
The codebase follows professional Python development practices:
- Type Hints - Full type annotation coverage
- Data Classes - Clean data structures with
@dataclass
- Async/Await - Proper asynchronous programming
- Error Handling - Comprehensive exception handling
- Logging - Structured logging with file and console output
- Resource Management - Proper cleanup with context managers
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Add tests (if applicable)
- Commit your changes
git commit -m 'Add some amazing feature'
- Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request
# Enable debug logging
export LOG_LEVEL=DEBUG
python main.py
FROM python:3.9-slim
# Install Chrome
RUN apt-get update && apt-get install -y \
wget \
gnupg \
unzip \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update \
&& apt-get install -y google-chrome-stable \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "main.py"]
version: '3.8'
services:
instagram-bot:
build: .
environment:
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
volumes:
- ./user_settings.json:/app/user_settings.json
- ./logs:/app/logs
restart: unless-stopped
The bot includes comprehensive logging:
- File Logging - All events logged to
bot.log
- Console Output - Real-time status updates
- Error Tracking - Detailed error information
- Performance Metrics - API response times and success rates
- INFO - General operations and status updates
- WARNING - Non-critical issues
- ERROR - Error conditions that need attention
- DEBUG - Detailed debugging information
- Private Accounts - Cannot access stories from private Instagram accounts
- Rate Limits - Subject to Instagram's rate limiting policies
- Selenium Dependency - Requires Chrome browser for web automation
- No Authentication - Does not require Instagram login (by design)
This bot is designed for legitimate use cases:
- β Viewing public content anonymously
- β Educational and research purposes
- β Personal use within Instagram's terms
Please use responsibly and respect users' privacy.
Chrome Driver Issues
# Update Chrome driver
pip install --upgrade webdriver-manager
API Timeout Errors
- Check your internet connection
- Verify the username exists and is public
- Try again after a few minutes
Bot Not Responding
- Check your bot token in
tg_token.py
- Verify the bot is running without errors
- Check the logs in
bot.log
Enable debug logging for detailed troubleshooting:
import logging
logging.basicConfig(level=logging.DEBUG)
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Follow the existing code style
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass
If you encounter any issues or have questions:
- Check the logs - Look at
bot.log
for error details - Review documentation - Check this README and code comments
- Open an issue - Create a GitHub issue with details
- Join discussions - Participate in GitHub Discussions
- aiogram - Async Telegram Bot API framework
- Selenium - Web automation framework
- aiohttp - Async HTTP client/server
- webdriver-manager - Automatic WebDriver management
- Web dashboard for bot management
- Scheduled story downloads
- Multi-user story comparison
- Story analytics and insights
- Integration with other social platforms
- Advanced filtering and search options
β If you find this project helpful, please consider giving it a star on GitHub!