Browse Source

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.
boyska 4 years ago
parent
commit
0ebb62c318
1 changed files with 13 additions and 0 deletions
  1. 13 0
      podcast

+ 13 - 0
podcast

@@ -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