2
0
Fork
You've already forked yt-session-generator
0
This is a generator for getting a session that passes all the checks from YouTube side
  • Python 90.8%
  • Shell 4.9%
  • Dockerfile 4.3%
2025年03月19日 23:21:17 +06:00
.github/workflows github/workflows: context ≠ file, oops 2025年03月19日 23:13:14 +06:00
docker/scripts Add HTTP webserver interface ( #6 ) 2024年11月17日 15:52:07 +01:00
potoken_generator reduce refresh time to 5min in webserver mode 2024年11月18日 22:14:06 +01:00
.gitignore push working script 2024年07月12日 00:49:34 +02:00
Dockerfile fixing location for patching 2024年11月17日 23:54:11 +01:00
Dockerfile.webserver github/workflows: fix the build workflow 2025年03月19日 23:11:36 +06:00
LICENSE Add LICENSE 2024年07月12日 00:55:14 +02:00
potoken-generator.py Add HTTP webserver interface ( #6 ) 2024年11月17日 15:52:07 +01:00
README.md readme: update links & add a link to original repo 2025年03月19日 23:21:17 +06:00
requirements.txt fix #15 2024年11月17日 15:08:19 +01:00

YouTube trusted session generator

Forked from iv-org/youtube-trusted-session-generator.

This script will output two parameters: po_token and visitor_data. Needed for passing YouTube checks in cobalt, Invidious or other tools that use the po_token functionality.

What's po_token

po_token known as Proof of Origin Token. This is an attestation token generated by a complex anti robot verification system created by Google named BotGuard/DroidGuard. It is used to confirm that the request is coming from a genuine device.

These identity tokens (po_token and visitor_data) generated using this tool will make your entire YouTube session more easily traceable by YouTube because it is tied to a unique identifier.

Requirement(s)

  • You have to run this command on the same public IP address as the one blocked by YouTube. Not necessarily the same machine, just the same public IP address. Subsequent usage of this same token will work on the same IP range or even the same ASN. The point is to generate this token on a blocked IP as "unblocked" IP addresses seems to not generate a token valid for passing the checks on a blocked IP.

Tutorials for "oneshot" command: run the program and get the po_token and visitor_data values

Tutorial with Docker

  1. Run the script: docker run ghcr.io/imputnet/yt-session-generator
  2. Copy paste the values of these the two parameters (po_token and visitor_data) in config.yaml
    po_token: XXX
    visitor_data: XXX
    
  3. Restart Invidious or the program that use the po_token functionality.

Tutorial without Docker

  1. Install Chromium or Google Chrome.
  2. Create a new virtualenv: virtualenv venv
  3. Activate the virtualenv: source venv/bin/activate
  4. Install the dependencies: pip install -r requirements.txt
  5. Run the script: python potoken-generator.py --oneshot
  6. Copy paste the values of these the two parameters (po_token and visitor_data) in config.yaml
    po_token: XXX
    visitor_data: XXX
    
  7. Restart Invidious or the program that use the po_token functionality.

Why running as root for Docker?

In "headless: false", Chromium does not support sanboxing when it is not ran by root user.

Tutorials for "always running" program: Get po_token on demand using HTTP.

Tutorial with Docker

Run the program: docker run -p 8080:8080 ghcr.io/imputnet/yt-session-generator:webserver

Tutorial without Docker

  1. Install Chromium or Google Chrome.
  2. Create a new virtualenv: virtualenv venv
  3. Activate the virtualenv: source venv/bin/activate
  4. Install the dependencies: pip install -r requirements.txt
  5. Run the program: python potoken-generator.py

Usage of the HTTP API

Send your requests to http://localhost:8080/token in order to obtain your po_token.

You can also force refresh the po_token in the cache by sending a request to http://localhost:8080/update.