YouTube BotGuard PO token microservice for TypeType-Server
  • TypeScript 99.3%
  • Dockerfile 0.5%
  • Shell 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-11 09:20:16 +01:00
.github ci: run Bun 1.4.4 like the Docker image 2026-11-07 10:41:31 +01:00
.woodpecker ci: run Bun 1.4.4 like the Docker image 2026-11-07 10:41:31 +01:00
LICENSES chore: update token dependencies 2026-07-10 11:37:01 +02:00
src fix: call the WAA challenge API in its protobuf JSON format 2026-11-05 20:11:00 +01:00
tests fix: call the WAA challenge API in its protobuf JSON format 2026-11-05 20:11:00 +01:00
.gitignore docs: refresh readme and contribution guide 2026-07-15 19:08:46 +02:00
biome.json chore: update token dependencies and Node base 2026-10-25 09:24:13 +00:00
bun.lock build: update dependencies and the Playwright image to 1.65 2026-11-11 09:20:16 +01:00
CONTRIBUTING.md docs: ask for Bun 1.4.4 2026-11-07 10:51:05 +01:00
docker-compose.yml fix: recover YouTube player admission 2026-07-18 19:47:09 +02:00
docker-entrypoint.sh fix: restart xvfb cleanly in token image 2026-07-12 14:35:48 +02:00
Dockerfile build: update dependencies and the Playwright image to 1.65 2026-11-11 09:20:16 +01:00
LICENSE docs: add README and MIT license 2026-03-12 09:53:43 +01:00
package.json build: update dependencies and the Playwright image to 1.65 2026-11-11 09:20:16 +01:00
README.md docs: ask for Bun 1.4.4 2026-11-07 10:51:05 +01:00
THIRD_PARTY_NOTICES.md chore: refresh token runtime 2026-07-29 15:43:54 +02:00
tsconfig.json chore: separate TypeScript 7 production type checks 2026-08-22 17:35:24 +02:00
tsconfig.tests.json chore: separate TypeScript 7 production type checks 2026-08-22 17:35:24 +02:00

TypeType

TypeType Token

YouTube token, decoder, and session service for TypeType-Server.

You want to know the current position of TypeType about AI ? Go check this.

TypeType-Token is an internal Bun service used exclusively by TypeType-Server. It handles YouTube Proof-of-Origin tokens, player decoding, SABR session metadata, subtitles, and disposable remote-login browser sessions.

The frontend never calls this service directly. If you want to run TypeType, use the central stack instead of exposing this service as a public API.

Responsibilities

  • Fetch YouTube visitor data and BotGuard challenges
  • Generate visitor-bound and video-bound PO tokens
  • Decode YouTube player signatures and throttling parameters locally
  • Return WEB and MWEB SABR session metadata to TypeType-Server
  • Resolve subtitle tracks with the required token data
  • Manage authenticated, disposable YouTube remote-login sessions

TypeType does not rely on third-party decoder endpoints. Player decoding stays on the TypeType-owned service path.

Stack

Role Technology
Runtime and package manager Bun 1.4.4
HTTP server Bun.serve()
Browser runtime Playwright Chromium
Cache In-memory BotGuard and token state
Tests bun:test
Lint and format Biome

Internal API

Method Path Purpose
GET /health Service health
GET /ready Token readiness, 503 until the BotGuard session and TV token are warm
GET /version Build information
GET /potoken?videoId=<id> PO token data for a YouTube video
GET /subtitles?videoId=<id> Subtitle track metadata
GET /youtube/sabr/session?videoId=<id>&client=MWEB WEB or MWEB SABR session metadata
POST /youtube/player/decoder Batch player URL decoding

Remote-login routes are disabled unless configured by the TypeType stack. They require a shared internal token and are intended only for the Server-to-Token connection.

Development

Requirements:

  • Bun 1.4.4
  • A Playwright-compatible Chromium installation for live token and login flows
bun install --frozen-lockfile
bun run start

The service listens on http://localhost:8081.

Checks

bun run lint
bun test
bun run build

Read CONTRIBUTING.md before opening a pull request. Bug reports and feature requests belong in the central issue tracker.

  • TypeType-Server consumes the internal service API.
  • PipePipe and PipePipeExtractor are the external behavioral references for YouTube extraction and SABR behavior.
  • BgUtils provides compatibility types used by the BotGuard integration.

License

TypeType-Token is licensed under the MIT License. Dependency notices are listed in THIRD_PARTY_NOTICES.md.