# nbtu/streamlink-stripchat-plugin architecture

> Architecture diagram of the GitHub repository nbtu/streamlink-stripchat-plugin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nbtu/streamlink-stripchat-plugin
- Repository: https://github.com/nbtu/streamlink-stripchat-plugin

## Overview

This is a single-file Streamlink plugin that turns Stripchat room URLs or DoppioCDN HLS links into playable streams. The room workflow looks up the user and camera status, fetches a master playlist, detects playlist variants, then selects a Mouflon v1 or v2 worker; direct links follow a separate playlist-inspection path. Both workers adapt encrypted playlists for Streamlink’s HLS handling. The README documents both Mouflon versions and pkey fallback; some implementation details are in omitted excerpts, so those relationships are cited to the README.

Main entry points: [`stripchat.py`](https://github.com/nbtu/streamlink-stripchat-plugin/blob/main/stripchat.py) (URL handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Plugin entry"]
  node_plugin["URL handler<br/>[stripchat.py]"]
end

subgraph group_sources["Stream sources"]
  node_stripchat_api["Stripchat APIs"]
  node_cdn["DoppioCDN playlists"]
  node_variant_parser["Variant parser"]
  node_hls["Streamlink HLS"]
end

subgraph group_mouflon["Mouflon processing"]
  node_v1_worker["v1 playlist worker<br/>[stripchat.py]"]
  node_v2_worker["v2 playlist worker<br/>[stripchat.py]"]
  node_key_logic["Pkey and decryption<br/>[stripchat.py]"]
end

node_user(("Streamlink user"))

node_user -->|"provides URL"| node_plugin
node_plugin -->|"looks up user and camera"| node_stripchat_api
node_plugin -->|"fetches playlists"| node_cdn
node_plugin -->|"parses variants"| node_variant_parser
node_plugin -->|"selects v1 worker"| node_v1_worker
node_plugin -->|"selects v2 worker"| node_v2_worker
node_v1_worker -->|"fetches playlist"| node_cdn
node_v2_worker -->|"fetches playlist"| node_cdn
node_v1_worker -->|"decrypts entries"| node_key_logic
node_v2_worker -->|"decodes tokens"| node_key_logic
node_v1_worker -->|"adapts HLS handling"| node_hls
node_v2_worker -->|"integrates playback"| node_hls

click node_plugin "https://github.com/nbtu/streamlink-stripchat-plugin/blob/main/stripchat.py"
click node_v1_worker "https://github.com/nbtu/streamlink-stripchat-plugin/blob/main/stripchat.py"
click node_v2_worker "https://github.com/nbtu/streamlink-stripchat-plugin/blob/main/stripchat.py"
click node_key_logic "https://github.com/nbtu/streamlink-stripchat-plugin/blob/main/stripchat.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_plugin,node_user toneBlue
class node_stripchat_api,node_cdn,node_variant_parser,node_hls toneAmber
class node_v1_worker,node_v2_worker,node_key_logic toneMint
```

## Components

### Plugin entry

- [URL handler](https://github.com/nbtu/streamlink-stripchat-plugin/blob/main/stripchat.py): `stripchat.py`

### Stream sources

- **Stripchat APIs**
- **DoppioCDN playlists**
- **Variant parser**
- **Streamlink HLS**

### Mouflon processing

- [v1 playlist worker](https://github.com/nbtu/streamlink-stripchat-plugin/blob/main/stripchat.py): `stripchat.py`
- [v2 playlist worker](https://github.com/nbtu/streamlink-stripchat-plugin/blob/main/stripchat.py): `stripchat.py`
- [Pkey and decryption](https://github.com/nbtu/streamlink-stripchat-plugin/blob/main/stripchat.py): `stripchat.py`

### Other components

- **Streamlink user**

## Connections

- Streamlink user → URL handler: provides URL (evidence: `README.md`)
- URL handler → Stripchat APIs: looks up user and camera (evidence: `stripchat.py`)
- URL handler → DoppioCDN playlists: fetches playlists (evidence: `stripchat.py`)
- URL handler → Variant parser: parses variants (evidence: `stripchat.py`)
- URL handler → v1 playlist worker: selects v1 worker (evidence: `stripchat.py`)
- URL handler → v2 playlist worker: selects v2 worker (evidence: `stripchat.py`)
- v1 playlist worker → DoppioCDN playlists: fetches playlist (evidence: `stripchat.py`)
- v2 playlist worker → DoppioCDN playlists: fetches playlist (evidence: `stripchat.py`)
- v1 playlist worker → Pkey and decryption: decrypts entries (evidence: `stripchat.py`)
- v2 playlist worker → Pkey and decryption: decodes tokens (evidence: `README.md`)
- v1 playlist worker → Streamlink HLS: adapts HLS handling (evidence: `stripchat.py`)
- v2 playlist worker → Streamlink HLS: integrates playback (evidence: `README.md`)
