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:
parent
5a28106714
commit
0ebb62c318
1 changed files with 13 additions and 0 deletions
13
podcast
Executable file
13
podcast
Executable 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
|
Loading…
Reference in a new issue