Skip to content

Instantly share code, notes, and snippets.

@Ravenstine
Created January 1, 2026 19:55
Show Gist options
  • Select an option

  • Save Ravenstine/9673f7d316de7cd2e85540bc37f213f9 to your computer and use it in GitHub Desktop.

Select an option

Save Ravenstine/9673f7d316de7cd2e85540bc37f213f9 to your computer and use it in GitHub Desktop.
yt-dlp catchall alias

This is my shell alias for yt-dlp that simplifies archival of both individual videos and entire channels.

Usage

ytdl "https://some-video-or-channel.url"

Flags Explained

--embed-metadata

Add metadata to the video file.

--embed-thumbnail

Embeds the video thumbnail into the downloaded file. This incidentally causes yt-dlp to convert the video to an MKV file, which I actually find preferable.

--embed-subs

Embed subtitles, which I don't think yt-dlp does by default.

--embed-chapters

Embed chapters; again, another thing I yt-dlp doesn't do by default.

--cookies-from-browser

Works around any issues with ads and age-restricted videos. Especially helpful if you have YouTube Premium.

--sleep-interval

I find that having an interval of 20 seconds between individual video downloads reliably avoids rate-limiting. Yt-dlp is supposed to respond accordingly to the rate-limiting interval that YouTube returns, but I've noticed that rate-limiting sometimes happens anyway. This added interval is better insurance.

--download-archive

Keeps a list of downloaded videos in a text file. This ensures that you can resume or download new videos from a channel using the same command without redownoading all of the videos.

alias ytdl="yt-dlp --embed-metadata --embed-thumbnail --embed-subs --embed-chapters --cookies-from-browser firefox --sleep-interval 20 --download-archive archive.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment