yt-plex v2: Settings, Radarr Suggestions, and a Docker Box for a Friend
Why: Damien wants to give yt-plex to a friend as a Docker container. That meant everything hardcoded for this server (login, library paths, Plex section numbers) had to become something you set up from the page. It was also a chance to add Radarr name suggestions and rework the row layout.
Two days after v1, yt-plex keeps all of its configuration in its own database. A fresh install greets you with a "create your login" page, then opens Settings so you can add library folders. My instance was migrated in place and still runs as the same systemd user service. The Docker image is for other people.
1. Config moved into the app
- Login: a scrypt hash in the
settingstable, changed under Settings → Account. I migrated the v1 password and then deleted/home/plex/yt-plex/.env, the only plaintext copy. The session key lives indata/session.key. - Libraries: a
librariestable (name, path, kindmovie|tv, optional Plex section). They're editable in Settings with a click-through folder browser. My eight v1 libraries were migrated with the same IDs and order. Multiple TV libraries now work too. - Drive-missing guard, generalised: v1 checked
/media/plex1is a mountpoint. That doesn't translate to Docker, where a missing bind-mount source shows up as an empty directory. So now a library root that has ever held files and is now empty refuses writes. A brand-new, legitimately empty library still works until its first download. - Plex: URL + token are optional settings. If none is set and
Preferences.xmlis readable, the local server's token is used, which is what this box does. Scans are per-folder when Plex knows the path, and whole-section otherwise, as in Docker where container paths aren't Plex's paths.
2. Radarr name suggestions (and Sonarr search)
For non-TV items, the title is cleaned up and run through Radarr's movie/lookup. That searches TMDB, not only what's already in Radarr, and hits that are in the library are flagged. Cleanup strips junk like "Official Video", "4K", "60fps", "Netflix Special" and bracketed tags, and tries the pieces either side of |, ·, - and :.
The row shows "Radarr match found — Title (Year). Click here to use this name", plus a dropdown of other matches. It never renames on its own. Tuning was done against live data. A short fragment only scores for the share of the title it covers; without that, a DJ set titled "TBA - Nikolina | HÖR…" "matched" a movie called TBA at 100%. A year written in the title (e.g. "The Room (2003)") breaks ties between same-named films. "Search Radarr" re-runs the lookup using whatever is in the name box.
When connected, Sonarr's series/lookup powers the "Add a show" search, with Skyhook as the fallback.
3. UI changes
- Library, TV Shows and Quality dropdowns stack under the thumbnail. "TV Shows (edit)" appears only for TV libraries. "Add new…" at the top of that list opens the show dialog, and the new show is selected on that row automatically.
- Cancel sits beside the progress bar and only exists while downloading. The Retry button is gone: Go does the same thing on a failed row, and on a failed lookup it re-runs the lookup.
- The top-bar "TV Shows" button became Settings, with tabs for Libraries, TV Shows, Connections, Account and yt-dlp. There's a logo bug in the header, from Damien's artwork (source kept at
assets/yt-plex.png).
4. yt-dlp updates itself
The v1 cron (50 5 * * * pip upgrade of the venv) couldn't work in a container running as an unprivileged user. It's replaced by an in-app daily check: when PyPI has a newer yt-dlp and the queue is idle, it's installed with pip --target into data/ytdlp-lib and swapped in atomically. yt-dlp now runs as python -m yt_dlp, with that folder first on PYTHONPATH. I removed the cron entry. I also verified the --target install separately, since today's check found nothing newer.
5. Docker packaging
Dockerfile (python:3.12-slim + ffmpeg + deno 2.9.7 from denoland/deno:bin-2.9.7), docker-compose.yml (runs as a chosen UID:GID, ./data for state, media folders bind-mounted) and a friend-facing README.md. I built it locally as yt-plex:latest and tested a throwaway container through first-run setup, the second-setup lockout, the bad-path rejection, the folder browser and a real download into the mounted folder with correct ownership. It isn't pushed anywhere yet; how to hand it over is Damien's call.
Net effect: same app at the same URL for me, now with Radarr name suggestions and in-app settings, and portable enough to hand to someone else.
← Back to Admin Hub