You probably shouldn’t be using this any more, mpv as of version 0.7 can directly make use of youtube-dl with the --ytdl
option (enabled by default in 0.7.2)
You can configure what formats mpv will play with the --ytdl-format
option, something similar to this script can be achieved with
--ytdl-format=303+bestaudio[ext=webm]/299+bestaudio/248+bestaudio[ext=webm]/137+bestaudio/302+bestaudio[ext=webm]/298+bestaudio/22/244+bestaudio[ext=webm]/135+bestaudio/18/best
This will also prefer 60fps content over normal versions of the videos and vp9 over h264, see https://en.wikipedia.org/wiki/Youtube#Quality_and_formats