Last active
July 25, 2019 16:42
-
-
Save ShannonScott/85f56c7a447d2edab40b1253f8ae9ab2 to your computer and use it in GitHub Desktop.
[Youtube Playlist List Download] Download a YouTube playlist a a list of URLs. #youtube
This file contains hidden or 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
# Get a YouTube playlist as a list of URLs | |
# | |
# Assumes `youtube-dl` is installed | |
# | |
# python3 youtube_list.py | |
import sys | |
import json | |
from subprocess import check_output | |
output = check_output(['youtube-dl', '-j', '--flat-playlist', sys.argv[1]]) | |
for entry in output.decode('utf-8').split('\n'): | |
if entry == '': | |
continue | |
data = json.loads(entry) | |
#print('{} - https://youtu.be/{}'.format(data['title'], data['id'])) | |
print('https://youtu.be/{:14} {}'.format(data['id'], data['title'])) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original Bash Version
Links