Find a file
Fijxu c1417a6913
All checks were successful
Docker build image / build (push) Successful in 33s
add support to disable the key
2024-12-21 17:07:50 -03:00
.forgejo/workflows Push tokens to redis for Invidious 2024-10-12 02:01:45 -03:00
examples Init. 2024-08-06 10:03:42 +08:00
lib Fix path. 2024-08-06 11:24:58 +08:00
vendor Init. 2024-08-06 10:03:42 +08:00
Dockerfile fuck docker hub 2024-12-14 17:26:59 -03:00
index.js add support to disable the key 2024-12-21 17:07:50 -03:00
package.json use http instead of redis 2024-12-14 17:24:29 -03:00
README.md Init. 2024-08-06 10:03:42 +08:00
yarn.lock Init. 2024-08-06 10:03:42 +08:00

YouTube PoToken Generator

Introduction

This program outputs the mysterious pair { visitorData, poToken }, with the help of js-dom.

How it works

Only one network request is made to get a fresh copy of visitorData.

Then poToken is generated with pre-downloaded scripts from YouTube and some magic provided in lib/inject.js

No real browser is required to install.

How to use

yarn add youtube-po-token-generator
# Or
npm install youtube-po-token-generator

See examples for simple usages.

const { generate } = require('youtube-po-token-generator')

generate().then(console.log, console.error)
// => { visitorData: '...', poToken: '...' }

Require lib/task directly if you have already prepared your visitorData.

const { createTask } = require('youtube-po-token-generator/lib/task')

const visitorData = '...'

createTask(visitorData).then(task => task.start).then(console.log, console.error)
// => { poToken: '...' }

This project is inspired by https://github.com/iv-org/youtube-trusted-session-generator .

More

Debugging the source code from YouTube was a pain.

  • Pausing at key parts of the poToken generation may lead to misleading branches.

  • Modification on the injected code from botguardData.program may lead to invalid tokens.

  • Improper userAgent would lead to valid or invalid poToken being generated randomly, like a lottery.