Last active
May 23, 2020 11:52
-
-
Save dmfunk/e176bcff7d76a56f2073 to your computer and use it in GitHub Desktop.
In response to the question here: http://www.reddit.com/r/learnprogramming/comments/2u7xon/the_command_line_doesnt_have_to_be_scary_heres_a/co6h6xl
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
import pafy | |
playlist_url = raw_input("Please enter a proper Youtube playlist URL: ") #must be properly formatted like https://www.youtube.com/playlist?list=PL557BC4AF6ABFF637 | |
playlist = pafy.get_playlist(playlist_url) | |
how_many_vids_in_this_playlist = len(playlist['items']) #long variables are fun | |
print "Thanks for the URL, I'm now going to download", how_many_vids_in_this_playlist, "videos" | |
for videos in playlist['items']: | |
target = videos['pafy'].getbestaudio() | |
print "Currently downloading", videos['playlist_meta']['title'] #might as well see the name of each track as it downloads | |
# it would be nice to have a progress indicator, like x of total finished downloading | |
#I'll leave that part up to you :) | |
target.download() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment