The ultimate automated movie publishing bot for Telegram.
CineGram is an autonomous assistant that processes video files, identifies the movie (even with typos), fetches official metadata, translates synopses, and generates professional posters.
The bot features a local "Brain" (Ollama) that activates when standard search fails.
- Spam Detector: Cleans filenames like "Movie.Full.Latino.HD.2024.mp4" to find "The Matrix".
- Typo Fixer: Understands inputs like "Abengers Enfgame" and searches for "Avengers: Endgame".
- Safety Net (Fallback): If the filename fails, it reads the video "Caption" to infer the movie context.
No more cropped heads.
- Blurred Background: Uses a pro design technique where the full poster fits in the center, and the background is filled with a blurred, darkened version of the same image.
- Cinema Format: Generates 1920x1080 images ready for high-quality channels.
Keeps your chat and channel clean.
- Auto-Deletion: Automatically deletes your uploaded video file from the private chat after successful publishing.
- Ephemeral Messages: Status updates ("Searching...", "Generating poster...") self-destruct to avoid clutter.
- Memory: The bot now uses a SQLite database (
cinegram.db) to remember every movie published. No more duplicates! - Admin Stats: Track your channel growth with real-time reports.
- Auto-Migration: Automatically imports your legacy JSON history on first run.
- Clone the repository.
- Create
.envfile (see.env.example). - Install
requirements.txt.- New dependency:
telethonfor history scanning.
- New dependency:
- Install Ollama and pull a lightweight model (e.g.,
llama3ormistral).
- Send a video to the bot in private.
- (Optional) Add a caption if the filename is garbage.
- The bot handles the rest: search, poster gen, and publishing.
/stats- View total movies published and authorized users./today- List all movies uploaded in the last 24 hours./search [Name]- Manually search for a movie.- Manual Correction: If the bot says "Not found", simply reply to that error message with the correct name (e.g., "Matrix 1999") to retry.
If you have an existing channel with thousands of movies, you can sync them to the bot's database so it remembers them:
- Obtain
API_IDandAPI_HASHfrom my.telegram.org. - Add them to your
.envalong with yourTELEGRAM_PHONE. - Run the scanner script:
python scripts/scan_channel.py
- Enter the code (and password if requested) sent to your Telegram.
- Watch as the bot populates its database with your entire history!
cinegram/handlers/: Logics (Video processing, /stats, /search).cinegram/services/: Core logic (TMDB, AI, DB, Poster Generator).scripts/: Maintenance tools (History scanner, Migrations).
Creado con ❤️ para automatizar lo aburrido.