Last active
February 2, 2018 20:54
-
-
Save vic/dd02d2d28e9ff484ee74a833c0a9dff7 to your computer and use it in GitHub Desktop.
Save a YouTube list as a playlist of videos.
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
#!/usr/bin/env bash | |
# | |
# ytpls.sh - Save a YouTube list as a playlist of videos. | |
# | |
# | |
# Doesnt actually download the videos, it just creates a playlist file `.pls` containing each video url. | |
# You can open such files with VLC or other media player on desktop and mobile. | |
# | |
# | |
# USAGE | |
# | |
# ytpl.sh "https://www.youtube.com/watch?v=z368xM1SXpU&index=1&list=PL5tMriwQYETbHMNUvUG2w04M0Es3WvinF" > file.pls | |
# | |
nl=' | |
' | |
echo "[playlist]" | |
youtube-dl --get-filename -o "Title%(playlist_index)s=%(title)s${nl}File%(playlist_index)s=https://youtu.be/%(id)s" --yes-playlist $* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment