Privacy-focused youtube workflow

It is getting increasingly difficult to access youtube in a privacy-friendly way.

Up until recently, I was using Freetube with an individous backend. This worked great…until it stopped working. Working public invidious instances are basically gone at this point. Anything that supports proxying video is completely gone.

So I was in search of a new solution. I tried a few things and I wanted to share my results in case they are useful to anyone else.

  • PlasmaTube
  • GrayJay
  • Pipeline(formerly tubefeeder)
  • Freetube with a VPN
  • Freetube with TOR
  • yt-dlp with TOR/VPN

PlasmaTube

PlasmaTube supports two ways of accessing yt content. Invidious and Piped. We already discussed Invidious and all the working Piped instances require login. So, basically, PlasmaTube isn’t capable of playing YT content at all.

GrayJay

GrayJay is a frontend that allows access to a variety of content platforms. It accesses youtube directly and doesn’t significantly increase privacy as far as I can tell. As of the time I tested it, it also had some blocking bugs.

Pipeline

Pipeline accesses YT content via Piped. As far as an out of the box solution, it is the only one I could find that actually worked. There are some significant issues though.

  • The interface is quite feature-free. If you are used to something like Freetube you are going to be disappointed.
  • If you have a lot of subscriptions it seems to make a ton of separate connections to Piped which almost always results in many failures.
  • When it plays the video, it pulls it straight from youtube so it is questionable how much privacy that actually offers.

Freetube with a VPN

Freetube supports using a proxy. I tested proxying connections via a proxy. Please note, as of 23.2, the token calls are not proxied. This has been fixed in the latest nightlies as of the time of this post.

This works, however, in my testing youtube blocks many VPN endpoints. Finding an unblocked IP was no fun.

Freetube with TOR

It is trivially easy to setup a TOR proxy using the Arch tor package. This works with a couple of significant caveats:

  • See the above note about tokens
  • Many TOR endpoints are blocked. It isn’t that hard to find one that isn’t but it can be annoying
  • Most TOR endpoints are slow. Most can handle 720p, some can handle up to 1440p but these can be hard to find.

yt-dlp with TOR/VPN

yt-dlp also supports using a proxy. This basically has the same considerations as using Freetube with TOR/VPN as above.

The only difference being that performance might not matter as much because you can download the file and play it after it completes so you won’t have streaming issues with high resolutions.


Currently, I am not happy with any of my options. The only really viable option I have found is using a proxy.

6 Likes

what about yt-fzf that opens in mpv for playing?
(I have tried 2-3 CLI music players but that one is my favorite).

But without a VPN you will always have an IP address that weill be seen me thinks..that sounds like your dealbreaker if I’m reading you right.

edit: PS–great write up.

1 Like

Yeah, exactly. It works, but it doesn’t add that much from a privacy perspective. Not really much different than using freetube without a proxy.

I’m not sure how consistent the IP blockage is by Youtube. Lately I have used FreeTube with VPN. It so happens that while one or two videos get “Your IP is blocked” or something similar, others play just fine. Sometimes, I can open the blocked video in MPV and it works. Other times no.

I am utterly disappointed at the demise of Invidious instances. At this point, I am evaluating how much privacy I am willing to give up for convenience. Or vice versa.

2 Likes

I appreciate YouTube trying to arm-bar me into submission about as much as one might expect. If the option is going to come down to using the native YouTube platform, or passing on content, well it’s a hard pass from me.

YouTube going for submission…
a wrestling match is going on in a ring with a referee in the background .

1 Like

@dalto
Could FreeTube be susceptible to fingerprinting by Youtube due to its reliance on Electron and Chromium?

I think there will continue to be problems as long as Google is on its quest to remove ad-blockers. They started that crap with the Androids and ruined them completely, Now they have moved on to youtube. They will just end up ruining it as well. I think until a actual viable competition comes we are just going to continue to suffer the mishaps of Googles Greed. I’ve even seen content creators complain about Google’s insistence of puttings ads into their content. Even as going so far as Google telling creators they will be adding more ads besides the ones the creators already have. See image below that was posted.
GmZRq97WUAACISe

I have never reviewed the code for Freetube but if it is just calling APIs it shouldn’t be.

1 Like

Thank you!
Is this relevant in this context: https://docs.freetubeapp.io/usage/local-api/
I have set it to Local API since Invidious is no longer.

While Freetube is still broken and is being fixed, and then when it is fixed and breaks again, to me and with my technical level, this seems to be an acceptable compromise.

A Librewolf webapp with isolated profile, Feedbro with YT channels subscriptions, UBO (configured to the point that video playback is not broken). If you have TOR running on your system, it can be set in the Librewolf’s Network Settings.

I am not sure how private this setup is and I am sure that it does not appeal to everyone, but as a fallback option, it works for me. At least the videos are watchable and can be watched inside Feedbro. And it doesn’t look that bad.

I have a script that uses yt-dlp to download the video and launches it in my media player as soon as it is downloaded. I have a hotkey for that script.

So I use freetube(which has all my subscriptions) and just copy the video link and hit my hotkey.

1 Like

That sounds like a great solution. But quite above my head to implement myself :neutral_face:
For now a “GUI app” as I have described will do the job. It’s not that bad.

Oh, may you provide this script? I am using yt-dlp for a long time manually copying the link to the terminal and afterwards I am opening the video with vlc. Your script and the hotkey would make this easier … :face_with_peeking_eye:

The script is below if you want try it. It pulls the URL from the clipboard.

Sure. I am not the original author. It is a modified version of a script someone posted on the forum a long time ago. You need install xclip if it isn’t already installed.

#!/usr/bin/env bash

# Directory for downloaded videos:
DL_DIR="$HOME/Downloads/yt"
mkdir -p $DL_DIR

# Video player:
#PLAYER="xdg-open"
PLAYER="/usr/bin/haruna"
#PLAYER="/usr/bin/smplayer"

# Downloader and options:
YTDL="/bin/yt-dlp"
YTDL_OPTS=(--no-playlist -S "res:1440" -N 5 --add-chapters --proxy socks5://127.0.0.1:9050/)
YTDL_DIR_OPTS=(-P "$DL_DIR")

set -e

CMD() {
  printf "[CMD]: "
  printf "\"%s\" " "$@"
  printf "\n"
  "$@"
}

# Get URL from clipboard if run without argument:
if [ -z "$1" ]; then
  URL="$(xclip -o -sel c)"
#  CMD qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory
else
  URL="$1"
fi

# Get video filename
printf "[URL]: %s\n" "$URL"
FILENAME=$("$YTDL" --get-filename "${YTDL_DIR_OPTS[@]}" "$URL")
printf "[FILE]: %s\n" "$FILENAME"

# Download video
CMD "$YTDL" "${YTDL_OPTS[@]}" "${YTDL_DIR_OPTS[@]}" "$URL"

# Play video
CMD "$PLAYER" "$FILENAME" >/dev/null 2>&1

You might want to remove the --proxy part if you aren’t using a proxy. Also, choose your preferred resolution, it is currently downloading 1440p.

5 Likes

Will this work on Wayland? I am currently switching back and forth between GNOME and KDE Plasma, both on Wayland.

I have never tested it. You might have to swap out xclip with wl-clipboard in that case.

1 Like

I was totally unaware of the existence of this package.I’ll give it a go. Maybe not tonight, it’s starting to get a bit late where I am. Thank you so much!

1 Like

Thank you very much! This will make it easier.

I have a version of this same script from the same user back in 2023, and prior version of it in 2021, although I modified it a bit for my use since my yt-dlp is one I git cloned from master so I won’t paste the whole script here as it will end up confusing for others passing through. I have it working in Wayland KDE with key binding too.

if you end up installing the wl-clipboard package you need to replace xclip -o -sel c to wl-paste in the script otherwise the script will error and stop on this line if you use wl-clipboard.

It should look like this

# Get URL from clipboard if run without argument:
if [ -z "$1" ]; then
  URL="$(wl-paste)"
else
  URL="$1"
fi
1 Like

@dalto @_Six

Thank you so much for sharing the script and the instructions! It works perfectly fine on GNOME Wayland. This is great!

2 Likes