Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

which-vid

Paste a release listing (NZB/torrent search results from Sonarr, Radarr, Prowlarr, etc.) and get the best picks ranked for your specific Plex setup.

Default profile: Plex on a Synology NAS → Apple TV 4K → Sonos. The scorer favors releases that play end-to-end without anything having to transcode or downmix.

Why

The NAS (an Atom C2538) has no hardware transcode — it can only stream a file, never re-encode it in real time. So the golden rule is: whatever you download must Direct Play on the endpoint, or it stutters. Three constraints follow:

  • Resolution → 1080p is the sweet spot. 1080p H.264/HEVC Direct-Plays on every client — the Apple TV, a phone, a browser, a remote stream, even an Apple TV whose output is set to 1080p. 4K only Direct-Plays when the entire endpoint is truly 4K; the moment it isn't (1080p TV/output, a non-4K client, a bandwidth-capped remote session), Plex asks the transcode-less NAS to shrink 4K→1080p and it can't keep up. So the scorer now prefers 1080p over 4K.
  • Audio → Sonos: Sonos decodes Dolby (Dolby Digital / DD+ / DDP-Atmos), but DTS, DTS-HD MA, TrueHD, and FLAC don't pass cleanly through the Apple TV → Sonos hop — they downmix or drop surround. Prefer DDP/EAC3/AC3.
  • Legacy video codecs: the Apple TV can't hardware-decode VC-1 or MPEG-2 (common on old BluRay/broadcast rips), which forces a heavy transcode or fails outright.

This tool reads the release names, scores each candidate against those realities, and surfaces the few that will Just Work.

Install

No dependencies — just stdlib Python 3.10+.

git clone git@github.com:michaeldtimpe/which-vid.git
cd which-vid
chmod +x which_vid.py

Usage

# Auto-read from macOS clipboard
python3 which_vid.py

# Pipe from clipboard explicitly
pbpaste | python3 which_vid.py

# From a file
python3 which_vid.py < listing.txt

# Say which film you are searching for, so a foreign retitle can't win
python3 which_vid.py --title "I Love You Phillip Morris"

--title is worth using on older or well-travelled catalogue titles. Scoring a release name on its own cannot tell a foreign-language edition from the film you wanted — L'artista.della.truffa.2010.1080p.WEB-DL.DD+.2.0.H.264 is a structurally excellent WEB-DL, and without --title it outranks every genuine English release of I Love You Phillip Morris. This is the same failure mode as the Quebec-French dub that once imported cleanly: a bad grab is rarely the first choice, it's the last one after the good options die.

Paste the multi-line search output from your indexer UI. The script extracts release titles, infers resolution/codec/source/audio/size from the names, dedupes cross-indexer duplicates, scores each release, and prints a ranked Top Picks list plus an Avoid list.

Example

Input (abridged):

nzb    44 days
Train.Dreams.2025.2160p.NF.WEB-DL.DDP5.1.Atmos.H.265-XEBEC-AsRequested
NZBgeek        11.9 GiB        English    WEBDL-2160p
nzb    178 days
Train.Dreams.2025.1080p.10bit.WEBRip.6CH.X265.HEVC-PSA
NzbPlanet        1.7 GiB        English    WEBRip-1080p
...

Output:

TOP PICKS
  [ 55] Train.Dreams.2025.2160p.NF.WEB-DL.DDP5.1.Atmos.H.265-XEBEC-AsRequested
        2160p - 11.9 GiB
        + HEVC, WEB-DL, Atmos (DDP), DDP/EAC3
        - 4K (Direct Plays only if the endpoint is truly 4K, else NAS transcode)
  ...

AVOID
  [ 42] Train.Dreams.2025.1080p.10bit.WEBRip.6CH.X265.HEVC-PSA
        - WEBRip, small 1080p

(A great 4K WEB-DL still outscores a poor 1080p WEBRip — "1080p-first" is a tie-breaker that prefers 1080p when quality is otherwise comparable, not a hard ban on 4K. Swap in a solid 1080p WEB-DL and it wins outright.)

Scoring

Signal Effect
1080p / 2160p / 720p +30 / +18 / +10 (1080p preferred — universal Direct Play; 4K flagged as endpoint-dependent)
HEVC (H.265/x265) +10
H.264 / x264 +9
WEB-DL source +15
WEBRip source +4
HDTV source −5
Atmos audio (in DDP/EAC3) +8
DDP / EAC3 audio +4
AC3 / Dolby Digital audio +3
DTS / DTS-HD / TrueHD / FLAC −8 (won't pass Apple TV → Sonos cleanly)
AAC audio −2 (no Dolby surround for Sonos)
2.0 stereo audio −10 (surround is gone for good, whatever the codec)
Dub tag (TRUEFRENCH / ITA / LATINO / CASTELLANO…) −12 (NORDiC/SKST exempt — they keep original audio)
Title mismatch vs --title −25 (foreign retitle, e.g. L'artista della truffa)
Legacy video (VC-1 / MPEG-2 / XviD / DivX) −12 (Apple TV can't hardware-decode)
Multi-audio (MULTI/DUAL/iTA-ENG) −3 (wrong default track risk)
SDR tag label only (no HDR tone-mapping required)
2160p under 8 GiB −5 (low bitrate)
2160p over 20 GiB −3 (very large)
1080p under 2.5 GiB −2 (small)

Tuning the profile

Open which_vid.py and edit the score() function. Each heuristic is a few lines — adjust weights, add codecs, or comment out checks that don't apply to your client.

If you have a different setup (Nvidia Shield, beefy NAS that transcodes happily, an old Roku that hates HEVC), the weights to flip are:

  • Strong NAS, weak client: penalize HEVC, reward H.264.
  • Weak NAS, strong client: keep defaults — Direct Play matters most.
  • HDR-capable client: remove the SDR pro, and consider rewarding DV / HDR10 / HDR10+ tokens.

Limitations

  • Heuristic-only: scoring is based on the release name, not file inspection. A mislabeled release will be misranked.
  • macOS-first: clipboard auto-read uses pbpaste. On Linux/Windows, pipe input via stdin.
  • Format-tolerant but not format-agnostic: parsing assumes dot-separated release names with embedded resolution tags (2160p/1080p/720p/480p). Works with Sonarr/Radarr/Prowlarr interactive search output and most indexer dumps.

License

Personal-use script. Do whatever.

About

Score NZB/torrent release listings for Plex Direct Play on older Synology -> Apple TV 4K

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages