Fed up with YouTube's constant adverts and, on some platforms, the inability to do picture-in-picture easily?
I didn't fancy paying a significant monthly fee and being tracked through a login requirement, and, well, I already had an instance of jellyfin running, so here's what I did:
I integrated video/audio download tool, yt-dlp, with the media server jellyfin, and added a web interface.
I say "integrate", but it was really nothing more than:
- install yt-dlp on the same server as jellyfin
- install the Youtube-dl WebUI
- I put it behind nginx, and used certbot / Let's Encrypt to enable tls
- add login.php to the nginx index parameter, if you want to access it at example.com, rather than typing example.com/login.php. Not a big deal if you plan on bookmarking it.
- create a new directory, as the download destination for yt-dlp. Make it writeable by your webserver
- edit youtube-dl-webui's config file, to reference the new directory (and, while there, add a strong password)
- make the log file writeable by the webserver too
- in jellyfin, add the new directory to jellyfin's list of libraries, making sure you set it to automatically monitor for new content
And that's it.
Now, when you want to watch something on YouTube (or one of the >1300 other sites supported by yt-dlp) grab the URL, and put it into the youtube-dl-webui. Give it a few seconds to download it, and for jellyfin to ingest it.
If you want just the audio, tick the checkbox before downloading.
And, bingo: a file you can watch without adverts, and with picture-in-picture if you want it, via the jellyfin client (or web client).
(And you can delete downloaded files via the youtube-dl-webui interface too.)