Skip to content

Instantly share code, notes, and snippets.

@nker150
nker150 / howto.md
Created February 3, 2023 05:10
How to archive YouTube channels

How to archive YouTube channels

This guide will show you how to download entire YouTube channels. I'm going to try to keep this as simple and straightforward as possible, and I'll also try to explain some of the why's here as well so that you can better understand how to modify this guide for your own personal use.

The first thing you're going to need is yt-dlp. Once upon a time we would have used youtube-dl, however the developer there didn't seem to keen on bypassing YouTube's throttling. yt-dlp is a fork of youtube-dl that performs far better on YouTube.

How you will get yt-dlp depends on which operating system you're using.

Installing on Windows:

@nker150
nker150 / clean.sh
Created February 3, 2023 05:08
clean.sh for subdirectory
#!/bin/bash
mkdir metadata
mv *vtt *json *webp *description *jpg ./metadata
@nker150
nker150 / update.sh
Created February 3, 2023 05:07
update.sh for subdirectory
#!/bin/bash
yt-dlp --extractor-args youtube:player_client=android --throttled-rate 100K --cookies ~/cookies.txt --download-archive ./archive.txt --write-description --write-info-json --write-annotations --write-sub --write-auto-sub --write-thumbnail -i -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' -o '%(upload_date)s-%(title)s.%(ext)s' https://www.youtube.com/@ThePatriotNurse
@nker150
nker150 / update.sh
Created February 3, 2023 05:06
update.sh for parent directory
#!/bin/bash
function search_and_run() {
for dir in ./*; do
if [ -d "$dir" ]; then
cd "$dir"
if [ -f "$1" ]; then
bash "$1"
fi
search_and_run "$1"