Introduction
So, FreeTube is broken and you want to watch YouTube on your desktop without using the YouTube site or embed. If you have
mpv
installed and want to use that, this guide is for you.Getting YT Links to open in MPV
First, we need to set MPV as a video player in FreeTube. Since FreeTube has support for external players, this is what we will use.
- Open Settings
- Under External Player, select mpv from the dropdown list.
Below the dropdown is Custom External Player Arguments. Here are the recommended ones I use:
--fs
: Automatically opens the video in fullscreen.--ytdl-raw-options=format="(bestvideo[height<=X]+bestaudio/best)"
: Gets the best audio and best video and combines them. Video resolution is no larger than X. Example resolutions include 720, 1080, 1440, 2160. I personally use 720, but you use whatever your bandwith allows.Install Recommended MPV plugins
By itself, mpv is pretty barebones. It’s missing a few features that FreeTube has, such as sponsorblock or media controls. Below are the following plugins that solve these issues. I won’t include the install directions for these as these will differ for each distro, but the main installation point should be either
~/.config/mpv/scripts
(Current User) or/usr/share/mpv/scripts
(All Users).mpv-sponsorblock: https://github.com/TheCactusVert/mpv-sponsorblock
This Rust implementation of sponsorblock works well with MPV. A few things to note:
- Segments do not display on the timeline. However, automatic skipping does work.
- To edit what type of segments are skipped, follow the Configuration section in the repo, and edit your
sponsorblock.toml
file in~/.config/mpv
.Here is what I personally use:
# Categories: sponsor, selfpromo, interaction, poi_highlight, intro, outro, preview, music_offtopic, filler, exclusive_access categories = ["sponsor", "interaction", "music_offtopic"] # Action types: skip, mute, poi, full action_types = ["skip", "skip", "skip"]
mpv-mpris: https://github.com/hoyon/mpv-mpris
This plugin displays media controls for MPV on KDE Plasma and GNOME. By default, MPV lacks the MPRIS D-Bus interface used by programs such as
playerctl
to provide media controls and information.
mpv-mpris
has a package in the Arch repos (Extra). Note that this will install to/usr/share/mpv/scripts
instead.Setup Recommended Keyboard Shortcuts
MPV is looking pretty good now, however there are some small tweaks we can make to the default keyboard shortcuts. My main gripe with mpv is the UP/DOWN arrows are set to seek 1 minute and
*
and/
(Numpad) control volume. Let’s fix that.
Copy the default
input.conf
file for mpv to~/.config/mpv
. This file should be located in/usr/share/doc/mpv
, but depending on how you install mpv, this may differ.$ cp /usr/share/doc/mpv/input.conf ~/.config/mpv
Edit this file with your preferred text editor and add the following to the end:
UP add volume 2 # Increase volume by 2% DOWN add volume -2 # Decrease volume by 2%
This will rebind your UP/DOWN arrow keys to volume controls. Change the value to whatever your want. If you want to match FreeTube’s volume controls, set the values to
5
and-5
.Some additional shortcuts to know about for MPV:
d
: Show debug info (Similar to View Stats in YT)Menu
: Show the menu key. Useful for accessing playlist menu.
- Usually the Square with 3 horizontal lines in the middle.
- Some keyboards lack this button.
[
: Decrease video speed by 10%
- Use
Shift
to decrease by 50%]
: Increase video speed by 10%
- Use
Shift
to increase by 50%Backspace
: Reset video speed to 100%m
: Mute audioPage Up
: Go to next chapterPage Down
: Go to previous chapterq
: Quit MPV/Enter
: Play next video in playlist<
: Play previous video in playlist
- For these two, you need to press and hold
Shift
with them. The exception isEnter
.Wrap-Up
And thats the setup. I hope you enjoy this temporary setup until FreeTube gets fixed. It takes some time to setup, but once it is, you can use it anywhere. You can even use it with just
yt-dlp
if you want.This guide might work with Celluloid. I personally don’t use it, but you can try if you want to.
If there are any issues with this guide, let me know!
OC by @[email protected]
Nice, I’ve got a similar setup with Haruna.
I wish you could open in external player via right-click / hamburger from your feed …