more robust remote handling
This commit is contained in:
parent
a85b27e5fc
commit
5c5d977b77
@ -2,14 +2,22 @@
|
||||
|
||||
while read -r resource
|
||||
do case "$resource" in
|
||||
*.m3u) "$0" "$resource" >"$resource".tar
|
||||
*://*) case "$resource" in # remote
|
||||
*.m3u) file="$(curl -LO -w '%{filename_effective}' \
|
||||
"$resource")"
|
||||
"$0" <"$file" >"$file".tar
|
||||
printf '%s.tar\n' "$file"
|
||||
;;
|
||||
*) youtube-dl -f bestaudio "$resource" --id \
|
||||
&& youtube-dl --get-id "$resource" \
|
||||
| xargs printf '%s.*\n' \
|
||||
|| curl -LO -w '%{filename_effective}' \
|
||||
"$resource"
|
||||
;;
|
||||
esac ;;
|
||||
*.m3u) "$0" <"$resource" >"$resource".tar
|
||||
printf '%s.tar\n' "$resource"
|
||||
;;
|
||||
*://*) youtube-dl -f bestaudio "$resource" --id \
|
||||
&& youtube-dl --get-id "$resource" \
|
||||
| xargs printf '%s.*\n' \
|
||||
|| curl -LO -w '%{filename_effective}' "$resource"
|
||||
;;
|
||||
*) printf '%s\n' "$resource"
|
||||
;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user