
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
youtube-po-token-generator
Advanced tools
It generates a valid poToken with visitorData fetched from YouTube.
This program outputs the mysterious pair { visitorData, poToken }, with the help of jsdom.
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.
# Install NodeJS >= 18.0 and issue the folling command to install this tool
npm install -g youtube-po-token-generator
# Execute the following command somewhere in your program or directly in a shell
youtube-po-token-generator
# => {"visitorData":"...","poToken":"..."}
# A string of JSON format would be printed to stdout, parse and use it as you like
Define proxy settings before you run the program If you are in the case that typically a proxy is needed to access YouTube.
export HTTPS_PROXY=http://127.0.0.1:8888
# For Windows users
# set HTTPS_PROXY=http://127.0.0.1:8888
youtube-po-token-generator
# Clone this repo and install dependencies
cd youtube-po-token-generator && yarn
# Or issue `npm install` instead of `yarn`, alternatively
generate is exported as the primary entry to execute the program.
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: '...' }
Inspect examples and bin/cli.mjs for simple examples.
This project is inspired by iv-org/youtube-trusted-session-generator.
Please refer to the excellent explanation here.
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.
FAQs
It generates a valid poToken with visitorData fetched from YouTube.
The npm package youtube-po-token-generator receives a total of 173 weekly downloads. As such, youtube-po-token-generator popularity was classified as not popular.
We found that youtube-po-token-generator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.