Skip to content

Instantly share code, notes, and snippets.

@abhishekkr
Last active October 13, 2015 06:48
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 abhishekkr/4156364 to your computer and use it in GitHub Desktop.
Save abhishekkr/4156364 to your computer and use it in GitHub Desktop.
shell.func-download-all-media-from-RSS
#####
## $ ddl-rss-media https://www.defcon.org/podcast/defcon-20-slides.rss
#####
ddl-rss-media(){
# ddl-rss-media RSS_LINK {would download all media enclosed at current dir}
enclosures=`curl -k -s -L $@ | cat | grep enclosure | sed 's/.*enclosure\s*url="//' | sed 's/".*//'`
for url in `echo $enclosures | xargs -L1`;
do
if [ ! -z $url ];
then
filename=`echo $url | sed 's/?.*//' | sed 's/.*\///'`
echo "Downloading $filename..."
wget -c -O $filename $url
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment