Monday, July 12, 2010

Download the contents of a podcast (one liner)

I just had the need of a quick'n'dirty one liner for downloading the contents of a podcast. The xml file had over 100 entries and I didn't want to fetch them individually or use a dedicated program.

wget -q -O - http://something/podcast.xml | \
     grep "enclosure url"  | awk '{print $2}' | \
     sed 's/url=//' | xargs wget

This can definitely be squeezed down to something smaller and more elegant (you are welcome to do so) but that was not the objective. It just gets the job done.

No comments:

Post a Comment