17 lines
378 B
Bash
17 lines
378 B
Bash
#!/bin/sh
|
|
|
|
while read -r resource
|
|
do case "$resource" in
|
|
*.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
|
|
done | xargs tar c
|