Skip to content

Instantly share code, notes, and snippets.

@ljmccarthy
Last active March 9, 2023 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljmccarthy/da3e784a1d2bbf0c9cf4f867053f1083 to your computer and use it in GitHub Desktop.
Save ljmccarthy/da3e784a1d2bbf0c9cf4f867053f1083 to your computer and use it in GitHub Desktop.
YouTube-DL archiving script
#!/bin/sh
download_videos() {
yt-dlp --download-archive archive -ciw -o "%(upload_date)s %(id)s %(title)s.%(ext)s" -v "$@"
}
find . -type d | while read dir; do
if [ -f "$dir/url" ]; then
(cd "$dir" && download_videos "$(cat url)")
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment