1
0

playlist package script

This commit is contained in:
dtb 2023-12-01 22:26:36 -07:00
parent c77ceae844
commit a85b27e5fc
2 changed files with 18 additions and 0 deletions

2
playlist/playlist Normal file
View File

@ -0,0 +1,2 @@
#!/bin/sh
argv0="$0"; shift; "$argv0"_"$0" "$@"

16
playlist/playlist_package Normal file
View File

@ -0,0 +1,16 @@
#!/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