Go back

Playing YouTube videos outside of YouTube

Date published: 2020-07-26 16:04:13 — Categories: Tech,Media

MPV has a really nice feature where it can stream video data directly from YouTube. What did I do? I decided to make a script to play YouTube videos for me.

Doing this is simple enough: mpv '<YouTube link>'. However, you can also specify a resolution using --ytdl-format: "bestvideo[ext=mp4][height<=?<res>]+bestaudio[ext=mp4]" where <res> is the desired resolution. This is a lot to type, so I implemented dmenu and some choices for resolutions: 1080, 720 and 480.

This was just a simple tip from me for you to not use the laggy browser version. I found this really useful for watching videos on older hardware. Combine it with newsboat and you have a really good alternative to browsing YouTube!