Storing config options for yt-dlp in a config file

I should probably file this under “read the fantastic man page”.

I am using yt-dlp and jellyfin as a media server setup.

I recently added ytdl-sub to automate downloads from YouTube, from pre-defined channels.

And it all works well. Really well.

Except for playback on Apple devices.

It turns out that the default download format is .webm, and Apple devices - iOS / iPadOS / tvOS, at least - seem to struggle with this, or else be incapable of playing it, forcing transcoding.

There are command line options for yt-dlp to specify downloading another format (e.g. mp4), and it finally dawned on me that there must be a way of passing options to it when using it non-interactively.

And there is: the config file

I added a config file in the same directory as my yt-dlp binary. (If you are not sure what that is, then which yt-dlp should help.)

I’ve added:

-f mp4 --sponsorblock-remove "default"

So far, this has worked, but I am not sure what (if anything) is going to happen if I were to try to download a video for which there was not a .mp4 version. I presume it will fail, but I’ve yet to try it.

I could also look at transcoding files which arrive as webm.