Last active
December 10, 2017 16:30
-
-
Save florianeckerstorfer/ee4b06caa349506eb52dbf4de2faaf9e to your computer and use it in GitHub Desktop.
Download TinyDesk Concerts from NPR
This file contains hidden or 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
# 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