Skip to content

Repository files navigation

TypeType

TypeType Token

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

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

RoleTechnology
Runtime and package managerBun 1.3.14
HTTP serverBun.serve()
Browser runtimePlaywright Chromium
CacheIn-memory BotGuard and token state
Testsbun:test
Lint and formatBiome

Internal API

MethodPathPurpose
GET/healthService health
GET/versionBuild 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=MWEBWEB or MWEB SABR session metadata
POST/youtube/player/decoderBatch 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.

Related projects

License

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

About

YouTube BotGuard PO token microservice for TypeType-Server

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages