Skip to content

Instantly share code, notes, and snippets.

@obar1
Forked from zmwangx/youtube-ls-playlist.sh
Created September 10, 2017 18:31
Show Gist options
  • Save obar1/203ad9e0b4b09b07bd07c9effb75fbfa to your computer and use it in GitHub Desktop.
Save obar1/203ad9e0b4b09b07bd07c9effb75fbfa to your computer and use it in GitHub Desktop.
List video URIs in a YouTube playlist.
#!/usr/bin/env bash
# Takes a YouTube URI to a playlist (fairly liberal, it's fine as long
# as the playlist id can be extracted), and prints a list of URIs in a
# YouTube playlist.
#
# Requires youtube-dl 2014.10.24, tested on youtube-dl
# 2014.11.02.1. Feature subject to change.
youtube-dl -j --flat-playlist "$1" | jq -r '.id' | sed 's_^_https://youtube.com/v/_'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment