Create a gist now

Instantly share code, notes, and snippets.

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