cleaned up startmpv

This commit is contained in:
Alexander Bocken 2020-09-20 18:48:31 +02:00
parent 3c2318301c
commit 56561a7618
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8

View File

@ -10,7 +10,7 @@ if echo "$1" | grep -qE 'youtube.*list'; then
playlist_id="$( echo "$1" | perl -pe "s|^.*?(\?\|&)list=(.*?)|\2|; s|&index=[0-9]+||" )" playlist_id="$( echo "$1" | perl -pe "s|^.*?(\?\|&)list=(.*?)|\2|; s|&index=[0-9]+||" )"
echo PL_id:$playlist_id echo PL_id:$playlist_id
notify-send "startmpv" "Searching for all videos in playlist..." notify-send "startmpv" "Searching for all videos in playlist..."
npm start --prefix "$js_playlist_index_loc" -- --api-key "$API_key" --playlist-id $playlist_id | xargs -L1 echo 'https://www.youtube.com/watch?v=' | sed 's/ //' | xargs mpv || notify-send "startmpv" "An error has occured with playlist $playlist_id" npm start --prefix "$js_playlist_index_loc" -- --api-key "$API_key" --playlist-id $playlist_id | sed 's/^/https:\/\/www.youtube.com\/watch?v=/' | xargs mpv || notify-send "startmpv" "An error has occured with playlist $playlist_id"
else else
mpv "$1" mpv "$1"
fi fi