# crisperfx/m3u-extra architecture

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

- Interactive diagram: https://gitdiagram.com/crisperfx/m3u-extra
- Repository: https://github.com/crisperfx/m3u-extra

## Overview

m3u-extra is a web interface and browser extension for submitting and monitoring N_m3u8DL-RE downloads. The main flow is command entry in the web UI or extension, job submission and queueing in the Flask app, stream selection and download execution, then file organization and access. The app also exposes settings, saved logs, and file management; the extension adds configurable stream-selection and submission controls. Relationships beyond the excerpts are included only where the README documents them; the backend’s detailed runtime structure is not fully sampled.

Main entry points: [`app.py`](https://github.com/crisperfx/m3u-extra/blob/main/app.py) (Flask API and Job Control), [`static/app.js`](https://github.com/crisperfx/m3u-extra/blob/main/static/app.js) (Job Dashboard), [`extension/src`](https://github.com/crisperfx/m3u-extra/tree/main/extension/src) (Extension Submission), [`static/log.js`](https://github.com/crisperfx/m3u-extra/blob/main/static/log.js) (Live Log View)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Interface"]
  node_home["Job Dashboard<br/>[app.js]"]
  node_logview["Live Log View<br/>[log.js]"]
  node_streamview["Stream Progress UI<br/>[streams.js]"]
  node_translations["Translations<br/>[i18n.js]"]
  node_settingsui["Web Settings UI<br/>[options.js]"]
end

subgraph group_server["Job Server"]
  node_backend["Flask API and Job Control<br/>[app.py]"]
  node_queue["Job Queue<br/>[app.py]"]
end

subgraph group_media["Download and Files"]
  node_streamselect["Stream Selection<br/>[app.py]"]
  node_downloader["N_m3u8DL-RE"]
  node_mediafinal["Mux and File Naming<br/>[app.py]"]
  node_downloads[("Download Files")]
end

subgraph group_extension["Browser Extension"]
  node_extensionui["Extension Options<br/>[options.js]"]
  node_extensionclient["Extension Submission"]
end

subgraph group_state["Settings and History"]
  node_settings[("Application Settings<br/>[app.py]")]
  node_history[("Saved Logs and History<br/>[app.py]")]
end

node_user(("User"))
node_media_tools["FFmpeg and MKVToolNix"]
node_github["GitHub Script Updates"]

node_user -->|"enters commands"| node_home
node_home -->|"submits jobs"| node_backend
node_home -->|"manages queue"| node_backend
node_backend -->|"enqueues jobs"| node_queue
node_queue -.->|"requests selection"| node_streamselect
node_backend -->|"runs commands"| node_downloader
node_downloader -->|"produces media"| node_mediafinal
node_mediafinal -->|"muxes Dolby Vision"| node_media_tools
node_mediafinal -->|"stores finished files"| node_downloads
node_home -->|"opens job log"| node_logview
node_logview -->|"fetches status and log"| node_backend
node_home -->|"renders stream progress"| node_streamview
node_settingsui -->|"reads and saves"| node_backend
node_backend -->|"loads settings"| node_settings
node_backend -->|"saves finished logs"| node_history
node_home -->|"lists and manages files"| node_downloads
node_user -->|"configures extension"| node_extensionui
node_extensionui -.->|"sets submission options"| node_extensionclient
node_extensionclient -->|"submits command"| node_backend
node_extensionclient -->|"fetches script updates"| node_github
node_translations -.->|"localizes interface"| node_home
node_translations -.->|"localizes interface"| node_logview

click node_home "https://github.com/crisperfx/m3u-extra/blob/main/static/app.js"
click node_logview "https://github.com/crisperfx/m3u-extra/blob/main/static/log.js"
click node_streamview "https://github.com/crisperfx/m3u-extra/blob/main/static/streams.js"
click node_translations "https://github.com/crisperfx/m3u-extra/blob/main/static/i18n.js"
click node_settingsui "https://github.com/crisperfx/m3u-extra/blob/main/static/options.js"
click node_backend "https://github.com/crisperfx/m3u-extra/blob/main/app.py"
click node_queue "https://github.com/crisperfx/m3u-extra/blob/main/app.py"
click node_streamselect "https://github.com/crisperfx/m3u-extra/blob/main/app.py"
click node_mediafinal "https://github.com/crisperfx/m3u-extra/blob/main/app.py"
click node_extensionui "https://github.com/crisperfx/m3u-extra/blob/main/extension/src/ui/options.js"
click node_extensionclient "https://github.com/crisperfx/m3u-extra/tree/main/extension/src"
click node_settings "https://github.com/crisperfx/m3u-extra/blob/main/app.py"
click node_history "https://github.com/crisperfx/m3u-extra/blob/main/app.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_home,node_logview,node_streamview,node_translations,node_settingsui,node_user toneBlue
class node_backend,node_queue toneAmber
class node_streamselect,node_downloader,node_mediafinal,node_downloads toneMint
class node_extensionui,node_extensionclient toneRose
class node_settings,node_history,node_media_tools,node_github toneIndigo
```

## Components

### Web Interface

- [Job Dashboard](https://github.com/crisperfx/m3u-extra/blob/main/static/app.js): `static/app.js`
- [Live Log View](https://github.com/crisperfx/m3u-extra/blob/main/static/log.js): `static/log.js`
- [Stream Progress UI](https://github.com/crisperfx/m3u-extra/blob/main/static/streams.js): `static/streams.js`
- [Translations](https://github.com/crisperfx/m3u-extra/blob/main/static/i18n.js): `static/i18n.js`
- [Web Settings UI](https://github.com/crisperfx/m3u-extra/blob/main/static/options.js): `static/options.js`

### Job Server

- [Flask API and Job Control](https://github.com/crisperfx/m3u-extra/blob/main/app.py): `app.py`
- [Job Queue](https://github.com/crisperfx/m3u-extra/blob/main/app.py): `app.py`

### Download and Files

- [Stream Selection](https://github.com/crisperfx/m3u-extra/blob/main/app.py): `app.py`
- **N_m3u8DL-RE**
- [Mux and File Naming](https://github.com/crisperfx/m3u-extra/blob/main/app.py): `app.py`
- **Download Files**

### Browser Extension

- [Extension Options](https://github.com/crisperfx/m3u-extra/blob/main/extension/src/ui/options.js): `extension/src/ui/options.js`
- [Extension Submission](https://github.com/crisperfx/m3u-extra/tree/main/extension/src): `extension/src`

### Settings and History

- [Application Settings](https://github.com/crisperfx/m3u-extra/blob/main/app.py): `app.py`
- [Saved Logs and History](https://github.com/crisperfx/m3u-extra/blob/main/app.py): `app.py`

### Other components

- **User**
- **FFmpeg and MKVToolNix**
- **GitHub Script Updates**

## Connections

- User → Job Dashboard: enters commands (evidence: `README.md`)
- Job Dashboard → Flask API and Job Control: submits jobs (evidence: `README.md`)
- Job Dashboard → Flask API and Job Control: manages queue (evidence: `static/app.js`)
- Flask API and Job Control → Job Queue: enqueues jobs (evidence: `app.py`)
- Job Queue → Stream Selection: requests selection (evidence: `app.py`)
- Flask API and Job Control → N_m3u8DL-RE: runs commands (evidence: `README.md`)
- N_m3u8DL-RE → Mux and File Naming: produces media (evidence: `README.md`)
- Mux and File Naming → FFmpeg and MKVToolNix: muxes Dolby Vision (evidence: `README.md`)
- Mux and File Naming → Download Files: stores finished files (evidence: `README.md`)
- Job Dashboard → Live Log View: opens job log (evidence: `README.md`)
- Live Log View → Flask API and Job Control: fetches status and log (evidence: `static/log.js`)
- Job Dashboard → Stream Progress UI: renders stream progress (evidence: `README.md`)
- Web Settings UI → Flask API and Job Control: reads and saves (evidence: `static/options.js`)
- Flask API and Job Control → Application Settings: loads settings (evidence: `README.md`)
- Flask API and Job Control → Saved Logs and History: saves finished logs (evidence: `README.md`)
- Job Dashboard → Download Files: lists and manages files (evidence: `README.md`)
- User → Extension Options: configures extension (evidence: `README.md`)
- Extension Options → Extension Submission: sets submission options
- Extension Submission → Flask API and Job Control: submits command (evidence: `README.md`)
- Extension Submission → GitHub Script Updates: fetches script updates (evidence: `README.md`)
- Translations → Job Dashboard: localizes interface
- Translations → Live Log View: localizes interface
