Skip to content

Priveetee/TypeType-Token

Repository files navigation

TypeType

TypeType-Token

YouTube Proof-of-Origin token service for TypeType-Server.

Runtime BotGuard License

TypeType-Token generates YouTube PO tokens for TypeType-Server. The frontend never calls this service directly.

It runs as a small Bun service inside the TypeType stack and is consumed over HTTP by the backend.

What this is

A dedicated token microservice for the YouTube BotGuard and Proof-of-Origin flow.

It fetches visitor data, solves BotGuard challenges, generates integrity tokens, caches results, and returns PO token data to TypeType-Server.

What this is not

  • Not a public API for browsers.
  • Not a frontend dependency.
  • Not an extraction service.
  • Not a general YouTube client.

Stack

Role Tool
Runtime Bun
HTTP server Bun.serve()
BotGuard challenge bgutils-js
Browser runtime Playwright Chromium
Cache Bun Redis client with Dragonfly
Tests bun:test
Lint and format Biome

API

Method Path Description
GET /potoken?videoId=<id> Returns PO token data for one YouTube video ID

Response shape:

{
  "poToken": "...",
  "visitorData": "...",
  "streamingPot": "..."
}

Errors return HTTP 500 with:

{ "error": "descriptive message" }

Runtime

Run from source:

bun run src/index.ts

Build and run the production bundle:

bun build src/index.ts --outfile dist/index.js --target bun
bun dist/index.js

The service listens on port 8081.

Development

bun install
bun test
bun run lint

Docker tags

Container tags are published to GHCR with:

Tag Source
latest Default branch builds
sha-<short-sha> Every build
main Main branch
v* Git release tags

Related projects

Acknowledgments

License

MIT. See LICENSE.

About

YouTube BotGuard PO token microservice for TypeType-Server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors