youtube: create .m3u for playlists instead of title dump
This commit is contained in:
parent
b5e168b0fe
commit
b5542893b4
|
@ -8,5 +8,14 @@ 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'`
|
||||||
echo "$playlistJSON" | jq -r '.entries[].title' >> "Playlist - $playlistTitle"".txt"
|
mkdir "$playlistTitle"
|
||||||
echo "$playlistJSON" | jq -r '.entries[].url' | awk '{print "https://www.youtube.com/watch?v=" $0}' | xargs -n 1 -P 10 "$cmd"
|
cd "$playlistTitle"
|
||||||
|
|
||||||
|
urls=`echo "$playlistJSON" | jq -r '.entries[].url'`
|
||||||
|
echo "$urls" | awk '{print "https://www.youtube.com/watch?v=" $0}' | xargs -n 1 -P 10 "$cmd"
|
||||||
|
|
||||||
|
M3Ufile="Playlist - $playlistTitle"".m3u"
|
||||||
|
echo "#EXTM3U" > "$M3Ufile"
|
||||||
|
echo "$urls" | while read url; do
|
||||||
|
find . -name "*$url*" -prune >> "$M3Ufile"
|
||||||
|
done
|
||||||
|
|
Loading…
Reference in New Issue
Block a user