summaryrefslogtreecommitdiff
path: root/pd
diff options
context:
space:
mode:
Diffstat (limited to 'pd')
-rwxr-xr-xpd6
1 files changed, 5 insertions, 1 deletions
diff --git a/pd b/pd
index b76f1d0..354991b 100755
--- a/pd
+++ b/pd
@@ -2,9 +2,13 @@
# 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" |
+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)"