How grqz/yt-dlp-getpot-jsi works
This archived yt-dlp plugin generates YouTube PoTokens by extracting challenge data from a video request, running a bundled JavaScript interpreter in PhantomJS, and returning the minted token to yt-dlp. Its Python HTTP server supplies challenge and interpreter data and generates integrity-token responses; the JavaScript client uses those responses to snapshot the VM and mint tokens. The README describes the provider and PhantomJS requirements. Some JavaScript is excerpted only partially, so only visible endpoint relationships are shown.
Main entry points: fetch_pot.py POT Orchestration · server.py Local HTTP Server · ytpot_jsi.py PoToken Provider · script.py Script Assembly
Components 12
yt-dlp Provider
- PoToken Provider
py/yt_dlp_plugins/extractor/ytpot_jsi.py
Python Runtime
- POT Orchestration
py/yt_dlp_plugins/getpot_phantomjs/fetch_pot.py - Local HTTP Server
py/yt_dlp_plugins/getpot_phantomjs/server.py - Script Assembly
py/yt_dlp_plugins/getpot_phantomjs/script.py - PhantomJS Runner
py/yt_dlp_plugins/getpot_phantomjs/phantom_jsi.py
JavaScript Token Engine
- Bundled JS
- Phantom Page Wrapper
js/src/wrapper.cjs - Challenge and POT Logic
js/src/pot_http.es5.cjs
Integrity Service
- Challenge and IT
py/yt_dlp_plugins/getpot_phantomjs/utils.py
Other components
- yt-dlp
- Google Waa API
- PhantomJS
Connections 14
- yt-dlp → PoToken Provider: requests token
py/yt_dlp_plugins/extractor/ytpot_jsi.py - PoToken Provider → POT Orchestration: fetches POT
py/yt_dlp_plugins/extractor/ytpot_jsi.py - POT Orchestration → Local HTTP Server: starts server
py/yt_dlp_plugins/getpot_phantomjs/fetch_pot.py - POT Orchestration → Script Assembly: assembles script
py/yt_dlp_plugins/getpot_phantomjs/fetch_pot.py - POT Orchestration → PhantomJS Runner: executes script
py/yt_dlp_plugins/getpot_phantomjs/fetch_pot.py - Local HTTP Server → Challenge and IT: fetches challenge
py/yt_dlp_plugins/getpot_phantomjs/server.py - Local HTTP Server → Challenge and IT: generates integrity
py/yt_dlp_plugins/getpot_phantomjs/server.py - Challenge and IT → Google Waa API: calls Waa API
py/yt_dlp_plugins/getpot_phantomjs/utils.py - Script Assembly → Bundled JS: embeds JavaScript
py/yt_dlp_plugins/getpot_phantomjs/script.py - Script Assembly → Phantom Page Wrapper: wraps script
py/yt_dlp_plugins/getpot_phantomjs/script.py - PhantomJS Runner → PhantomJS: runs script
py/yt_dlp_plugins/getpot_phantomjs/phantom_jsi.py - Phantom Page Wrapper → Challenge and POT Logic: evaluates script
js/src/wrapper.cjs - Challenge and POT Logic → Local HTTP Server: posts /genit
js/src/pot_http.es5.cjs - PoToken Provider → yt-dlp: returns token
py/yt_dlp_plugins/extractor/ytpot_jsi.py