arthur-playlist

Que des bangers - retour accueil

git clone git://bebou.netlib.re/arthur-playlist
Log | Files | Refs |

update (852B)


      1 #! /bin/sh -ue
      2 
      3 in=$(mktemp);files=$(mktemp);todl=$(mktemp);links=$(mktemp);torm=$(mktemp)
      4 
      5 while IFS= read -r track
      6 do
      7 	id=$(echo "$track" | cut -f3)
      8 	title=$(echo "$track" | sed 's/	/ - /' | cut -f1)
      9 	if ls -1 ./* | grep -qE ".+${id:-todl}.+"
     10 	then
     11 		echo "nothing to do for track $track"
     12 	else
     13 		echo "something to do for track $track"
     14 		if [ ${1:-notluck} = "-l"  ]
     15 		then
     16 			id=$(ytgetvideos "$title" | head -n1 | cut -f1)
     17 		else
     18 			id=$(ytgetvideos "$title" | fzy | cut -f1)
     19 		fi
     20 		echo "$id"
     21 		yt-dlp -f bestaudio -- "$id"
     22 		escapedtrack=$(echo "$track" | sed -E 's/[]()+[]/\\&/g')
     23 		sed -Ei "/$escapedtrack/ s/^(.+	.+	).*(	.*)$/\1$id\2/" playlist.m3u
     24 	fi
     25 done < playlist.m3u
     26 
     27 #for track in $(sed 's/	/ - /' p | cut -f1)
     28 #do
     29 #	echo "Searching $track"
     30 #	ytgetvideos "$track" |
     31 #	fzy |
     32 #	cut -f1 |
     33 #	tee -a ids |
     34 #	xargs yt-dlp -f bestaudio
     35 #done