Skip to content

Instantly share code, notes, and snippets.

@florianeckerstorfer
Last active December 10, 2017 16:30
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 florianeckerstorfer/ee4b06caa349506eb52dbf4de2faaf9e to your computer and use it in GitHub Desktop.
Save florianeckerstorfer/ee4b06caa349506eb52dbf4de2faaf9e to your computer and use it in GitHub Desktop.
Download TinyDesk Concerts from NPR
# tinydesk-download.fish
# - By Florian Eckerstorfer https://florian.ec @Florian_
#
# Requires cli-scrape (from NPM), jq and wget (from Homebrew)
#
# npm i -g cli-scrape
# brew install jq
# brew install wget
set links (scrape "https://www.npr.org/rss/rss.php?id=92071316" '//item/guid')
set titles (scrape "https://www.npr.org/rss/rss.php?id=92071316" '//item/title')
for i in (seq (count $links))
set title (echo $titles[$i] | awk -F': ' '{print $2" - "$1}')
set url (scrape $links[$i] '//div[@data-jwplayer]/@data-jwplayer' | jq '.sources[] | select(.label == "HD") | .file' -r)
wget -c -nc -O "$title.mp4" $url
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment