Skip to content

It generates a valid poToken with visitorData fetched from YouTube.

Notifications You must be signed in to change notification settings

catspeed-cc/youtube-po-token-generator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: '...' }

Related works

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.

About

It generates a valid poToken with visitorData fetched from YouTube.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%