run localvid init to create .desktop file and register the url scheme
then in your browser change the https in https://youtube.com/watch?v=<video_id> to localvid
if everything is set up correctly the youtube video should open in mpv
this is intended for linux
yt-dlp
mpv
id also recommend having modernz and sponsorblock for mpv to make the experience more enjoyable.