Jesus c6c8030907
All checks were successful
CI / test (push) Successful in 52s
feat: add Spanish README and improve channel/playlist handling
* Add complete Spanish translation (README.es.md)
* Restructure English README for clarity and conciseness
* Filter out YouTube Shorts from channel video listings (sort=4)
* Add fallback for video count using playlist metadata when API returns zero
* Add get_playlist_metadata() to fetch metadata without full video list
* Add is_short() utility to detect YouTube Shorts by duration, badges, and type
* Export is_short from yt_data_extract for use across modules
2026-04-12 20:20:32 -05:00
2021-09-14 12:51:05 -05:00
2026-04-05 17:43:01 -05:00
2021-07-08 14:52:54 -05:00
2019-01-06 18:20:29 -08:00
2026-04-05 17:43:01 -05:00
2026-04-05 17:43:01 -05:00
2018-07-12 04:27:16 -07:00
2026-03-22 14:17:23 -05:00
2025-03-01 04:58:31 +08:00
2026-04-05 14:56:51 -05:00

yt-local

A local YouTube client that runs on your machine. No ads, no JavaScript, with Tor support.

FeaturesInstallationUsageTorDevelopment


What is it?

yt-local is a local web server that acts as a proxy between your browser and YouTube. Pages load fast, without ads or tracking. Requests can optionally go through Tor.

It doesn't use the YouTube API. It makes the same requests the normal website would, minus all the rest.

Features

  • Anonymous browsing with optional Tor
  • No ads or JavaScript required
  • Three themes: light, gray, dark
  • Local playlists (videos aren't lost when YouTube removes them)
  • Subscription system independent from YouTube
  • Subtitle support
  • SponsorBlock segments skipped automatically
  • Qualities from 144p to 2160p with HLS support
  • Video download (disabled by default)
  • Comments load instantly, no lazy-loading

Installation

Linux / macOS

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python server.py

Windows

Download the zip from Releases and run run.bat.

With Make

make install   # Dependencies
make dev       # Server
make test      # Tests
make help      # All commands

Usage

The server starts at http://localhost:9010/

To watch a video, prefix the YouTube URL:

http://localhost:9010/https://www.youtube.com/watch?v=VIDEO_ID

Redirector

You can use a browser extension like Redirector to redirect YouTube automatically:

Field Value
Pattern `^(https?://(?:[a-zA-Z0-9_-]*.)?(?:youtube.com
Redirect to http://localhost:9010/$1
Mode Regular expression

Enable "Iframes" in advanced options so embedded videos work too.

Portable mode

Create an empty settings.txt file in the main directory. All settings and data will be stored there instead of ~/.yt-local.

Tor

Quick option: Tor Browser

Open Tor Browser and leave it running. In yt-local settings set "Route Tor" to "On, except video".

Standalone Tor

Debian/Ubuntu:

sudo apt install tor
sudo systemctl start tor

Change the Tor port to 9050 in settings.

Windows: Create a shortcut with: tor.exe SOCKSPort 9150 ControlPort 9151

Video routing through Tor

Set "Route Tor" to "On, including video". It's slower and consumes Tor bandwidth — consider donating to Tor nodes.

Import subscriptions

  1. Go to Google Takeout
  2. Select only "subscriptions" and download the CSV
  3. In yt-local, import the file from the subscriptions manager

Supported formats: Google Takeout CSV, NewPipe JSON, OPML, and old Google Takeout JSON.

Development

yt-local/
├── server.py              # Entry point, WSGI server
├── settings.py            # Configuration management
├── youtube/
│   ├── util.py            # Utility functions, Tor routing
│   ├── watch.py           # Video page
│   ├── channel.py         # Channel pages
│   ├── search.py          # Search
│   ├── subscriptions.py   # Subscriptions (SQLite)
│   ├── local_playlist.py  # Local playlists
│   ├── yt_data_extract/   # YouTube JSON parser
│   └── ...
├── tests/                 # Tests with pytest
└── docs/HACKING.md        # Development guide

Useful commands

make test              # Run tests
make lint              # Check style
make i18n-extract      # Extract strings
make i18n-init LANG_CODE=fr   # New language
make i18n-compile      # Compile translations

Python 3.8+ required. Code follows PEP 8. Commit messages should be descriptive.

Compatibility Notes

  • Python 3.8+: Minimum required version
  • HLS: Experimental streaming support for multi-audio videos
  • Channels with limitations: Some channels return few videos per response. This is YouTube behavior, not yt-local. The project uses YouTube's internal API (innertube), not the public YouTube API.

License

GNU AGPLv3 or later. See LICENSE.

Similar projects

Description
Repository yt-local
Readme 19 MiB
v0.4.5 Latest
2026-04-01 12:58:23 -04:00
Languages
JavaScript 41.4%
Python 38.9%
CSS 11.1%
HTML 7.8%
Makefile 0.8%