I’m not a sophisticated YouTube watcher but I do watch a lot of YouTube. For a while I was happy enough to simply use the YouTube app with a Chromecast. Yes there were ads, but the experience was nice enough that I tolerated them.
Recently, however, this became untenable.
It started with Google deciding to replace their simple Chromecast target with a Google TV style app, complete with a list of video recommendations I had no interest in watching. This redesign also came with more ads, which themselves would be annoying enough. But with this year being an election year, I started seeing campaign ads from a political party I have absolutely zero interest in seeing ads from. Naturally Google being Google, there was no way for me to block them. I guess I could have just paid to remove the ads, but this wouldn’t solve the Chromecast problem. Besides, the feeling of paying for something that is arguably not a great use of my time felt wrong. I felt that a bit of friction in my YouTube watching habits wouldn’t be a bad thing to introduce.
It was time to consider an alternative setup.
Taking inspiration from those on Micro.blog and certain podcasters, I decided to give Plex a go. I had an Intel Nuc that I purchased a few years ago that I wasn’t using and it seemed like a good enough machine for a Plex server. The Nuc is decent enough, but it’s a little loud and I didn’t want it anywhere where I usually spend my time. It’s currently in a wardrobe in my spare bedroom.
After upgrading it to Ubuntu 20.04 LTS, I installed the Plex Media Server. I had to create a Plex account, which was a little annoying, but after doing so, I was able to setup a new library for YouTube videos relatively easily. I configured the library to poll every hour, which would come in handy for the next part of this setup.
I also installed the Plex app on my Android phone to act as the media player. The app has support for Chromecast, which is my preferred setup. Getting the app to talk with the media server was a little fiddly. I can’t remember all the details as it was a couple of months ago, but I do remember it taking several times before the app was listing videos in the library. But once the link was established, it because quite easy to play downloaded videos on my TV. I’ll have more to say about the app near the end of the post.
Youtube-dl And Broadtail
Once Plex was setup, I needed a way to download the YouTube videos. I was hoping to use youtube-dl, but the idea of SSH’ing into the media server to do so was unappealing. I was also aware that it was possible to subscribe to YouTube channels via RSS, which is my preferred way to be notified of new content. I’m tend not to subscribe to channels within YouTube itself as I rather Google didn’t know too much about my viewing preferences (sorry YouTubers).
I figured having a small web-app which will run alongside Plex that would allow me to subscribe to YouTube RSS feeds, and download the videos using youtube-dl to the Plex library, would be ideal. I’m sure that such applications already exist, but I decided to build my own.
So I built a small Go web-app to do this. I called it Broadtail, mainly because I’m using bird-related terms for working project names and I couldn’t think of anything better. It’s pretty basic, and it is ugly as sin, but it does the job.
I can setup an RSS subscription to YouTube channels and playlists, which it will periodically poll and store in a small embedded database. I can get a list of videos for each feed I’ve subscribed to and if it looks interesting, I can start a download from the UI. The app will run the appropriate youtube-dl incantation and provide a running status update, with some really basic job controls.
The downloaded videos are saved as MP4s in a directory configured as a Plex library. The one hour scan will pick them up, although I occasionally need to trigger a rescan manually if the video was downloaded relatively recently. During the day, I look for any new videos which look interesting, and start downloads in Broadtail. The videos would (usually) be ready and available in Plex by evening. The only exception are videos which are 3 to 4 hours long, which usually take around a day to download thanks to YouTube’s throttling.
How It’s Working Out
Putting this together took roughly a month or so, and I’ve been using it for my YouTube viewing for a couple of months now. In general, it’s working OK. The Plex media server is working quite well, as is the Plex mobile app. Broadtail is pretty bare bones but I’ve been slowly making changes to it over time as my needs evolve.
There are a few annoyances though. One large one is that the Plex app for Android is a little buggy. It gets into a state in which it is unable to start playback of a video, and the only way I know of fixing this is by rebooting the Chromecast device. This is really annoying and it’s gotten to the point when I’m doing this almost daily. I contemplated actually setting the Chromecast up on a smart plug so that I can force a restart simply by killing power to it in the middle of the night. It hasn’t quite gotten to the point where I’ve done this, but if Plex doesn’t fix their app soon, I think I may go ahead with this.
Also annoying is that sometimes the Plex app will loose connection with the media server, and will not list the contents of my library. Fortunately a restart of the mobile app is enough to resolve this.
As for the Intel Nuc itself, there have been instances when it seems to lock up, and I had to hard power it down. I don’t know what’s causing this. It could be that either Plex or Broadtail is causing a kernel panic of sorts, or it could be something in the the Nuc itself: it’s reasonably low cost hardware that is tailored more for Windows. I may eventually replace the Nuc with the Mac Mini I’m currently using as a desktop, once it’s time to upgrade.
But all in all, I think this is working for me. Not seeing any ads or crappy recommendations is a major win, and it’s also nice to actually run out of things to watch, forcing me to do something productive. Sometimes question whether the time it took to set this all up was worth it. Maybe, maybe not. But it feels a little better having something a little more in my control, than simply paying YouTube to remove the ads.
Finally, if Broadtail sounds interesting to you, it’s available on GitHub. I’ve only recently open-sourced it, so there’s a lot of missing things like decent documentation (it only got a README today). So please consider it in a bit of a “here be dragons” state at the moment. But if you have any questions, feel free to contact me.