# grqz/yt-dlp-get-pot architecture

> Architecture diagram of the GitHub repository grqz/yt-dlp-get-pot, 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-get-pot
- Repository: https://github.com/grqz/yt-dlp-get-pot

## Overview

This is yt-dlp’s client-side PO Token provider framework; it does not retrieve tokens itself. The workflow begins when YouTube extraction needs a token: the plugin tries yt-dlp’s existing implementation, then dispatches a request to a compatible registered provider and uses its returned token. The provider contract handles request validation and response formatting, while registration and preferences support provider discovery and selection. Provider implementations are external plugins. The graph reflects the sampled runtime code and README; no provider implementation is included here.

Main entry points: [`yt_dlp_plugins/extractor/getpot_client.py`](https://github.com/grqz/yt-dlp-get-pot/blob/master/yt_dlp_plugins/extractor/getpot_client.py) (YouTube plugin), [`yt_dlp_plugins/extractor/getpot.py`](https://github.com/grqz/yt-dlp-get-pot/blob/master/yt_dlp_plugins/extractor/getpot.py) (Provider contract)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["YouTube client"]
  node_youtube_plugin["YouTube plugin<br/>[getpot_client.py]"]
end

subgraph group_framework["Provider framework"]
  node_provider_registry["Provider registry<br/>[getpot.py]"]
  node_provider_contract["Provider contract<br/>[getpot.py]"]
  node_token_response["Token response<br/>[getpot.py]"]
end

subgraph group_extensions["Provider extensions"]
  node_provider_plugin["Provider plugin"]
end

node_yt_dlp(("yt-dlp"))

node_yt_dlp -->|"requests token"| node_youtube_plugin
node_youtube_plugin -->|"builds director"| node_provider_registry
node_youtube_plugin -->|"dispatches request"| node_provider_contract
node_provider_registry -->|"registers handlers"| node_provider_contract
node_provider_contract -->|"formats token"| node_token_response
node_provider_plugin -->|"registers provider"| node_provider_registry
node_provider_plugin -->|"implements contract"| node_provider_contract
node_token_response -->|"returns token"| node_youtube_plugin

click node_youtube_plugin "https://github.com/grqz/yt-dlp-get-pot/blob/master/yt_dlp_plugins/extractor/getpot_client.py"
click node_provider_registry "https://github.com/grqz/yt-dlp-get-pot/blob/master/yt_dlp_plugins/extractor/getpot.py"
click node_provider_contract "https://github.com/grqz/yt-dlp-get-pot/blob/master/yt_dlp_plugins/extractor/getpot.py"
click node_token_response "https://github.com/grqz/yt-dlp-get-pot/blob/master/yt_dlp_plugins/extractor/getpot.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_youtube_plugin toneBlue
class node_provider_registry,node_provider_contract,node_token_response toneAmber
class node_provider_plugin toneMint
class node_yt_dlp toneIndigo
```

## Components

### YouTube client

- [YouTube plugin](https://github.com/grqz/yt-dlp-get-pot/blob/master/yt_dlp_plugins/extractor/getpot_client.py): `yt_dlp_plugins/extractor/getpot_client.py`

### Provider framework

- [Provider registry](https://github.com/grqz/yt-dlp-get-pot/blob/master/yt_dlp_plugins/extractor/getpot.py): `yt_dlp_plugins/extractor/getpot.py`
- [Provider contract](https://github.com/grqz/yt-dlp-get-pot/blob/master/yt_dlp_plugins/extractor/getpot.py): `yt_dlp_plugins/extractor/getpot.py`
- [Token response](https://github.com/grqz/yt-dlp-get-pot/blob/master/yt_dlp_plugins/extractor/getpot.py): `yt_dlp_plugins/extractor/getpot.py`

### Provider extensions

- **Provider plugin**

### Other components

- **yt-dlp**

## Connections

- yt-dlp → YouTube plugin: requests token (evidence: `README.md`)
- YouTube plugin → Provider registry: builds director (evidence: `yt_dlp_plugins/extractor/getpot_client.py`)
- YouTube plugin → Provider contract: dispatches request (evidence: `yt_dlp_plugins/extractor/getpot_client.py`)
- Provider registry → Provider contract: registers handlers (evidence: `yt_dlp_plugins/extractor/getpot.py`)
- Provider contract → Token response: formats token (evidence: `yt_dlp_plugins/extractor/getpot.py`)
- Provider plugin → Provider registry: registers provider (evidence: `README.md`)
- Provider plugin → Provider contract: implements contract (evidence: `README.md`)
- Token response → YouTube plugin: returns token (evidence: `yt_dlp_plugins/extractor/getpot_client.py`)
