Last active
October 13, 2015 06:48
-
-
Save abhishekkr/4156364 to your computer and use it in GitHub Desktop.
shell.func-download-all-media-from-RSS
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment