diff options
author | John Ankarström <john@ankarstrom.se> | 2020-12-03 05:08:30 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2020-12-03 05:10:51 +0100 |
commit | b62fc8acc683aaaa7ae24552ed5b5129378318ad (patch) | |
tree | 539bf638608b58a5c4493e990a849f311ec23011 | |
parent | 7389fdf0e7944027c89f81fe3c2b961cafb7f99c (diff) | |
download | pc-b62fc8acc683aaaa7ae24552ed5b5129378318ad.tar.gz |
pd: Fix escaping, add DOS/Windows support
-rwxr-xr-x | pd | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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)" |