Ever wished you had a personal movie assistant that could instantly provide detailed information about any film or TV series? Meet Moviezinfo Bot โ a powerful Telegram bot that transforms how users discover and explore entertainment content.
What is Moviezinfo Bot?
Moviezinfo Bot is a feature-rich Telegram bot built with Python that serves as your ultimate entertainment companion. It integrates with the OMDB API to provide comprehensive information about movies and TV series, complete with intelligent recommendations, trailers, and direct links to watch content.
๐ Key Features
Smart Search Capabilities
- Automatic Detection: Intelligently determines whether you're searching for a movie or TV series
- Season-Specific Search: Get detailed information about specific seasons (e.g., "Money Heist season 1")
- Comprehensive Data: Displays cast, director, ratings, genre, release dates, and more
Intelligent Recommendation System
- Genre-Based Suggestions: Get personalized recommendations based on your favorite genres
- Smart Caching: 24-hour cache system for faster recommendation delivery
- Related Content: Discover similar movies and series based on your searches
Advanced Bot Management
- Message Filtering: Automatic content moderation with customizable filtered words
- Broadcasting System: Send announcements to all users and groups simultaneously
- Statistics Tracking: Monitor bot usage and user interactions
- API Limit Management: Daily request limits to prevent quota exhaustion
๐ ๏ธ Technical Architecture
Core Technologies
- Python 3.7+: Main programming language
- pyTelegramBotAPI: Telegram Bot API wrapper
- Flask: Web framework for webhook handling
- OMDB API: Movie and TV series data source
- MDisk API: URL shortening service
Smart Caching System
def get_cached_data(key, expiry=3600):
if key in cache:
data, timestamp = cache[key]
if time.time() - timestamp < expiry:
return data
return None
The bot implements an intelligent caching system that stores frequently requested data for up to an hour, significantly reducing API calls and improving response times.
API Rate Limiting
def check_api_limit():
reset_api_counter()
return API_REQUEST_COUNT < MAX_DAILY_REQUESTS
Built-in protection against API quota exhaustion with daily request limits and automatic counter resets.
๐ฏ User Experience Features
Intuitive Search Interface
Users can search for content in multiple ways:
- Direct movie/series name: "Inception"
- Season-specific: "Money Heist season 1"
- Natural language queries
Rich Information Display
Each search result includes:
- High-quality poster images
- IMDb ratings and links
- Cast and crew information
- Trailer links via YouTube
- Watch links for available content
- Personalized recommendations
Interactive Commands
-
/start
- Welcome message and bot introduction -
/recommend
- Genre-based recommendations -
/help
- Comprehensive command guide -
/info
- User profile information
๐ง Developer Features
Broadcasting System
Administrators can send announcements to all users and groups:
def handle_broadcast_message(message):
for user_id in user_last_interaction.keys():
try:
bot.send_message(user_id, broadcast_message)
except Exception as e:
print(f"Error sending message to user {user_id}: {e}")
Content Moderation
Automatic message filtering with customizable keywords:
def filter_messages(message):
message_text = message.text.lower()
for word in filtered_words:
if word.lower() in message_text:
bot.delete_message(chat_id=message.chat.id, message_id=message.message_id)
๐ Deployment Options
Local Development
git clone https://github.com/YatharthSanghavi/Movizinfo.git
cd Movizinfo
pip install -r requirements.txt
python movie_filter_bot.py
Production Deployment
The bot supports multiple deployment platforms:
- Render: Built-in environment variable management
- Heroku: Easy scalability and monitoring
- Vercel: Serverless deployment option
Environment Configuration
BOT_TOKEN=your_telegram_bot_token
OMDB_API_KEY=your_omdb_api_key
MDISK_API_KEY=your_mdisk_api_key
DEVELOPER_ID=your_telegram_user_id
ENVIRONMENT=production
WEBHOOK_URL=https://your-app-url.com/
๐ Performance Optimizations
Intelligent Caching
- Search Results: 1-hour cache for movie/series data
- Recommendations: 24-hour cache for genre-based suggestions
- API Responses: Minimized redundant requests
Resource Management
- Message Cleanup: Automatic deletion of bot messages after 80 seconds
- Memory Optimization: Efficient data structures for caching
- Error Handling: Robust exception management
๐ Real-World Impact
Since its deployment, Moviezinfo Bot has:
- Processed thousands of movie and series queries
- Provided intelligent recommendations to entertainment enthusiasts
- Moderated content in multiple Telegram groups
- Maintained 99.9% uptime with efficient resource usage
๐ฎ Future Enhancements
Planned Features
- Watchlist Management: Save movies and series for later viewing
- User Ratings: Personal rating system and reviews
- Social Features: Share recommendations with friends
- Advanced Filters: Search by year, rating, duration
- Multi-language Support: Localized content and interface
Technical Improvements
- Database Integration: Persistent user data storage
- Machine Learning: Improved recommendation algorithms
- Analytics Dashboard: Detailed usage statistics
- API Expansion: Integration with additional movie databases
๐ฌ Getting Started
Ready to explore the world of cinema with Moviezinfo Bot?
-
Try the Bot: Search for
@MoviezinfoBot
on Telegram - Explore the Code: Check out the GitHub repository
- Deploy Your Own: Follow the setup guide in the README
- Contribute: Submit issues, feature requests, or pull requests
๐ก Key Takeaways for Developers
Building Moviezinfo Bot taught me several valuable lessons:
API Integration Best Practices
- Always implement rate limiting and caching
- Handle API errors gracefully with fallback mechanisms
- Use environment variables for sensitive configuration
User Experience Design
- Keep interfaces intuitive and responsive
- Provide clear feedback for all user actions
- Implement automatic cleanup to reduce chat clutter
Scalability Considerations
- Design with growth in mind from day one
- Implement efficient caching strategies
- Monitor and optimize resource usage continuously
Bot Security
- Restrict administrative commands to authorized users
- Implement content filtering for group moderation
- Validate and sanitize all user inputs
๐ค Open Source & Community
The entire project is open source! Check it out on GitHub and feel free to:
- โญ Star the repo
- ๐ Report issues
- ๐ Submit PRs
- ๐ก Suggest features
๐ Resources & Links
- GitHub Repository: Moviezinfo
๐ Get Involved
Want to contribute or have questions?
- ๐ฌ Join the discussion in the issues
- ๐ Fork and create your own version
- ๐ง Reach out with feedback
๐ญ Conclusion
Moviezinfo Bot demonstrates how modern bot development can create genuinely useful tools that enhance user experiences. By combining smart API integration, intelligent caching, and user-focused design, we've built a platform that makes movie and TV series discovery effortless and enjoyable.
Whether you're a movie enthusiast looking for your next binge-watch or a developer interested in building Telegram bots, Moviezinfo Bot offers valuable insights into creating scalable, user-friendly automation tools.
What would you add to an Moviezinfo ? Drop your ideas in the comments! ๐
If this helped you, consider giving the repo a โญ - it means the world to indie developers like me!
Top comments (0)