Movies Telegram Bot is a simple Telegram bot built using Python that allows users to get information about movies. The bot uses the OMDB API to fetch movie details and also provides the option to translate the movie description to Arabic using the MyMemory translation API.
- Get movie information (title, rating, description).
- Translate movie description to Arabic.
- Send movie posters along with the information.
- Open Telegram and search for the Movies Telegram Bot (username:
@your_bot_username
). - Start a chat with the bot.
- Send the name of the movie you want to get information about.
- If the movie exists, the bot will reply with the movie's details, including title, rating, and description.
- If available, the bot will also send the movie poster.
To run this bot locally or deploy it on your server, follow these steps:
- Clone the repository:
git clone https://github.com/ghaiith/movies-telegram-bot.git
cd movies-telegram-bot
- Install the required Python dependencies:
pip install -r requirements.txt
- Replace
'YOUR_TELEGRAM_BOT_TOKEN'
with your actual Telegram bot token in themain.py
file:
# Replace 'YOUR_TELEGRAM_BOT_TOKEN' with your actual bot token obtained from BotFather on Telegram.
bot = telebot.TeleBot('YOUR_TELEGRAM_BOT_TOKEN')
- Obtain an API key from the OMDB API by registering at https://www.omdbapi.com/ and replace
'YOUR_OMDB_API_KEY'
with your actual API key in themain.py
file:
# Replace 'YOUR_OMDB_API_KEY' with your actual API key obtained from the OMDB API.
api_url = f"http://www.omdbapi.com/?t={user_input}&apikey=YOUR_OMDB_API_KEY"
- Obtain an API key from the MyMemory translation API by registering at https://mymemory.translated.net/doc/usagelimits.php and replace
'YOUR_MYMOMORY_API_KEY'
with your actual API key in themain.py
file:
# Replace 'YOUR_MYMOMORY_API_KEY' with your actual API key obtained from the MyMemory translation API.
api_url = f"https://api.mymemory.translated.net/get?q={description}&langpair=en|ar&key=YOUR_MYMOMORY_API_KEY"
- Run the bot:
python main.py
- The bot should be up and running, ready to respond to messages on Telegram.
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.
- The bot uses the OMDB API (https://www.omdbapi.com/) to fetch movie details.
- The bot uses the MyMemory translation API (https://mymemory.translated.net/doc/usagelimits.php) to translate movie descriptions to Arabic.
This bot is created for educational purposes and should not be used for any commercial or malicious activities. The developers are not responsible for any misuse or damage caused by the bot.