Skip to content

Instantly share code, notes, and snippets.

@o3bvv
Last active January 8, 2022 00:19
Show Gist options
  • Save o3bvv/2b39aa03191fb45050b76e19705afd57 to your computer and use it in GitHub Desktop.
Save o3bvv/2b39aa03191fb45050b76e19705afd57 to your computer and use it in GitHub Desktop.
youtube-dl playlist
#!/usr/bin/env sh
for n in *.mp3
do if [[ "$n" =~ -[-_0-9a-zA-Z]{11}.mp3$ ]]
then echo "youtube ${n: -15: 11}" >> downloaded.txt
fi
done
#!/usr/bin/env sh
export PLAYLIST_ID=XXXXXXXXXXXXXX
youtube-dl \
--download-archive downloaded.txt \
--continue \
--no-post-overwrites \
--no-overwrites \
--format bestaudio --extract-audio --audio-format mp3 \
--yes-playlist $PLAYLIST_ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment