youtube-par-cmd: add playlist title to m3u

This commit is contained in:
gutmet 2020-10-14 07:50:01 +02:00
parent ceeb17d78b
commit 4036b31f3a

View File

@ -8,6 +8,7 @@ playlistURL="$2"
playlistJSON=`youtube-dl "$playlistURL" --flat-playlist -J` playlistJSON=`youtube-dl "$playlistURL" --flat-playlist -J`
playlistTitle=`echo "$playlistJSON" | jq -r '.title'` playlistTitle=`echo "$playlistJSON" | jq -r '.title'`
playlistInfo="$playlistTitle"
output="$(mkdir "$playlistTitle")" output="$(mkdir "$playlistTitle")"
status=$? status=$?
@ -23,6 +24,7 @@ echo "$urls" | awk '{print "https://www.youtube.com/watch?v=" $0}' | xargs -n 1
m3uFile="Playlist - $playlistTitle"".m3u" m3uFile="Playlist - $playlistTitle"".m3u"
echo "#EXTM3U" > "$m3uFile" echo "#EXTM3U" > "$m3uFile"
echo "#PLAYLIST:$playlistInfo" >> "$m3uFile"
echo "$urls" | while read url; do echo "$urls" | while read url; do
find . -name "*$url*" -prune >> "$m3uFile" find . -name "*$url*" -prune >> "$m3uFile"
done done