Your Ultimate Entertainment Companion - A comprehensive web application for discovering, tracking, and getting personalized recommendations for movies, web series, music, and books.
- Smart Recommendations: Hybrid recommendation system combining local machine learning models with Google Gemini AI
- Multi-Media Support: Movies, Web Series, Music, and Books
- User Authentication: Secure Firebase authentication with email/password
- Personal Favorites: Save and manage your favorite media across all categories
- Watchlist: Add items to your watchlist for later viewing
- Chatbot Assistant: AI-powered chatbot to help you navigate and find content
The recommendation system uses a hybrid approach:
-
Local ML Models: Content-based filtering using similarity matrices
- 4,806 movies
- 12,109 web series
- 5,000 songs
- 243 books
-
AI Fallback: Google Gemini AI provides recommendations when items aren't in the local database
-
Intelligent Processing:
- Processes each favorite individually
- Requests 5 recommendations per favorite
- Filters out duplicates and favorites from results
- Returns 9 unique recommendations per category
- OMDB API: Movie and TV show details
- Spotify API: Music tracks and albums
- Google Books API: Book information
- Google Gemini AI: AI-powered recommendations
- Firebase: Authentication and database
- Firebase account (for backend)
- API Keys (see Configuration section)- Clone the repository
git clone https://github.com/watcher2105/Media_Mate.git
cd Media_Mate- Configure API Keys
Edit config.js and add your API keys:
const API_CONFIG = {
OMDB_API_KEY: 'your_omdb_key',
SPOTIFY_CLIENT_ID: 'your_spotify_client_id',
SPOTIFY_CLIENT_SECRET: 'your_spotify_client_secret',
GEMINI_API_KEY: 'your_gemini_api_key',
FIREBASE_CONFIG: {
apiKey: 'your_firebase_api_key',
authDomain: 'your_app.firebaseapp.com',
databaseURL: 'https://your_app.firebaseio.com',
projectId: 'your_project_id',
storageBucket: 'your_app.appspot.com',
messagingSenderId: 'your_sender_id',
appId: 'your_app_id'
}
};- Get API Keys
- OMDB: https://www.omdbapi.com/apikey.aspx
- Spotify: https://developer.spotify.com/dashboard
- Google Gemini: https://aistudio.google.com/
- Firebase: https://console.firebase.google.com/
- Run the application
# Using Python's built-in server
python -m http.server 8000
# Or using Node.js http-server
npx http-server -p 8000
# Or using Five Server (VS Code extension)
# Right-click on index.html -> "Open with Five Server"Media_Mate/
βββ index.html # Landing page
βββ login.html # Login page
βββ signup.html # Registration page
βββ main.html # Main application dashboard
βββ profile.html # User profile management
βββ favourite.html # Favorites selection
βββ recommendations-movies.html # Movie recommendations
βββ recommendations-series.html # Web series recommendations
βββ recommendations-music.html # Music recommendations
βββ recommendations-books.html # Book recommendations
βββ chatbot.html # AI chatbot interface
βββ about.html # About page
βββ config.js # API configuration
βββ recomandation system/
β βββ Movie Recommedation/
β β βββ movies.json # Movie dataset (4,806 movies)
β β βββ similarity.json # Similarity matrix
β β βββ movie-recommender.js # Movie recommendation engine
β βββ Webseries Recommendation/
β β βββ shows.json # Web series dataset (12,109 shows)
β β βββ shows_similarity.json # Similarity matrix
β β βββ webseries-recommender.js
β βββ Music Recomendation/
β β βββ data.json # Music dataset (5,000 songs)
β β βββ similarity.json # Similarity matrix
β β βββ music-recommender.js
β βββ Book Recomendation/
β βββ books.json # Books dataset (243 books)
β βββ similarity.json # Similarity matrix
β βββ book-recommender.js
βββ Jupyter Files Recomendation system/
β βββ Movie Recommedation/
β β βββ Recomandation system content based.ipynb
β βββ Webseries Recommendation/
β β βββ Recomandation system content based.ipynb
β βββ Music Recomendation/
β β βββ Recomandation system content based.ipynb
β βββ Book Recomendation/
β βββ Recomandation system content based.ipynb
βββ README.md # This file
βββ LICENSE # MIT License
βββ RECOMMENDATION_INTEGRATION.md # Integration guide
- HTML5/CSS3: Modern, responsive UI
- JavaScript (ES6+): Core application logic
- Anime.js: Smooth animations
- Font Awesome: Icon library
- Firebase Authentication: User management
- Firebase Realtime Database: Data storage
- REST APIs: External data fetching
- Content-Based Filtering: Similarity matrices
- Cosine Similarity: Recommendation scoring
- Hybrid AI System: ML + Gemini AI
- Python/Jupyter: Data processing and model training
- Scikit-learn: Machine learning library for similarity computation
- Create a Firebase project at https://console.firebase.google.com/
- Enable Authentication (Email/Password)
- Enable Realtime Database
- Update security rules:
{
"rules": {
"users": {
"$uid": {
".read": "$uid === auth.uid",
".write": "$uid === auth.uid"
}
}
}
}- OMDB: 1,000 requests/day (free tier)
- Spotify: 10,000 requests/day
- Google Books: 1,000 requests/day
- Gemini AI: Varies by tier
User selects favorites
β
For each favorite:
β
Try local ML model
β
Found in database? ββYesβββ Get 5 similar items
β No
Use Gemini AI βββ Get AI recommendations
β
Combine all recommendations
β
Remove duplicates & favorites
β
Fetch details from APIs (OMDB/Spotify/Books)
β
Display 9 unique recommendations
1. Process each favorite individually
2. Request 5 recommendations per favorite
3. Filter out items that match user's favorites
4. Fetch full details from external APIs
5. Remove duplicates by title (case-insensitive)
6. Limit to 9 final recommendations
7. Display with fallback placeholders for missing imagesThe Jupyter Files Recomendation system/ folder contains Python notebooks that:
- Load and preprocess media datasets
- Calculate similarity matrices using cosine similarity
- Generate
.pkl(pickle) files for models - Convert models to JSON format for web use
To increase the dataset and regenerate recommendation models:
pip install pandas numpy scikit-learn jupyter1. Prepare Your Data
For Movies: Create a CSV with columns: id, original_title, overview, genre, keywords, cast, crew
For Web Series: CSV with: id, title, overview, genre, cast, network
For Music: CSV with: artist, song, text (lyrics)
For Books: CSV with: title, author, genre, description
2. Run Jupyter Notebooks
# Navigate to the appropriate folder
cd "Jupyter Files Recomendation system/Movie Recommedation"
# Launch Jupyter
jupyter notebook3. Update Dataset in Notebook
In each notebook:
- Locate the data loading cell
- Replace the dataset file path with your new CSV
- Run all cells sequentially
4. Convert PKL to JSON
Add this cell at the end of each notebook:
import json
import pickle
# Load the pickle files
with open('movies.pkl', 'rb') as f:
movies = pickle.load(f)
with open('similarity.pkl', 'rb') as f:
similarity = pickle.load(f)
# Convert to JSON-serializable format
movies_json = movies.to_dict('records') # For pandas DataFrame
similarity_json = similarity.tolist() # For numpy array
# Save as JSON
with open('../../recomandation system/Movie Recommedation/movies.json', 'w') as f:
json.dump(movies_json, f)
with open('../../recomandation system/Movie Recommedation/similarity.json', 'w') as f:
json.dump(similarity_json, f)
print("Successfully converted PKL to JSON!")5. Verify the Output
Check that the JSON files are created in the recomandation system/ folder:
movies.jsonorshows.jsonordata.jsonorbooks.jsonsimilarity.jsonorshows_similarity.json
6. Restart the Application
Reload the web app to use the new expanded dataset.
- Minimum: 100 items per category
- Optimal: 1,000 - 10,000 items
- Maximum: Limited by browser memory (~50MB JSON)
- Larger datasets = longer initial load time
- Similarity matrices grow exponentially (NΓN)
- Consider splitting very large datasets into chunks
- Use lazy loading for datasets > 10,000 items
1. API Key Errors (401 Unauthorized)
- Solution: Update your API keys in
config.js - OMDB keys expire - get a new one from omdbapi.com
2. Images Not Loading (404 errors)
- Automatic fallback to placeholder images is implemented
- Check browser console for CORS issues
3. Recommendations Not Showing
- Ensure you've added favorites
- Check browser console for API errors
- Verify Firebase connection
4. Browser Cache Issues
- Hard refresh:
Ctrl + Shift + R(Windows/Linux) orCmd + Shift + R(Mac) - Clear browser cache
- Open in incognito/private mode
5. CORS Errors
- Multi-tier proxy fallback is implemented
- Check if external APIs are accessible
- Initial Load: ~2-3 seconds
- Recommendation Generation: ~3-5 seconds
- API Fetch Time: ~1-2 seconds per item
- Total Dataset Size: ~30MB (JSON files)
- Firebase Authentication for user management
- Secure API key storage (move to backend in production)
- Input sanitization to prevent XSS
- HTTPS recommended for production deployment
This project is licensed under the MIT License - see the LICENSE file for details.
β You CAN:
- Use this project for personal or commercial purposes
- Modify and distribute the code
- Use it in private projects
- Sublicense the code
β You CANNOT:
- Hold the authors liable for damages
- Use the authors' names for endorsement
π You MUST:
- Include the original copyright notice
- Include the license text in distributions
This project uses external APIs and services:
- OMDB API: Subject to OMDB terms of service
- Spotify API: Subject to Spotify Developer terms
- Google Books API: Subject to Google API terms
- Google Gemini AI: Subject to Google AI terms
- Firebase: Subject to Google Firebase terms
Please review each service's terms before deployment.