summaryrefslogtreecommitdiff
path: root/pd
blob: 354991baf919b5a29876df621e339d41ea52ff71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

# pd -- download podcast episode(s)

u=
test "$1" = -u && u=1 # unix mode

eval curl -ZL "$(sed -n 's/^Title: \|File: //p' |
sed 's/	/ /g; s/\\/\\\\/g; '"s/'/'\"'\"'/g" |
paste - - |
while IFS='	' read title file; do
	test -z "$u" && title=`printf '%s\n' "$title" | sed 's/\\\\/./g; s,[/:*<>|],.,g; s/?//g; '"s/\"/'\"'\"'/g"` # dos/windows (default)
	printf "-o '%s' '%s' " "$title.${file##*.}" "$file"
done)"