Built using the wonderful python-telegram-bot library and the TMDB and Streaming Availability APIs. It's not a very talkative bot, but it does one task and it does it well.
- Streaming Availability API token
- TMDB API token
- Telegram Bot Token
- Computer/VPS with an internet connection. No open ports required :)
Regardless of how you run it, the program expects the above API tokens to be available as the below environment variables:
- SA_API_TOKEN
- TMDB_API_TOKEN
- TG_BOT_TOKEN
Optional environment variables:
- TG_BOT_USER (default empty) - Limit bot interaction to a single user.
- STREAMING_COUNTRY (default "us") - Choose any ISO 3166 country code supported by the Sreaming Availability API
- TG_DEBUG (default False) - Enable debug logging. WARNING: Will slow down your bot, use only for testing.
One-liner:
docker run \
--env TMDB_API_TOKEN=$TMDB_API_TOKEN
--env SA_API_TOKEN=$SA_API_TOKEN
--env TG_BOT_TOKEN=$TG_BOT_TOKEN
skoobasteeve/telegram-moviebot:main
docker-compose:
---
version: 3
services:
telegram-moviebot:
container_name: telegram-moviebot
image: skoobasteeve/telegram-moviebot:main
environment:
- TMDB_API_TOKEN=${TMDB_API_TOKEN} # Required
- SA_API_TOKEN=${SA_API_TOKEN} # Required
- TG_BOT_TOKEN=${TG_BOT_TOKEN} # Required
- STREAMING_COUNTRY= # (optional) Default "us"
- TG_BOT_USER= # (optional) Limits access to the bot to a single Telegram user
- TG_DEBUG= # (optional, True/False) Verbose debug logging. Default False.
restart: always
docker-compose up -d
Clone the repo
git clone https://github.com/skoobasteeve/telegram-moviebot.git
Install the dependencies
cd telegram-moviebot
pip install -r requirements.txt
Run the bot
python /telegram-moviebot/telegram-moviebot.py
2022-04-23 16:08:37,698 - apscheduler.scheduler - INFO - Scheduler started
2022-04-23 20:20:15,858 - __main__ - INFO - Looking up movie: "Star Wars"
2022-04-23 20:20:16,198 - __main__ - INFO - Result was a 100% match.
2022-04-23 20:20:16,203 - __main__ - INFO - Returning movie: "Star Wars: (1977)"
Once your bot is set up, simply open a new conversation with the bot and type /start.
Next, type the name of the movie you're looking for.
Most of the time, you'll find your movie on the first try. However, you can further narrow your search by specifying the -year
flag followed the the release year.
Feel free to submit an issue or pull request any time!