yt-local

Configuration  
4 min read
 
yt-local
Icon

What is yt-local and Why would you want to install it?

yt-local is a browser-based client written in Python for watching YouTube anonymously and without the lag of the slow page used by YouTube. One of the primary features is that all requests are routed through Tor, except for the video file at googlevideo.com. Tor has high latency, so this will not be as fast network-wise as regular YouTube. However, using Tor is optional; when not routing through Tor, video pages may load faster than they do with YouTube’s page depending on your browser.


Icon

Installation

Make sure you have Python and pip installed on your system.

STEP 1

Go to your Downloads folder, open a terminal, and run this command:

git clone https://git.sr.ht/~heckyel/yt-local

or if you dont have git installed,

Then download latest release .tar.gz save it to your download’s folder extract it and rename it to: yt-local: heckyel's website

STEP 2

Commands to run in the Terminal. I’m on Windows, so I’ll be using PowerShell.
1.
cd yt-local
2.
python3 -m venv venv
or: virtualenv -p python3 venv
3.
.\venv\Scripts\activate
or: source venv/bin/activate
4.
pip install -r requirements.txt
5.
python server.py
6.
Open the link displayed in your terminal by holding ctrl and clicking:

http://127.0.0.1:9010/


Congratulations, you have now installed yt-local.


Launching yt-local after Installation

Now everytime you want to use yt-local you will need to go inside yt-local directory and run these two commands:
1.
.\venv\Scripts\activate
2.
python server.py


Open your browser:

http://127.0.0.1:9010/


STEP 3 Shortcut (OPTIONAL but Recommended)

We will create a Windows .bat shortcut so we don't have to manually enter those two commands from above, which will make it simpler to use.

If you downloaded or git cloned yt-local to a directory other than “DOWNLOADS”, then don’t forget to change the path to where yt-local is located.

Below is a shortcut to launch yt-local without needing to open the terminal every time you want to open up YouTube locally. Just create a new file yt-local.bat on your desktop, right-click, then edit and paste the command below, or simply download the .bat file.

@echo off

start /min firefox http://localhost:9010/

timeout /t 1.5 >nul

start /min powershell.exe -Command "Set-Location \"$env:userprofile\Downloads\yt-local\venv\Scripts\"; Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass; .\activate; pip install gevent; cd \"$env:userprofile\Downloads\yt-local\"; python server.py"

exit

yt-local.bat:


same script for Linux start-yt-local.sh
#!/bin/bash

source ~/Downloads/yt-local/venv/bin/activate
cd ~/Downloads/yt-local || exit
python server.py &

sleep 1.5

firefox http://localhost:9010/
chmod +x start-yt-local.sh
./start-yt-local.sh

STEP 4 Redirector (OPTIONAL but Recommended)

Donwload and Set up Redirector extension:

Chrome's Redirector Extension Chrome's Redirector Extension

Firefox's Redirector Extension Firefox's Redirector Extension

Edge's Redirector Extension Edge's Redirector Extension


To configure Redirector click on extension at the top bar of your browser and click on (edit redirects):

Description: redirect Youtube

Example URL: https://www.youtube.com/watch?v=eB6txyhHFF4

Include pattern: ^(https?://(?:[a-zA-Z0-9_-]*\.)?(?:youtube\.com|youtu\.be|youtube-nocookie\.com)/.*)

Redirect to: http://localhost:9010/$1

Pattern type: 🔵 Regular Expression

Pattern Description: yt-local redirect

Example result: http://localhost:9010/https://www.youtube.com/watch?v=eB6txyhHFF4


A fully configured Redirector for yt-local should look like this:

Step 5 TOR (very OPTIONAL) for privacy

What is Tor?

Tor, short for “The Onion Router,” is a privacy-focused network that aims to increase users’ anonymity online. It works by routing internet traffic through a series of encrypted relays, thus obscuring the origin and destination of the data.


Icon

Installing and Setting up Tor (on Windows)

Once in YT Local settings enable Route Tor: On, except video. Double check these networking settings and click save settings at the bottom of the page:

Don’t forget to turn Route Tor: Off if you are not using Tor.

Tor Browser

Download the Tor Browser if you haven’t done so already:
torproject.org

Once Installed navigate to the Tor browser’s directory Tor:
C:\Users\yourUsername\Desktop\Tor Browser\Browser\TorBrowser\Tor

Open a terminal and run this command:

.\tor.exe SOCKSPort 9050 ControlPort 9151 | more

Once you run this command, you should see it running in Task Manager as tor.exe.

Browser’s proxy configuration

Now open your browser settings (mine is Firefox) and search for proxy settings (It’s the last option under Network Settings in Firefox. Configure how Firefox connects to the internet).

  1. click on Settings… (Under Network Settings in Firefox)
  2. Choose 🔵 Manual proxy configuration
  3. SOCKS Host:  127.0.0.1 or localhost     Port: 9050
  4. Select 🔵 SOCKS v5
  5. click OK

You can double check that you correctly applied proxy settings by checking the public ip address of your browser by navigating to:

ip chicken

or

ifconfig.me

and curl ifconfig.me command from your terminal. The IP address should be different for your configured browser.

(Don’t forget to disable the proxy setting in your browser if you’re not using Tor; otherwise, normal website pages will not load.)


Conclusion

yt-local offers a unique way to watch YouTube anonymously and without the typical lag. By routing requests through Tor and hosting videos locally, it provides a faster and more private YouTube experience. With the added convenience of a Windows shortcut and browser redirector extension, accessing your locally hosted YouTube becomes even more seamless.