Telegram bot that automates media library organization using mnamer.
1.0K
A Telegram bot to automate the organization of your media library using the powerful mnamer tool.

Warning
**Disclaimer:** This tool handles file movements and renaming. I am **not responsible for any data loss** or files being moved to incorrect locations. It is highly recommended to perform a test with dummy files or a backup before running it on your primary library.
Important
**Configuration Complexity:** Setting up Docker volumes and environment variables correctly can be complex depending on your OS and permissions. If you encounter any issues or have questions, please **open an issue** in this repository.
mnamer to rename and move files to your library (Movies/TV Shows).tmdb <id> or tvdb <id> if the detection is wrong.
The recommended way to run this bot is via Docker Compose.
To get your TELEGRAM_API_ID and TELEGRAM_API_HASH:
App api_id and App api_hash values.For more details, see the official guide.
.env file in the root directory (you can copy .env.example as a starting point):| Variable | Description | Default value |
|---|---|---|
| TELEGRAM_API_ID | Telegram API ID | n/a |
| TELEGRAM_API_HASH | Telegram API Hash | n/a |
| TELEGRAM_BOT_TOKEN | Bot token | n/a |
| TELEGRAM_AUTH_USER_ID | Authorized user ID | n/a |
| WATCH_DIR | Watch folder for scanning | /data/watch (in code) |
| MOVIES_DIR | Movies output folder | /data/movies (in code) |
| SHOWS_DIR | Shows output folder | /data/shows (in code) |
| MOVIE_FORMAT | Movie filename format string for mnamer | {name} ({year}){extension} |
| EPISODES_FORMAT | Episode filename format string for mnamer | {series} S{season:02}E{episode:02}{extension} |
| MOVIE_DIRECTORY | Movie output directory template | ${dirHandler.MoviesDirectory}/{name} ({year}) [tmdbid-{id_tmdb}] |
| EPISODE_DIRECTORY | Episode output directory template | ${dirHandler.ShowsDirectory}/{series} [tvdbid-{id_tvdb}]/Season {season:02} |
| LANGUAGE | mnamer/movie language code | en |
Review docker-compose.yml (an example file is included in the repository):
Performance Tip: Map a single volume (e.g.,
/mnt/data:/media) containing both your downloads and library folders. This allows the bot to move files atomically (without copying) when directories are on the same volume.
services:
bot-mnamer:
image: christt105/mnamer-telegram:latest
restart: unless-stopped
env_file: .env
volumes:
- ./appdata:/data # Database location
- /mnt/data:/media # Single volume for all media
In this example, your host /mnt/data should contain downloads, movies, and shows folders.
Start the bot container:
docker compose up -d
View logs:
docker compose logs -f
The real-time folder monitoring (FileSystemWatcher) is primarily designed and tested for Linux hosts.
If you are running Docker on Windows or macOS, host file events may not propagate correctly into the container. Use the /search command to scan manually, or check this link for more information:
mnamer-telegram uses mnamer format strings for MOVIE_FORMAT, EPISODES_FORMAT, MOVIE_DIRECTORY, and EPISODE_DIRECTORY. You can customize these values in your .env file.
For format details and examples, see:
/downloads (mapped path). When a video file is detected, it will message you on Telegram./search to the bot to scan the watch folder for existing files.tmdb <id> or tvdb <id> to force a match.Refactors, features, and pull requests are welcome!
If you find this bot useful, please consider starring the repository! ⭐
This project heavily relies on and gratefully acknowledges:
Content type
Image
Digest
sha256:704d55e9e…
Size
270.5 MB
Last updated
4 months ago
docker pull christt105/mnamer-telegram