Created
May 5, 2018 01:52
-
-
Save sagax/5fe39825ead21e7f04028fc0b51150a0 to your computer and use it in GitHub Desktop.
youtube playlist downloader with youtube-dl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# how to use | |
# youtubeplaylistdownload.sh link_to_playlist format_to_download | |
# example | |
# youtubeplaylistdownload.sh PL5zohYERz9XAYqBu0HQJ_tudt2R6gbPtb 171 | |
# | |
for url in $(curl -s -X GET https://www.youtube.com/playlist?list="$1" | awk '/data-video-id=/{match($0, /data-video-id="([^"]*)/, arr); print("https://www.youtube.com/watch?v="arr[1]);}'); do | |
youtube-dl -f "$2" $url | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment