Re: What are some of the best music players?
Reply #1 –
I will add. I have used mpv
https://mpv.io
#!/bin/bash
# Sanitize input for mpv
echo "Enter a YouTube URL"
read varname
if [[ $varname =~ .*start_radio.* ]]; then
echo "That is NOT a supported URL"
exit 1
fi
if [[ $varname =~ .*www.youtube.com/watch.* ]]; then
echo "YouTube.com Link"
result=$(sed -e 's/\(watch\).*\(list\)/\playlist?list/' <<< "$varname")
myResult=$(sed "s/\&index.*//" <<< $result)
echo $myResult
mpv.exe "$myResult"
elif [[ $varname =~ .*https://music* ]]; then
echo "YouTube Music"
replace=$(sed -e "s/\music/www/g" <<< $varname)
echo $replace
myResult=$(sed "s/\&.*//" <<< $replace)
echo $myResult
mpv.exe $myResult
elif [[ $varname =~ .*youtu.be.* ]]; then
echo "Youtu.be Link"
mpv.exe "$varname"
elif [[ $varname =~ .*www.youtube.com/playlist* ]]; then
mpv.exe "$varname"
else
echo "That is NOT a supported URL"
fi
This is an mpv sanitize script to play youtube playlists and things from youtube music.