Download files linked in a RSS feed

curl $1 | grep -E "http.*\.mp3" | sed "s/.*\(http.*\.mp3\).*/\1/" | xargs wget
The difference between the original version provided and this one is that this one works rather than outputting a wget error

3
By: theodric
2015-09-17 13:19:53

5 Alternatives + Submit Alt

  • Neither of the others worked for me. This does.


    1
    curl http://url/rss | grep -o '<enclosure url="[^"]*' | grep -o '[^"]*$' | xargs wget -c
    dakira · 2016-05-29 12:07:21 4
  • This script can be used to download enclosed files from a RSS feed. For example, it can be used to download mp3 files from a podcasts RSS feed. Show Sample Output


    0
    wget -q -O- http://example-podcast-feed.com/rss | grep -o "<enclosure[ -~][^>]*" | grep -o "http://[ -~][^\"]*" | xargs wget -c
    talha131 · 2013-09-24 12:38:08 5
  • Just added a little url encoding with sed - urls with spaces don't work well - this also works against instead of enclosure and adds a sample to show that you can filter against links at a certain domain Show Sample Output


    0
    wget -q -O- http://www.yourfeed.com/rss | grep -o "<link[ -~][^>]*" | grep -o "http://www.myfeed.com[ -~][^\"]*" | sed "s: :%20:g" | xargs wget -c
    dermidgen · 2015-10-30 22:13:43 9

  • 0
    wget `curl -s <podcast feed URL> | grep -o 'https*://[^"]*mp3' | head -1`
    tbon3r · 2017-07-16 23:02:03 3
  • Directly download all mp3 files of the desired podcast


    0
    curl http://radiofrance-podcast.net/podcast09/rss_14726.xml | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*mp3" | sort -u | xargs wget
    pascalv · 2021-08-09 13:40:26 40

What Others Think

Both regexes assume that there is only one matching link per line. If that's the case then change "grep -E" to "grep -oE" and you can drop the sed clause entirely. . grep -o, --only-matching Print only the matched (non-empty) parts of a matching line, with each such part on a separate output line.
flatcap · 313 weeks and 6 days ago
Your site is truly cool and your article gives me lots http://www.bangalore-escort.in/ of information too.
Reshmi12 · 6 weeks ago
It has never been easy to buy cannabis online. Especially the high-quality strains that can be used by an adult. We also offer discrete and overnight shipping to most countries across the globe. CONTACT DETAILS  Website... https://legalpsychedelic-store.com/ Email... legalpsychedelicstore@gmail.com Whatsapp....+12135339726 mdma pills for sale Buy DMT Online BUY MDMA Crystal ONLINE LSD FOR SALE. liberty caps for sale buy golden teacher mushrooms Buy ketamine powder online BUY 5-MeO-DMT ONLINE
lobe123 · 5 weeks and 6 days ago
It has never been easy to buy cannabis online. Especially the high-quality strains that can be used by an adult. We also offer discrete and overnight shipping to most countries across the globe. CONTACT DETAILS  Website... https://legalpsychedelic-store.com/ Email... legalpsychedelicstore@gmail.com Whatsapp....+12135339726 mdma pills for sale Buy DMT Online pure mdma crystal LSD FOR SALE. liberty caps golden teacher mushrooms Buy ketamine powder BUY 5-MeO-DMT Lsd for sale  Buy legal psychedelics buy magic mushrooms online buy magic mushrooms online buy lsd online Buy legal psychedelics
lobe123 · 3 weeks and 6 days ago
It has never been easy to buy cannabis online. Especially the high-quality strains that can be used by an adult. We also offer discrete and overnight shipping to most countries across the globe. CONTACT DETAILS  Website... https://legalpsychedelic-store.com/ Email... legalpsychedelicstore@gmail.com Whatsapp....+12135339726 mdma pills for sale Buy DMT Online pure mdma crystal LSD FOR SALE. liberty caps golden teacher mushrooms Buy ketamine powder BUY 5-MeO-DMT Lsd for sale  Buy legal psychedelics buy magic mushrooms online buy magic mushrooms online buy lsd online Buy legal psychedelics
lobe123 · 3 weeks and 6 days ago
It has never been easy to buy cannabis online. Especially the high-quality strains that can be used by an adult. We also offer discrete and overnight shipping to most countries across the globe. CONTACT DETAILS  Website... https://legalpsychedelic-store.com/ Email... legalpsychedelicstore@gmail.com Whatsapp....+12135339726 mdma pills for sale Buy DMT Online pure mdma crystal LSD FOR SALE. liberty caps golden teacher mushrooms Buy ketamine powder BUY 5-MeO-DMT Lsd for sale  Buy legal psychedelics buy magic mushrooms online buy magic mushrooms online buy lsd online Buy legal psychedelics
lobe123 · 3 weeks and 6 days ago
It has never been easy to buy cannabis online. Especially the high-quality strains that can be used by an adult. We also offer discrete and overnight shipping to most countries across the globe. CONTACT DETAILS  Website... https://legalpsychedelic-store.com/ Email... legalpsychedelicstore@gmail.com Whatsapp....+12135339726 mdma pills for sale Buy DMT Online pure mdma crystal LSD FOR SALE. liberty caps golden teacher mushrooms Buy ketamine powder BUY 5-MeO-DMT Lsd for sale  Buy legal psychedelics buy magic mushrooms online buy magic mushrooms online buy lsd online Buy legal psychedelics
lobe123 · 3 weeks and 6 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: