Async movie/TV metadata fetcher โ TMDB, IMDb, RT, Letterboxd
Project description
๐ฌ Linkify-Media
Async TMDB ยท IMDb ยท Rotten Tomatoes ยท Metacritic ยท Letterboxd
Fast CLI ยท Clean JSON ยท Docker Ready ยท API Ready ยท Zero 404 RT Links
๐ About
Linkify Media is a high-performance Async CLI utility that fetches complete metadata and verified platform links for Movies & TV Series using the TMDB API.
Built for:
- Backend APIs
- Media platforms
- Automation scripts
- Portfolio projects
- Data enrichment pipelines
Powered by:
- โก
aiohttp(async requests) - ๐ฏ Smart slug generation
- ๐ก๏ธ Rotten Tomatoes link validation
- ๐พ In-memory caching
- ๐ฅ๏ธ Proper CLI with
argparse - ๐ณ Docker support
โจ Key Features
| Feature | Status | Description |
|---|---|---|
| Async Engine | โก | Concurrent API calls using asyncio |
| Full Metadata | ๐ฌ | Title, Year, Genres, Runtime, Rating |
| Top Cast Fetching | ๐ฅ | First 5 credited actors |
| Poster Support | ๐ผ๏ธ | TMDB poster image URL |
| Multi-Platform Links | ๐ | TMDB, IMDb, RT, Metacritic, Letterboxd |
| RT Validation | ๐ก๏ธ | Prevents broken Rotten Tomatoes URLs |
| CLI Arguments | ๐ฅ๏ธ | --media, --json support |
| Caching | ๐พ | In-memory caching for performance |
| Docker Support | ๐ณ | Run anywhere without local setup |
| Package Structure | ๐ฆ | Clean, importable Python package |
| API Ready | ๐ | Easy to plug into Django / FastAPI |
๐ฆ Platforms Generated
- โ TMDB
- โ IMDb
- โ Rotten Tomatoes (validated)
- โ Metacritic
- โ Letterboxd (movies only)
- โ JustWatch (PK region)
๐๏ธ Project Structure
linkify-media/
โโโ linkify_media/
โ โโโ __init__.py # Package entry point
โ โโโ utils.py # slugify, fetch helpers
โ โโโ core.py # TMDB logic + link generation
โ โโโ cli.py # argparse CLI
โโโ assets/
โโโ .dockerignore
โโโ .env # TMDB_API_KEY (never commit this)
โโโ .gitignore
โโโ docker-compose.yml
โโโ Dockerfile
โโโ LICENSE
โโโ README.md
โโโ requirements.txt
โโโ pyproject.toml
๐ Installation & Setup
Option A โ Local (Python)
1. Clone Repository
git clone https://github.com/Abdullahkhan000/Linkify-Media
cd Linkify-Media
2. Create Virtual Environment
# Windows
python -m venv .venv
.venv\Scripts\activate
# Mac / Linux
python3 -m venv .venv
source .venv/bin/activate
3. Install Dependencies
pip install -r requirements.txt
pip install .
4. Configure API Key
Create .env in project root:
TMDB_API_KEY=your_actual_api_key_here
โ ๏ธ Never commit
.envโ it's already in.gitignore
Get your free API key at themoviedb.org/settings/api
Option B โ Docker ๐ณ
No Python setup needed. Just Docker + your API key.
1. Clone & create .env
git clone https://github.com/Abdullahkhan000/Linkify-Media
cd Linkify-Media
echo TMDB_API_KEY=your_key_here > .env
2. Build image
docker build -t linkify-media .
3. Run
# Movie
docker run --env-file .env linkify-media "Inception" --media movie
# TV Show
docker run --env-file .env linkify-media "The Bear" --media tv
# Save JSON output
docker run --env-file .env -v ${PWD}/output:/app/output linkify-media "Dune" --json
๐ก Windows PowerShell users: use
${PWD}not$(pwd)for volume mounts
๐ฅ๏ธ Usage (CLI)
# Movie (default)
linkify-media "Inception"
# TV Series
linkify-media "Breaking Bad" --media tv
# Save output as JSON file
linkify-media "Dune" --media movie --json
๐ค Sample Output
{
"Official Title": "Inception",
"Release Year": "2010",
"Genres": ["Action", "Science Fiction", "Adventure"],
"Runtime (mins)": 148,
"TMDB Rating": "8.369 (38000 votes)",
"Poster URL": "https://image.tmdb.org/t/p/w500/oYuLEt3zVCKq57qu2F8dT7NIa6f.jpg",
"Top Cast": ["Leonardo DiCaprio", "Joseph Gordon-Levitt", "Elliot Page", "Tom Hardy", "Ken Watanabe"],
"TMDB Link": "https://www.themoviedb.org/movie/27205",
"IMDb Link": "https://www.imdb.com/title/tt1375666/",
"Rotten Tomatoes": "https://www.rottentomatoes.com/m/inception",
"Metacritic": "https://www.metacritic.com/search/movie/inception/results",
"Letterboxd": "https://letterboxd.com/film/inception/",
"JustWatch (PK)": "https://www.justwatch.com/pk/search?q=Inception"
}
๐ง Architecture
linkify_media/
โ
โโโ utils.py
โ โโโ slugify() # Clean URL-safe slugs
โ โโโ fetch_json() # Async GET requests
โ โโโ head_exists() # URL validation (RT check)
โ
โโโ core.py
โ โโโ fetch_tmdb_data() # Async TMDB search + details + credits
โ โโโ generate_links() # Platform links + RT validation + caching
โ โโโ CACHE # In-memory cache dict
โ
โโโ cli.py
โโโ main() # argparse CLI entrypoint
๐งฉ Use Cases
- Backend Movie APIs
- Django REST integration
- FastAPI async endpoints
- Media dashboards
- Streaming aggregation tools
- Data scraping & enrichment pipelines
๐ Roadmap
- Async engine
- Docker support
- Python package structure
- PyPI release
- Redis caching
- Batch processing mode
- FastAPI version
- Trailer support (YouTube API)
๐ค Contributing
- Fork the repository
- Create your branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m 'Add some feature') - Push to the branch (
git push origin feature/your-feature) - Open a Pull Request
โค๏ธ Support the Project
If this project saves you time or helps your workflow, consider supporting its development.
Your support helps add new features, improve performance, and maintain long-term updates.
๐ License
Licensed under the MIT License โ free to use, modify, and distribute.
โญ Star the repo if you find it useful!
๐ Proudly made by code2encoder aka Shadow Dev ๐
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file linkify_media-0.1.0.tar.gz.
File metadata
- Download URL: linkify_media-0.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bd3fa221aca404e3e85a43efbc6b0dc8144ee584355e0a2e5200e06ff648e7d
|
|
| MD5 |
4cfa18f72c7f1e60f2ef6fd16dba5e45
|
|
| BLAKE2b-256 |
1f1180ef52e2e6da82e0740993b951258e81366cd1dbfa1571430a5753f6ee8c
|
File details
Details for the file linkify_media-0.1.0-py3-none-any.whl.
File metadata
- Download URL: linkify_media-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d84320cafc3fba3454579a42cc67afb39e05cd87edf6f7ee5f4fa7ad09d7a095
|
|
| MD5 |
9a3af1e97639562d07b32e6c719d2e4a
|
|
| BLAKE2b-256 |
a0a12964065069db4929149a9a9bc323e5a69968ea45565f1a19163443193aff
|