Skip to content

Instantly share code, notes, and snippets.

@vic
Last active Feb 2, 2018
Embed
What would you like to do?
Save a YouTube list as a playlist of videos.
#!/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