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