Skip to main content

TMDB API CLI — movie and TV series metadata scraper

Project description

tmdb-cli

TMDB API v3 command-line tool for scraping movie and TV series metadata.

Installation

git clone <repo-url> && cd tmdb-cli
uv sync

Requires Python 3.11+. Managed with uv.

Setup

Get a TMDB API Read Access Token from themoviedb.org/settings/api.

tmdb config set <YOUR_BEARER_TOKEN>
tmdb config validate

Token is stored at ~/.config/tmdb-cli/config.toml.

Usage

tmdb COMMAND [OPTIONS] [ARGS]

Global flag --json forces raw JSON output on any command:

tmdb --json search movie "Inception" --language zh-CN

Search

tmdb search movie "Inception" --year 2010 --language zh-CN
tmdb search movie "Fight Club" --format json --output result.json
tmdb search tv "Game of Thrones" --first-air-year 2011

Movie Details

tmdb movie info 550                       # Fight Club
tmdb movie info 550 --language zh-CN      # Chinese metadata
tmdb movie credits 550                    # Cast & crew
tmdb movie images 550 --type poster       # List posters by vote score
tmdb movie images 550 --type poster --language zh
tmdb movie similar 550                    # Similar movies
tmdb movie recommendations 550            # AI recommendations

Discover

tmdb discover movie --genre 28 --year 2023 --sort vote_average.desc
tmdb discover movie --genre 28 --genre 12 --vote-gte 7.5 --page 1

Trending

tmdb trending movie --window day
tmdb trending movie --window week

Genres

tmdb genre movie-list --language zh-CN
tmdb genre tv-list

Images

tmdb images download 550 --type poster --size w500 --output-dir ./posters
tmdb images download 550 --type backdrop --size original --language zh

Export

tmdb export nfo 550 --output-dir .              # Kodi-compatible NFO
tmdb export json 550 --output-dir ./data        # Full JSON dump
tmdb export csv 550 --output-dir .              # CSV summary

Organize — Media Library Directory Structure

Creates directories with artwork and NFO metadata, following the convention used by Plex/Jellyfin/Emby.

# Movie: create Movies/Fight Club (1999)/ with poster, fanart, logo, banner, landscape, NFO
tmdb organize movie 550 --base-dir /path/to/media

# TV: create TVs/Game of Thrones (2011)/ with artwork, tvshow.nfo, per-season posters, per-episode thumbnails + NFO
tmdb organize tv 1399 --base-dir /path/to/media --seasons 1,2,3

# Preview only (no files written)
tmdb organize movie 550 --base-dir /path/to/media --dry-run

Movie directory template

Movies/Fight Club (1999)/
├── Fight Club (1999) poster.jpg
├── Fight Club (1999) fanart.jpg
├── Fight Club (1999) clearlogo.png
├── Fight Club (1999) banner.jpg
├── Fight Club (1999) landscape.jpg
└── Fight Club (1999).nfo

TV directory template

TVs/Game of Thrones (2011)/
├── poster.jpg
├── fanart.jpg
├── clearlogo.png
├── banner.jpg
├── tvshow.nfo
├── season01-poster.jpg
├── season02-poster.jpg
├── Season 1/
│   ├── Game of Thrones - S01E01 - Winter Is Coming.nfo
│   └── Game of Thrones - S01E01 - Winter Is Coming-thumb.jpg
└── Season 2/
    └── ...

Development

uv sync --extra dev
uv run pytest
uv run ruff check .
uv run mypy src/

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

tmdb_cli-0.1.0.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

tmdb_cli-0.1.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file tmdb_cli-0.1.0.tar.gz.

File metadata

  • Download URL: tmdb_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tmdb_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4f7efb9e5675f1be615e9ec833ffbaee54ec2054a958716145c57fe7064b2633
MD5 f139188848c6af2398039d6fd31b54b0
BLAKE2b-256 8419394800fc0b52c1a298ce5d62f79d536405346ad30f3095e0fb50195bfff9

See more details on using hashes here.

File details

Details for the file tmdb_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tmdb_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for tmdb_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1de11d880648bff1c9c5f816431d7d4e9032d174bd9fa57f15fe0bb69c70a88d
MD5 c6c4c683b1b423792ed464f34a1e834d
BLAKE2b-256 c6a62bd68487cabb95d6807531d9ca9b9df1b609d7e6e90f4949f014203fde42

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