Skip to content

feat: add physical release date lookup and TMDB push scripts - #5

Open
mvanbaak wants to merge 9 commits into
mainfrom
feat/fetch-physical-dates
Open

feat: add physical release date lookup and TMDB push scripts#5
mvanbaak wants to merge 9 commits into
mainfrom
feat/fetch-physical-dates

Conversation

@mvanbaak

@mvanbaak mvanbaak commented Jul 27, 2026

Copy link
Copy Markdown
Owner

What

Three scripts that bridge the gap between Blu-ray.com physical release dates and TMDB:

  1. fetch_physical_dates.sh — Searches Blu-ray.com for physical release dates missing from Radarr
  2. tmdb_login.sh — Playwright-based TMDB login, exports session cookies for curl-based automation
  3. push_physical_to_tmdb.sh — Pushes physical release dates to TMDB via their website's Kendo grid API

Also adds --help/-h flag to all 7 scripts in the repo.

Why

Radarr's physicalRelease field is populated from TMDB, which sometimes lacks physical release dates (e.g. Supergirl 2026 had a Blu-ray planned for Sep 08 2026 before TMDB listed it). Blu-ray.com has this data earlier.

TMDB has no API write endpoint for movie metadata — dates must be submitted manually via their website. These scripts automate that process.

How

Two-phase cookie-based authentication

TMDB's login endpoint is protected by AWS WAF JavaScript challenges. curl can't solve these, but Playwright can.

  1. Phase 1 (tmdb_login.sh): Runs once on a machine with display/Xvfb. Uses Playwright to solve WAF challenge, exports session cookies to Netscape format file (~/.tmdb_cookies.txt)
  2. Phase 2 (push_physical_to_tmdb.sh): Reads exported cookies, makes direct curl calls to TMDB's Kendo grid REST API. Runs anywhere — FreeBSD, headless servers, cron jobs.

Pipeline integration

# Find missing dates, then push them to TMDB
./radarr/fetch_physical_dates.sh --json --quiet | ./radarr/push_physical_to_tmdb.sh

Date format conversion

Accepts both YYYY-MM-DD and Sep 08, 2026 formats (output from Blu-ray.com lookup).

Usage

# Step 1: Login (run once, on machine with display)
./radarr/tmdb_login.sh

# Step 2: Push dates
./radarr/push_physical_to_tmdb.sh 123456 2026-09-08 "Movie Title"

# Or pipeline from fetch_physical_dates.sh
./radarr/fetch_physical_dates.sh --json --quiet | ./radarr/push_physical_to_tmdb.sh

# Dry-run mode
./radarr/push_physical_to_tmdb.sh --dry-run 123456 2026-09-08 "Movie Title"

All scripts support --help/-h for quick reference.

Flags

fetch_physical_dates.sh

Flag Effect
--limit N Process max N movies per run
--export <file> Write results to file
--csv Export as CSV (default: JSON)
--json JSON output to stdout
--quiet Suppress table output
--debug Verbose logging
--country <code> Country filter (default: US)

push_physical_to_tmdb.sh

Flag Effect
--dry-run Show what would be submitted, don't POST
--country <code> ISO 3166-1 country code (default: US)
--language <code> ISO 639-1 language code (default: en)
--type <N> Release type 1-7 (default: 5 = Physical)
--note <text> Note field (default: "Physical release")
--cookies <file> Cookie file path (default: ~/.tmdb_cookies.txt)
--rate-limit <s> Seconds between requests in pipe mode (default: 1)
--debug Verbose logging

tmdb_login.sh

Flag Effect
--cookies <file> Output cookie file path (default: ~/.tmdb_cookies.txt)
--debug Verbose logging

Configuration

Add to scripts.conf:

TMDB_USERNAME="your_username"
TMDB_PASSWORD="your_password"
TMDB_COOKIE_FILE="/path/to/cookies.txt"  # optional, default ~/.tmdb_cookies.txt

Dependencies

  • fetch_physical_dates.sh: curl, jq
  • push_physical_to_tmdb.sh: curl, jq, grep, sed (all POSIX)
  • tmdb_login.sh: Node.js with Playwright package (one-time, on dev machine)

Scheduling

# Weekly: find missing dates and push to TMDB
0 8 * * 1 /path/to/radarr/fetch_physical_dates.sh --json --quiet | /path/to/radarr/push_physical_to_tmdb.sh >> /var/log/push-physical.log 2>&1

mvanbaak added 4 commits July 27, 2026 16:30
Searches Blu-ray.com for physical release dates missing from Radarr.
Outputs results as table, JSON, or CSV for manual TMDB submission.
Two-phase approach for pushing physical release dates to TMDB:
- tmdb_login.sh: Playwright-based login, exports session cookies
- push_physical_to_tmdb.sh: curl-based API calls, runs anywhere

Phase 1 (tmdb_login.sh) runs once on machine with display to solve
AWS WAF JavaScript challenge. Phase 2 (push_physical_to_tmdb.sh) uses
exported cookies for POSIX-only execution on FreeBSD/headless servers.
@mvanbaak mvanbaak changed the title feat: add Blu-ray.com physical release date lookup script feat: add physical release date lookup and TMDB push scripts Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant