use youtube-dl.
"youtube-dl -f m4a
https://link-to-video"
downloads the song as m4a (you can just use this unless your player only supports mp3)
if not use ffmpeg to convert.
"ffmpeg -i song-ripped-from-youtube.m4a song-ripped-from-youtube.mp3"
literally two commands and thats all the websites do anyways