discstation 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 phuju
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,137 @@
1
+ # DiscStation
2
+
3
+ DiscStation is a physical-media appliance for DVD-Video, data DVDs, audio CDs,
4
+ playback, ripping, phone uploads, and ESP32 remote control.
5
+
6
+ ## Hardware
7
+
8
+ - **Brain:** Raspberry Pi 4/5 (or any Linux box)
9
+ - **Remote:** ESP32-C6 with SSD1306 OLED, rotary encoder, and buttons
10
+ - **Drive:** ATAPI DVD writer (e.g. iHAS124) over USB
11
+
12
+ ## Features
13
+
14
+ | Mode | Description |
15
+ |------|-------------|
16
+ | **Burn Video DVD** | YouTube URL or local file → ffmpeg 2-pass → DVD-Video disc |
17
+ | **Burn Data DVD** | Any files/folders → ISO/Joliet data disc (no quality loss) |
18
+ | **Burn MPG** | Re-burn a previously converted movie.mpg |
19
+ | **Play** | Playback via mpv (DVD-Video, Audio CD, VCD, SVCD) |
20
+ | **Rip** | Audio CD → FLAC with MusicBrainz metadata |
21
+
22
+ ## Project Structure
23
+
24
+ ```
25
+ .
26
+ ├── src/
27
+ │ ├── discstation.py # Main orchestrator, serial, web server
28
+ │ └── discstation_burn.py # Burn pipeline (download, convert, author, burn)
29
+ ├── arduino/
30
+ │ ├── c6/ # ESP32-C6 firmware
31
+ │ └── v1/ # ESP32 DevKit firmware
32
+ ├── docs/ # Platform support notes
33
+ ├── install.sh # Linux host installer
34
+ ├── install-macos.sh # macOS host bootstrap
35
+ ├── install-windows.ps1 # Windows host bootstrap
36
+ ├── systemd/ # Linux auto-start unit
37
+ └── README.md
38
+ ```
39
+
40
+ ## Setup
41
+
42
+ ### Install (any OS)
43
+
44
+ ```bash
45
+ npm install -g discstation
46
+ discstation-setup # dispatches to the installer for your OS
47
+ ```
48
+
49
+ `discstation-setup --help` lists the forwarded env vars. From a git clone,
50
+ `npm run setup` does the same thing. Support by OS:
51
+
52
+ | OS | What runs | Optical support |
53
+ |----|-----------|-----------------|
54
+ | Linux | `install.sh` — apt deps, venv, systemd `--user` service, self-signed cert | full burn / rip / play |
55
+ | macOS | `install-macos.sh` — Homebrew deps, venv, launchd agent, cert | experimental (set `DISC_DEVICE` if detection fails) |
56
+ | Windows | `install-windows.ps1` — files + venv | web / serial control only, no burn backend |
57
+
58
+ ### Or run the platform script directly
59
+
60
+ ```bash
61
+ # Linux host
62
+ ./install.sh
63
+
64
+ # Arduino
65
+ arduino-cli lib install QRCode
66
+ # Upload arduino/c6/DiscStation_C6.ino or arduino/v1/DiscStation.ino
67
+ # to the matching ESP32 board
68
+
69
+ # macOS host
70
+ ./install-macos.sh
71
+
72
+ # Windows host (web/control workflow)
73
+ PowerShell -ExecutionPolicy Bypass -File .\install-windows.ps1
74
+ ```
75
+
76
+ ## Platform Support
77
+
78
+ Linux currently supports the complete optical workflow. macOS and Windows use
79
+ the shared Python/web workflows, but their native optical burning backends are
80
+ still being implemented. See `docs/PLATFORM_SUPPORT.md`.
81
+
82
+ ## Web Interface
83
+
84
+ Built-in web server on port 8080 (HTTPS with self-signed cert):
85
+
86
+ - Upload files from any device on the LAN for data DVD burning
87
+ - Submit YouTube URLs for video DVD burning
88
+ - Dark theme, mobile-responsive, PWA (installable on phone)
89
+
90
+ ## Disc Support
91
+
92
+ - DVD-R, DVD+R (single and dual-layer)
93
+ - DVD-RW, DVD+RW
94
+ - CD-R, CD-RW (audio CD ripping)
95
+
96
+ ## Environment Variables
97
+
98
+ | Variable | Default | Description |
99
+ |----------|---------|-------------|
100
+ | `DISC_SPEED` | auto | Burn speed (e.g. `4x`, `8x`) |
101
+ | `DISC_TARGET_BYTES` | 4300000000 | Target size for AUTO mode |
102
+ | `DISC_CLEANUP_DAYS` | 2 | Auto-cleanup old job directories |
103
+ | `DISC_OUTPUT_LIMIT_BYTES` | 4300000000 | Conservative DVD5 payload limit |
104
+ | `DISC_DL_OUTPUT_LIMIT_BYTES` | 8000000000 | Conservative DVD9 payload limit |
105
+
106
+ ### YouTube Download Configuration
107
+
108
+ The host prefers an embeddable YouTube client and small HTTP chunks to reduce
109
+ current YouTube 403 failures. It falls back to the Android VR client if needed.
110
+
111
+ | Variable | Default | Description |
112
+ |----------|---------|-------------|
113
+ | `YTDLP_PLAYER_CLIENTS` | `web_embedded,android_vr` | Comma-separated clients tried in order |
114
+ | `YTDLP_HTTP_CHUNK_SIZE` | `1M` | HTTP chunk size for media downloads |
115
+ | `YTDLP_FORMAT` | H.264/AAC up to 720p, then generic MP4 | yt-dlp format selector override |
116
+ | `YTDLP_RETRIES` | `3` | HTTP download retries per client |
117
+ | `YTDLP_FRAGMENT_RETRIES` | `3` | DASH/HLS fragment retries |
118
+ | `YTDLP_COOKIES` | unset | Netscape-format cookies file |
119
+ | `YTDLP_COOKIES_FROM_BROWSER` | unset | Browser source such as `firefox` or `chrome` |
120
+ | `YTDLP_USER_AGENT` | unset | Optional browser user-agent matching the cookies |
121
+ | `YTDLP_PO_TOKEN` | unset | Client/context PO token in yt-dlp format |
122
+ | `YTDLP_EXTRACTOR_ARGS` | unset | Additional yt-dlp extractor arguments |
123
+
124
+ Cookie files and PO tokens must stay outside the repository and service logs.
125
+
126
+ ## Modes (Video DVD)
127
+
128
+ | Mode | Quality | Use Case |
129
+ |------|---------|----------|
130
+ | AUTO | Standard ~4300kbps | Default |
131
+ | BEST | Higher ~4450MB target | Quality priority |
132
+ | LONG | Lower ~350kbps min | Long videos (>2.5h) |
133
+ | DATA | Original quality | Files as-is on disc |
134
+
135
+ ## License
136
+
137
+ MIT