AI Movie Recommender is a Python application that leverages your Plex watch history and OpenAI's GPT model to generate personalized movie recommendations. It retrieves your recent watch history from Plex, uses an AI to analyze your preferences, and sends you an email with 10 tailored movie recommendations, complete with brief, spoiler-free summaries.
- ๐บ Fetches your recent Plex watch history
- ๐ค Utilizes OpenAI's GPT model for intelligent movie recommendations
- ๐ Incorporates web search capabilities for up-to-date information
- ๐ง Sends recommendations via email in a beautifully formatted HTML format
- ๐ Secure handling of API keys and sensitive information
- Clone the repository
- Install the required dependencies pip install -r requirements.txt
- Set up your environment variables by creating a
.env
file in the project root:
OPENAI_API_KEY=your_openai_api_key
GOOGLE_API_KEY=your_google_api_key
GOOGLE_SEARCH_ENGINE_ID=your_google_search_engine_id
SMTP_HOST=your_smtp_host
[email protected]
SMTP_FROM_NAME="AI Movie Recommendations"
SMTP_PORT=465
[email protected]
SMTP_PASSWORD=your_email_password
SMTP_SECURITY=ssl
SMTP_AUTH_MECHANISM=Plain
PLEX_AUTH_TOKEN=your_plex_auth_token
PLEX_USER_ID=your_plex_user_id
Run the main script:
python main.py
The application will:
- Fetch your recent Plex watch history
- Generate movie recommendations based on your history
- Send an email with the recommendations
main.py
: The entry point of the applicationplex_history.py
: Handles fetching the Plex watch historyai_assistant.py
: Manages the AI assistant for generating recommendationsemail_sender.py
: Handles formatting and sending the emailutils.py
: Contains utility functions for logging and environment variable management
Contributions, issues, and feature requests are welcome!