# s16h/py-must-watch architecture

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

- Interactive diagram: https://gitdiagram.com/s16h/py-must-watch
- Repository: https://github.com/s16h/py-must-watch

## Overview

This is a small curated-video website: visitors load the catalog, choose a talk, and watch it in an embedded YouTube player. A separate Python utility can add YouTube durations to a supplied text file. The runtime links are supported by the controller and player scripts; the README documents the curated-talk purpose. The HTML, CSS, and catalog contents were not sampled, so their detailed wiring is not asserted.

Main entry points: [`static/js/youtube.js`](https://github.com/s16h/py-must-watch/blob/master/static/js/youtube.js) (Embedded player), [`static/js/controller.js`](https://github.com/s16h/py-must-watch/blob/master/static/js/controller.js) (Video controller), [`add_youtube_durations.py`](https://github.com/s16h/py-must-watch/blob/master/add_youtube_durations.py) (Duration updater), [`static/js/scripts.js`](https://github.com/s16h/py-must-watch/blob/master/static/js/scripts.js) (Player UI events)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Video website"]
  node_page["Catalog page<br/>[index.html]"]
  node_styles["Page styles<br/>[styles.css]"]
  node_catalog["Video catalog<br/>[videos.json]"]
  node_controller["Video controller<br/>[controller.js]"]
  node_ui_events["Player UI events<br/>[scripts.js]"]
end

subgraph group_youtube["YouTube playback"]
  node_youtube_player["Embedded player<br/>[youtube.js]"]
  node_youtube["YouTube"]
end

subgraph group_curation["Catalog maintenance"]
  node_duration_tool["Duration updater"]
  node_youtube_api["YouTube Data API"]
  node_input_file["Duration input file"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_page
node_controller -->|"loads"| node_catalog
node_controller -->|"loads video"| node_youtube_player
node_ui_events -->|"stops and resizes"| node_youtube_player
node_youtube_player -->|"uses sizing"| node_ui_events
node_youtube_player -->|"embeds"| node_youtube
node_duration_tool -->|"requests duration"| node_youtube_api
node_duration_tool -->|"updates"| node_input_file

click node_page "https://github.com/s16h/py-must-watch/blob/master/index.html"
click node_styles "https://github.com/s16h/py-must-watch/blob/master/static/css/styles.css"
click node_catalog "https://github.com/s16h/py-must-watch/blob/master/videos.json"
click node_controller "https://github.com/s16h/py-must-watch/blob/master/static/js/controller.js"
click node_ui_events "https://github.com/s16h/py-must-watch/blob/master/static/js/scripts.js"
click node_youtube_player "https://github.com/s16h/py-must-watch/blob/master/static/js/youtube.js"
click node_duration_tool "https://github.com/s16h/py-must-watch/blob/master/add_youtube_durations.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_page,node_styles,node_catalog,node_controller,node_ui_events toneBlue
class node_youtube_player,node_youtube toneAmber
class node_duration_tool,node_youtube_api,node_input_file toneMint
class node_visitor toneIndigo
```

## Components

### Video website

- [Catalog page](https://github.com/s16h/py-must-watch/blob/master/index.html): `index.html`
- [Page styles](https://github.com/s16h/py-must-watch/blob/master/static/css/styles.css): `static/css/styles.css`
- [Video catalog](https://github.com/s16h/py-must-watch/blob/master/videos.json): `videos.json`
- [Video controller](https://github.com/s16h/py-must-watch/blob/master/static/js/controller.js): `static/js/controller.js`
- [Player UI events](https://github.com/s16h/py-must-watch/blob/master/static/js/scripts.js): `static/js/scripts.js`

### YouTube playback

- [Embedded player](https://github.com/s16h/py-must-watch/blob/master/static/js/youtube.js): `static/js/youtube.js`
- **YouTube**

### Catalog maintenance

- [Duration updater](https://github.com/s16h/py-must-watch/blob/master/add_youtube_durations.py): `add_youtube_durations.py`
- **YouTube Data API**
- **Duration input file**

### Other components

- **Visitor**

## Connections

- Visitor → Catalog page: opens (evidence: `README.md`)
- Video controller → Video catalog: loads (evidence: `static/js/controller.js`)
- Video controller → Embedded player: loads video (evidence: `static/js/controller.js`)
- Player UI events → Embedded player: stops and resizes (evidence: `static/js/scripts.js`)
- Embedded player → Player UI events: uses sizing (evidence: `static/js/youtube.js`)
- Embedded player → YouTube: embeds (evidence: `static/js/youtube.js`)
- Duration updater → YouTube Data API: requests duration (evidence: `add_youtube_durations.py`)
- Duration updater → Duration input file: updates (evidence: `add_youtube_durations.py`)
