If you have any sense of privacy, you know better than to use Google’s official Youtube clients - not to mention, they’re really kind of terrible.
To view Youtube video comfortably and limit Google’s privacy invasions, the main third-party clients are:
- NewPipe and derivatives (Android)
- Grayjay (Android)
- Freetube (Desktop)
- Grayjay desktop - x64 only (Desktop)
Unfortunately, if you’ve been using those third-party clients for a long time, you know Google plays a game of cat and mouse with them, to discourage users from using them:
- Google breaks something or other (usually the player API) or Google blocks your IP because it detects a non-Google player.
- The developers of those clients play catch-up, make their clients work again for a while.
- Google breaks them again. Rinse. Repeat.
And Google now having free rein to be as abusive as they want under the Trump regime, it’s not getting any better ☹️
The developers who react most quickly to Google’s shenanigans are the FUTO developers behind Grayjay: when Google breaks it, usually they have a fix within hours, if not less. And there’s a reason for that: they’re paid to do it. Incidentally, I encourage you to purchase a FUTO license: it’s money well spent to encourage FUTO. They’ve really earned it.
The Newpipe developers are also fairly quick to fix their client. Not always, but they do a pretty decent job.
Freetube however can take many days to get fixed. For instance, the native Freetube player is currently broken and it’s been broken for a week.
When Google plays with everybody’s balls, if you’re on mobile, at least Grayjay will almost always get the job done, so you don’t have to compromise your privacy and hit the official client.
On the desktop however, unless you have an ARM64 machine and you use Grayjay as a desktop app in Waydroid - which is a totally valid solution that works great, in case you didn’t know [EDIT: this is incorrect: there is in fact an x64 Grayjay desktop client - Thanks @portnull@lemmy.dbzer0.com], Freetube will sadly let you down regularly for a long time.
The official workaround recommended by the Freetube developers when Google breaks their player is to use an external player. But there are two problems with that:
- If you don’t use the right external players - which Google likely broke too - or the player isn’t configured to use the latest and greatest Google evasion code, it’s not going to work.
- When spawning Freetube with a URL (typically by LibRedirect from your browser), Freetube ignores the external player and tries to play the video with its broken internal player anyway. You can always manually tell it to use the external player after it’s failed trying to play the video itself, but it’s an extra step, and you end up running both Freetube and the external player just to view a Youtube video from a website.
So I figured I’d post a little guide on how to setup an external video player that works with Freetube (and gets fixed quickly when Google breaks it) and how to spawn it directly from your browser to view a video and bypass LibRedirect / Freetube entirely.
This little guide is mostly for Linux. If you’re not running Linux, the principle should be the same, but the details of how to make this work are different of course.
So the player you need is SMPlayer. SMPlayer is a great mpv player frontend in its own right. Don’t worry, both mpv and SMPlayer are usually available in most distros, so you can install it normally with your favorite package manager.
But the thing that makes SMPlayer great is, to play Youtube video, it can use yt-dlp as a backend to fetch the video from Youtube:
And it turns out, the developers of yt-dlp are usually very quick to unfuck Google’s fuckeries and make it work again. Almost as quick as FUTO’s developers: when Google breaks things, yt-dlp is usually one of the first Youtube clients to start working again.
The problem is, the version of yt-dlp that comes in most distributions is usually hopelessly behind, so it won’t work with your distro’s official package.
To use the latest and greatest yt-dlp with SMPlayer, you need to use the version in the Github repo. To do this:
- Clone the repo (for example in your home directory):
git clone --recurse-submodules https://github.com/yt-dlp/yt-dlp.git
- Make yt-dlp available in your PATH:
ln -s ~/yt-dlp/yt-dlp.sh ~/.local/bin/yt-dlp
Then if you invoke yt-dlp
from any directory, it should start it correctly:
$ yt-dlp
Usage: yt-dlp [OPTIONS] URL [URL...]
yt-dlp: error: You must provide at least one URL.
Type yt-dlp --help to see a list of all options.
Then you can try if SMPlayer now plays a Youtube video correctly: smplayer https://youtu.be/jNQXAC9IVRw
Finally, configure Freetube to use SMPlayer as an external player:
Now try to play a video from Freetube: it should open SMPlayer and SMPlayer should play the video correctly.
When Google breaks yt-dlp again, simply go into the repo and do a git pull --recurse-submodules
. Do this regularly until the yt-dlp folks work their magic and fix it, which should happen a lot quicker than fixing the internal Freetube player.
Finally, how to spawn SMPlayer directly from the browser:
- Install the RunWith browser extension: this little thing is a simple tool to spawn an external program from the browser and it’s really underrated. Not terribly user-friendly to install but it does the job fine.
- In the RunWith extension preferences, configure RunWith like so:
Then if you right-click on a Youtube video link, you’ll get an option in the context menu to open it with SMPlayer through RunWith:
I hope this helps 🙂
PeerTube is much easier.
Just so you know, if you like freetube, you can configure the external player to mpv, which underneath uses yt-dlp when streaming, and use the button to load the external player. Of course one can also launch smplayer, which underneath is using mpv, which underneath…
But the thing is content creators don’t move out of YT cause they’re there to monetize in the first place. So this thing seems never ending no matter alternatives like peertube exist.
Very thought out write-up! I generally use Freetube, as I’m primarily a desktop user, but since it’s been down, I learned how to use yt-dlp, and picked up some GUIs that sit on it to try out. It’s been a little surreal watching everything as a self contained file, but almost nostalgic in a way too.
That said, I look forward to when things get patched up on the Freetube front.
It’s been a little surreal watching everything as a self contained file
Yes the main .py is quite a pile of code 🙂
It’s one of those projects that grew organically and never got reorganized. I maintain a niche open-source project like that that has a few dozen kilobyte main Python file and I’m ashamed of it. But then it’s so niche I don’t really want to spend the time reorganizing it.
yt-dlp would benefit from that though…
shill
I encourage you to purchase a FUTO license: it’s money well spent to encourage FUTO. They’ve really earned it.
You should stop promoting FUTO’s proprietary software. It is also against community rules.
Yeah, this is community rule 2. I’ll leave this up, but please refrain in the future, @ExtremeDullard@piefed.social.
Wait… Grayjay is open source tho?
It is source available, not open source.
Unwatched a good client for ios
Thanks for that - the Freetube/SMPlayer part worked for me!
What is the full content of the Target URLs field for RunWith? Trying to get that bit working now. Thanks :)
Thanks for the suggestion to use sm-player via freetube with youtube-dl – It’s been frustrating recently trying to watch the odd video on youtube (which is essentially a monopoly if you ask me).
Great write up, thanks. But I use grayjay desktop on an x64 machine. There’s definitely a desktop app for itoutaode of ARM devices.
I wasn’t aware there was a x64 Grayjay desktop app. I’ll check it out. thanks!
should’ve added a link https://gitlab.futo.org/videostreaming/Grayjay.Desktop
It’s also on Flathub
It’s also on the AUR
Thank you for the recommendation. I have been wanting to try out the FUTO apps (which grayjay) for a while but couldn’t find it on f-droid. It looks like they have their own repo which you need to add.
Just got grayjay downloaded and it is so good!
Grayjay is really much more than a YouTube frontend. It’s a cross-platform video player, which I find is the only way to watch PeerTube videos! Outside of PieFed! And I think is really the best way to end YTs reign.
Although I wish there was a web client…
Peertube is also (well hidden) integrated to NewPipe and its forks. In the left menu, tap YouTube to find all supported platforms.
For Android TV there is the SmartTube client and somehow I always find that one working fine while the rest are struggling
I wonder if Grayjay would work on Android TV…
It does but the UI is terrible for TV. It’s totally unusable without an external keyboard and mouse.
SmartTube doesn’t do local subscriptions, and that’s a big no-no for me.
It does. I use it all the time while logged out.
Really? Last I tried it - not very long ago - it refused to do anything without an account.
It’s not a feature I use, but I just tested it in the latest beta release and it worked fine.
Really.
Personally, I use ironfox+unlock+VPN. If it (rarely) breaks, all I have to do is change my vpns exit location.
Thanks
I use FreeTube since time with the SMplayer, or using direct the SMplayer, entering the Video URL. SMplayer is a Gem. It works also in Windows in a similar way, described in your great post, not only in Linux, setting SMplayer as extern player in FreeTube and when FreeTube won’t play the Video in the list, clicking on the little square icon at the bottom left of the video thumbnail and it will open in the SMplayer. except few times in Videos with special protections, these can be watched only in YouTube itself, luckily only few.
Please correct me if I’m wrong but to be really private with yt-dlp you need to use a Proxy no? At least SMPlayer have a option to do it.
without a proxy google can still connect your watching habits to you by IP, and see how often you pause or rewind, but at least they can’t feed you with garbage you don’t need and can’t fingerprint your client and how you move your mouse.