a shell utility code for download all media present as enclosures in any RSS
eg. usage to download all slides video of DefCon20
$ ddl-rss-media https://www.defcon.org/podcast/defcon-20-slides.rss
to install it
$ sudo curl -L -o /etc/profile.d/ddl-rss-media.sh https://gist.github.com/4156364#file_gistfile1.sh
eg. usage to download all slides video of DefCon20
$ ddl-rss-media https://www.defcon.org/podcast/defcon-20-slides.rss
to install it
$ sudo curl -L -o /etc/profile.d/ddl-rss-media.sh https://gist.github.com/4156364#file_gistfile1.sh
This file contains 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
##### | |
## $ 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 | |
} |
No comments:
Post a Comment