Last active
December 22, 2020 04:57
-
-
Save Anon-Exploiter/ca3ab8f7a7edee8227622c7a6a97e396 to your computer and use it in GitHub Desktop.
Generating commands for youtube playlist downloading in reverse with index in file name using 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
import os | |
playlist = "https://www.youtube.com/user/..." | |
command = f"youtube-dl -j --flat-playlist --playlist-reverse {playlist} | jq -r '.id' | sed 's_^_https://youtu.be/_'" | |
output = os.popen(command).read() | |
print(output) | |
ytUrls = [] | |
for count, urls in zip(range(1, 1000), output.strip().split("\n")): | |
count = str(count).zfill(3) | |
cmd = f'youtube-dl -f mp4 -i -v -R 3 --fragment-retries 3 -c -o "{count} - %(title)s.%(ext)s" {urls} --external-downloader "aria2c" --external-downloader-args "-j 10 -s 10 -x 16 --file-allocation=none -c"' | |
print(cmd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Listing all the video titles in a playlist: