Skip to content

Instantly share code, notes, and snippets.

@rgl
Created October 22, 2017 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgl/0fd721d9d0b6b050e5997f554e96f1b9 to your computer and use it in GitHub Desktop.
Save rgl/0fd721d9d0b6b050e5997f554e96f1b9 to your computer and use it in GitHub Desktop.
show a youtube playlist metadata

Download the youtube-dl binary:

wget -q https://github.com/rg3/youtube-dl/releases/download/2017.10.20/youtube-dl
chmod +x youtube-dl
./youtube-dl --version

Download the playlist metadata, prefering audio:

./youtube-dl \
    --ignore-errors \
    --format bestaudio \
    --youtube-skip-dash-manifest \
    --dump-json \
    'https://www.youtube.com/playlist?list=PLheueSXFdOdRa3ica9_S_eNYROg08yS9j' \
    1>playlist.json \
    2>errors.txt

Show playlist and its total bytes:

jq '{title,duration,size:.filesize,acodec,aurl:.formats[0].url,thumbnail,url:.webpage_url}' playlist.json
jq '.filesize' playlist.json | awk 'END {print s} {s += $1}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment