# grqz/yt-dlp-getpot-wpc architecture

> Architecture diagram of the GitHub repository grqz/yt-dlp-getpot-wpc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/grqz/yt-dlp-getpot-wpc
- Repository: https://github.com/grqz/yt-dlp-getpot-wpc

## Overview

This repository is a yt-dlp GetPOT provider plugin. When yt-dlp requests a supported YouTube PO Token, the provider validates browser availability and settings, derives the token’s content binding, optionally returns a cached token, or launches a browser and invokes YouTube’s WebPoClient to mint one. The single source file implements the provider, browser lifecycle, minting and cache behavior. README documents supported clients and guest/logged-in use; source evidence does not expose finer-grained handling of those session types.

Main entry points: [`yt_dlp_plugins/extractor/getpot_wpc.py`](https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py) (WPC provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["yt-dlp integration"]
  node_provider["WPC provider<br/>[getpot_wpc.py]"]
  node_preference["Provider preference<br/>[getpot_wpc.py]"]
  node_validation["Request validation<br/>[getpot_wpc.py]"]
end

subgraph group_runtime["Browser token runtime"]
  node_binding["Content binding<br/>[getpot_wpc.py]"]
  node_proxy_config["Proxy and browser config<br/>[getpot_wpc.py]"]
  node_browser["Browser session<br/>[getpot_wpc.py]"]
  node_webpo["WebPoClient minting<br/>[getpot_wpc.py]"]
end

subgraph group_state["Token state"]
  node_cache[("PO Token cache<br/>[getpot_wpc.py]")]
end

node_yt_dlp(("yt-dlp request"))
node_youtube["YouTube web client"]

node_yt_dlp -->|"requests token"| node_provider
node_preference -->|"sets priority"| node_provider
node_provider -->|"validates request"| node_validation
node_provider -->|"derives binding"| node_binding
node_provider -->|"configures browser"| node_proxy_config
node_provider -->|"checks cache"| node_cache
node_provider -->|"launches session"| node_browser
node_provider -->|"requests minting"| node_webpo
node_webpo -->|"evaluates script"| node_browser
node_browser -->|"opens site"| node_youtube
node_webpo -->|"invokes client"| node_youtube
node_provider -->|"stores token"| node_cache

click node_provider "https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py"
click node_preference "https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py"
click node_validation "https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py"
click node_binding "https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py"
click node_proxy_config "https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py"
click node_browser "https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py"
click node_webpo "https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py"
click node_cache "https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_provider,node_preference,node_validation,node_youtube toneBlue
class node_binding,node_proxy_config,node_browser,node_webpo toneAmber
class node_cache,node_yt_dlp toneMint
```

## Components

### yt-dlp integration

- [WPC provider](https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py): `yt_dlp_plugins/extractor/getpot_wpc.py`
- [Provider preference](https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py): `yt_dlp_plugins/extractor/getpot_wpc.py`
- [Request validation](https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py): `yt_dlp_plugins/extractor/getpot_wpc.py`

### Browser token runtime

- [Content binding](https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py): `yt_dlp_plugins/extractor/getpot_wpc.py`
- [Proxy and browser config](https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py): `yt_dlp_plugins/extractor/getpot_wpc.py`
- [Browser session](https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py): `yt_dlp_plugins/extractor/getpot_wpc.py`
- [WebPoClient minting](https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py): `yt_dlp_plugins/extractor/getpot_wpc.py`

### Token state

- [PO Token cache](https://github.com/grqz/yt-dlp-getpot-wpc/blob/main/yt_dlp_plugins/extractor/getpot_wpc.py): `yt_dlp_plugins/extractor/getpot_wpc.py`

### Other components

- **yt-dlp request**
- **YouTube web client**

## Connections

- yt-dlp request → WPC provider: requests token (evidence: `README.md`)
- Provider preference → WPC provider: sets priority (evidence: `yt_dlp_plugins/extractor/getpot_wpc.py`)
- WPC provider → Request validation: validates request (evidence: `yt_dlp_plugins/extractor/getpot_wpc.py`)
- WPC provider → Content binding: derives binding (evidence: `yt_dlp_plugins/extractor/getpot_wpc.py`)
- WPC provider → Proxy and browser config: configures browser (evidence: `yt_dlp_plugins/extractor/getpot_wpc.py`)
- WPC provider → PO Token cache: checks cache (evidence: `yt_dlp_plugins/extractor/getpot_wpc.py`)
- WPC provider → Browser session: launches session (evidence: `yt_dlp_plugins/extractor/getpot_wpc.py`)
- WPC provider → WebPoClient minting: requests minting (evidence: `yt_dlp_plugins/extractor/getpot_wpc.py`)
- WebPoClient minting → Browser session: evaluates script (evidence: `yt_dlp_plugins/extractor/getpot_wpc.py`)
- Browser session → YouTube web client: opens site (evidence: `yt_dlp_plugins/extractor/getpot_wpc.py`)
- WebPoClient minting → YouTube web client: invokes client (evidence: `yt_dlp_plugins/extractor/getpot_wpc.py`)
- WPC provider → PO Token cache: stores token (evidence: `yt_dlp_plugins/extractor/getpot_wpc.py`)
