YouTube BotGuard PO token microservice for TypeType-Server
  • TypeScript 99%
  • Dockerfile 0.7%
  • Shell 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-19 10:18:42 +02:00
.github ci: route workflows to CI stack 2026-09-19 10:18:42 +02:00
LICENSES chore: update token dependencies 2026-07-10 11:37:01 +02:00
src feat: stream remote login session diagnostics 2026-09-13 17:48:46 +02:00
tests feat: stream remote login session diagnostics 2026-09-13 17:48:46 +02:00
.gitignore docs: refresh readme and contribution guide 2026-07-15 19:08:46 +02:00
biome.json chore: update Biome and align its configuration schema 2026-09-09 08:55:14 +02:00
bun.lock chore: update token runtime dependencies 2026-09-09 10:07:33 +02:00
CONTRIBUTING.md docs: document project programming preferences 2026-07-15 19:22:46 +02: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 fix: match token runner with Playwright dependencies 2026-09-10 23:31:50 +02:00
LICENSE docs: add README and MIT license 2026-03-12 09:53:43 +01:00
package.json chore: update token runtime dependencies 2026-09-09 10:07:33 +02:00
README.md docs: move AI transparency notice 2026-09-18 10:57:15 +02: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.3.14
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 /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.3.14
  • 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.