Skip to main content

syncs youtube for offline play

Project description

YouTube trusted session generator

This project is tested with BrowserStack.

Description

This script will output two parameters: po_token and visitor_data. Needed for passing YouTube checks in Invidious or the program 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 quay.io/invidious/youtube-trusted-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 quay.io/invidious/youtube-trusted-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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file youtube_trusted_session_generator-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for youtube_trusted_session_generator-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 17f58b635f0c781df13c1bc1ed1a80c0b561f82b1fce618532015486c8df426f
MD5 7183f859ad56873329e473b9d90ad8f4
BLAKE2b-256 d1ac2d45f0243e7882cb514c594936b0637dc8529872530f6b8e31a60f9e28a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page