Skip to main content

Async movie/TV metadata fetcher โ€” TMDB, IMDb, RT, Letterboxd

Project description

๐ŸŽฌ Linkify-Media

Python Async Docker Maintenance License

Linkify Media Banner

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

  1. Fork the repository
  2. Create your branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -m 'Add some feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Open a Pull Request

โค๏ธ Support the Project

If this project saves you time or helps your workflow, consider supporting its development.

Patreon

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linkify_media-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linkify_media-0.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

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

Hashes for linkify_media-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1bd3fa221aca404e3e85a43efbc6b0dc8144ee584355e0a2e5200e06ff648e7d
MD5 4cfa18f72c7f1e60f2ef6fd16dba5e45
BLAKE2b-256 1f1180ef52e2e6da82e0740993b951258e81366cd1dbfa1571430a5753f6ee8c

See more details on using hashes here.

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

Hashes for linkify_media-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d84320cafc3fba3454579a42cc67afb39e05cd87edf6f7ee5f4fa7ad09d7a095
MD5 9a3af1e97639562d07b32e6c719d2e4a
BLAKE2b-256 a0a12964065069db4929149a9a9bc323e5a69968ea45565f1a19163443193aff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page