Archiving a YouTube Channel

Archiving a YouTube channel with yt-dlp


Table of Contents


Install youtube-dl or yt-dlp.


Initial archive

The initial channel archive can be completed with a simple command:

yt-dlp --add-metadata <channel url>

Note that yt-dlp automatically passes the -f bestvideo*+bestaudio/best flag. Specify your desired format if applicable.

Auto-archive new videos

To continue auto-archiving the channel:

while IFS= read line; do
        yt-dlp --add-metadata --dateafter now-1week --break-on-reject --download-archive "</path/to/directory>/<channel list>.txt" -o "</path/to/directory>/%(title)s.%(ext)s" "$line"
done < </path/to/directory>/<channel list>.txt


This will fetch the last week’s worth of content. If content has already been downloaded, it will be skipped without error.

Example below:

while IFS= read line; do
        yt-dlp --add-metadata --dateafter now-1week --break-on-reject --download-archive ~/archive.txt -o "~/vault/videos/new/%(title)s.%(ext)s" "$line"
done < ~/channels.txt

To run this automatically, add it to the crontab:

crontab -e
* */6 * * *

I run mine four times per day.



Occasionally, YouTube will rate limit downloads. The initial download may progress at normal speed, but subsequent videos will be limited to Kb/s.

One solution is to load any YouTube video while downloading. Leave a long video on loop during the duration of the download.

You may also try lowering --throttled-rate to the highest Kb/s rate occuring when downloading.

Tagged: Archival