Last active
August 1, 2016 06:24
-
-
Save zeerorg/43d7e37ad5831fb06278a0a063764baf to your computer and use it in GitHub Desktop.
Uninterrupted youtube playlist download
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 subprocess | |
import os | |
output_file = '%(playlist_index)s - %(title)s.%(ext)s' # do not change this | |
link = '' # replace with url of playlist | |
start_playlist = 1 | |
number = 1 | |
files = [ f for f in os.listdir(".") ] | |
for f in files: | |
f = f.split("-")[0] | |
try: | |
number = int(f) | |
except: | |
pass | |
if start_playlist < number: | |
start_playlist = number | |
while True: | |
try: | |
subprocess.check_call("youtube-dl -o '%s' --playlist-start %s '%s'" % (output_file, str(start_playlist), link), shell=True) | |
break | |
except KeyboardInterrupt: | |
break | |
except: | |
continue | |
#print ("youtube-dl -o '%s' '%s'" % (output_file, link)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment