# gaatyin/tomorrow architecture

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

- Interactive diagram: https://gitdiagram.com/gaatyin/tomorrow
- Repository: https://github.com/gaatyin/tomorrow

## Overview

This repository is a collection of TVBox/OK影视 configuration resources and provider scripts, not a media-hosting service. The documented user workflow is to subscribe to a configuration in a compatible client, use provider scripts to discover and select content, and obtain playback links from external sources. The JavaScript runtime includes the drpy engine and parsing/encoding helpers; separate JavaScript, Python, and library directories hold provider implementations. Several configuration files named in the README are not present in the supplied tree, and most provider implementations were not sampled, so those relationships are shown only where documented or marked unverified.

Main entry points: [`JS/drpy2.js`](https://github.com/gaatyin/tomorrow/blob/master/JS/drpy2.js) (drpy engine), [`JS`](https://github.com/gaatyin/tomorrow/tree/master/JS) (JS site adapters), [`lib`](https://github.com/gaatyin/tomorrow/tree/master/lib) (Library adapters), [`py`](https://github.com/gaatyin/tomorrow/tree/master/py) (Python adapters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client and sources"]
  node_tvclient["TVBox client"]
end

subgraph group_runtime["JavaScript runtime"]
  node_drpy["drpy engine<br/>[drpy2.js]"]
  node_templates["Rule templates<br/>[模板.js]"]
  node_gbk["GBK codec<br/>[gbk.js]"]
  node_jsencrypt["JSEncrypt<br/>[jsencrypt.js]"]
  node_nodersa["Node RSA<br/>[node-rsa.js]"]
  node_cryptojs["CryptoJS<br/>[crypto-js.js]"]
  node_json5["JSON5 parser<br/>[json5.js]"]
  node_jinja["Jinja renderer<br/>[jinja.js]"]
end

subgraph group_jsproviders["JavaScript providers"]
  node_jsadapters["JS site adapters"]
end

subgraph group_otherproviders["Other providers"]
  node_libadapters["Library adapters"]
  node_pyadapters["Python adapters"]
end

node_user(("Viewer"))
node_contentsites["Content sites"]

node_user -->|"browses with"| node_tvclient
node_tvclient -.->|"runs sources"| node_jsadapters
node_tvclient -.->|"runs sources"| node_libadapters
node_tvclient -.->|"runs sources"| node_pyadapters
node_jsadapters -.->|"fetches listings"| node_contentsites
node_libadapters -.->|"fetches listings"| node_contentsites
node_pyadapters -.->|"fetches listings"| node_contentsites
node_contentsites -.->|"provides playback"| node_tvclient
node_drpy -->|"imports rules"| node_templates
node_drpy -->|"encodes text"| node_gbk
node_drpy -->|"imports"| node_jsencrypt
node_drpy -->|"imports"| node_nodersa

click node_jsadapters "https://github.com/gaatyin/tomorrow/tree/master/JS"
click node_libadapters "https://github.com/gaatyin/tomorrow/tree/master/lib"
click node_pyadapters "https://github.com/gaatyin/tomorrow/tree/master/py"
click node_drpy "https://github.com/gaatyin/tomorrow/blob/master/JS/drpy2.js"
click node_templates "https://github.com/gaatyin/tomorrow/blob/master/JS/%E6%A8%A1%E6%9D%BF.js"
click node_gbk "https://github.com/gaatyin/tomorrow/blob/master/JS/gbk.js"
click node_jsencrypt "https://github.com/gaatyin/tomorrow/blob/master/JS/jsencrypt.js"
click node_nodersa "https://github.com/gaatyin/tomorrow/blob/master/JS/node-rsa.js"
click node_cryptojs "https://github.com/gaatyin/tomorrow/blob/master/JS/crypto-js.js"
click node_json5 "https://github.com/gaatyin/tomorrow/blob/master/JS/json5.js"
click node_jinja "https://github.com/gaatyin/tomorrow/blob/master/JS/jinja.js"

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_tvclient,node_user toneBlue
class node_drpy,node_templates,node_gbk,node_jsencrypt,node_nodersa,node_cryptojs,node_json5,node_jinja toneAmber
class node_jsadapters toneMint
class node_libadapters,node_pyadapters toneRose
class node_contentsites toneIndigo
```

## Components

### Client and sources

- **TVBox client**

### JavaScript runtime

- [drpy engine](https://github.com/gaatyin/tomorrow/blob/master/JS/drpy2.js): `JS/drpy2.js`
- [Rule templates](https://github.com/gaatyin/tomorrow/blob/master/JS/%E6%A8%A1%E6%9D%BF.js): `JS/模板.js`
- [GBK codec](https://github.com/gaatyin/tomorrow/blob/master/JS/gbk.js): `JS/gbk.js`
- [JSEncrypt](https://github.com/gaatyin/tomorrow/blob/master/JS/jsencrypt.js): `JS/jsencrypt.js`
- [Node RSA](https://github.com/gaatyin/tomorrow/blob/master/JS/node-rsa.js): `JS/node-rsa.js`
- [CryptoJS](https://github.com/gaatyin/tomorrow/blob/master/JS/crypto-js.js): `JS/crypto-js.js`
- [JSON5 parser](https://github.com/gaatyin/tomorrow/blob/master/JS/json5.js): `JS/json5.js`
- [Jinja renderer](https://github.com/gaatyin/tomorrow/blob/master/JS/jinja.js): `JS/jinja.js`

### JavaScript providers

- [JS site adapters](https://github.com/gaatyin/tomorrow/tree/master/JS): `JS`

### Other providers

- [Library adapters](https://github.com/gaatyin/tomorrow/tree/master/lib): `lib`
- [Python adapters](https://github.com/gaatyin/tomorrow/tree/master/py): `py`

### Other components

- **Viewer**
- **Content sites**

## Connections

- Viewer → TVBox client: browses with
- TVBox client → JS site adapters: runs sources
- TVBox client → Library adapters: runs sources
- TVBox client → Python adapters: runs sources
- JS site adapters → Content sites: fetches listings
- Library adapters → Content sites: fetches listings
- Python adapters → Content sites: fetches listings
- Content sites → TVBox client: provides playback
- drpy engine → Rule templates: imports rules (evidence: `JS/drpy2.js`)
- drpy engine → GBK codec: encodes text (evidence: `JS/drpy2.js`)
- drpy engine → JSEncrypt: imports (evidence: `JS/drpy2.js`)
- drpy engine → Node RSA: imports (evidence: `JS/drpy2.js`)
