zenUtils/podlist.sh

16 lines
496 B
Bash
Executable file

#!/bin/sh
# Derek Stevens <nilix@nilfm.cc>
# MIT license
# export PODLIST_DATA_DIR=/wherever/you/want in your shell startup
# and keep a .feeds file in it where each line looks like:
# podcast_name https://domain.com/path/to/rss/feed
while read l; do
set -- ${l}
tmpfile=$(mktemp)
wget -O ${tmpfile} $2
xmllint --xpath '/rss/channel/item/enclosure/@url' ${tmpfile} | sed -e 's/url=//g' -e 's/"//g' > ${PODLIST_DATA_DIR:-~}/${1}.m3u
rm ${tmpfile}
done < ${PODLIST_DATA_DIR:-~}/.feeds