ADD podcast; very basic support for podcast

if your audio source has podcast, great news! this script will add
**BASIC** support for podcasts. It will just download the first audio it
finds in the xml.
This commit is contained in:
boyska 2019-11-04 00:29:44 +01:00
parent 5a28106714
commit 0ebb62c318

13
podcast Executable file
View file

@ -0,0 +1,13 @@
#!/bin/bash
set -eu
url="$(curl -s "$1" | \
xmlstarlet sel -T -N atom="http://www.w3.org/2005/Atom" \
-t -m '//atom:link[@rel="enclosure"]' -v @href -n | \
head -n 1 )"
test -z "$url" && exit 1
out="$(mktemp "--tmpdir=$TMPDIR" podcast-XXXXXXXX.ogg)"
trap 'rm -f "$out"' EXIT
wget -q "$url" -O "$out"
echo "file://$(realpath "$out")"
exit 0