Downloading YouTube subscriptions and channels automatically

I’ve written before about my media player setup, including Jellyfin (as the media server), and yt-dlp for downloading from YouTube.

What I’ve wanted for a while is a tool for downloading subscriptions, or simply the content of channels, from YouTube.

That way, when a new video is available on a channel, I can have it in Jellyfin, to view on a player of my choice, automatically and rapidly afterwards.

Enter ytdl-sub.

ytdl-sub is a command line tool which makes use of yt-dlp.

You configure it - via a YAML config file - with the channels you want it to use, and, when you run the tool, it downloads the videos from those channels using yt-dlp.

It has a simple option for setting the maximum number of videos, so you don’t download everything, as well as for tagging videos with genre.

Here’s a sanitised version of my subscriptions.yaml:

# subscriptions.yaml:
# Everything in here can be downloaded using the command:
#   ytdl-sub sub subscriptions.yaml

# __preset__ is a place to define global overrides for all subscriptions
__preset__:
  overrides:
    # Root folder of all ytdl-sub TV Shows
    tv_show_directory: "/media/shows"
    
    # Download videos from the last month, to a maximum of 5
    only_recent_date_range: "1months"
    only_recent_max_files: 5
    

###################################################################

Jellyfin TV Show by Date:


  = GenreA | Only Recent:
    "Channel 1": "https://www.youtube.com/@channel1"
    "Channel 2": "https://www.youtube.com/@channel2"

  = GenreB | Only Recent:
    "Channel 3": "https://www.youtube.com/@channel3"

(You’d use replace GenreA/B, and Channel 1/2/3, with your own choice of genre tag and actual channel names and paths.)

I haven’t experimented with settings beyond this.

Set it up via a cron job to run automatically.

Bingo!