flucto 1.16.3

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.
Files changed (117) hide show
  1. package/CHANGELOG.md +366 -0
  2. package/README.md +373 -0
  3. package/dist-electron/cli/args.js +209 -0
  4. package/dist-electron/cli/args.js.map +1 -0
  5. package/dist-electron/cli/index.js +579 -0
  6. package/dist-electron/cli/index.js.map +1 -0
  7. package/dist-electron/cli/jobOutput.js +32 -0
  8. package/dist-electron/cli/jobOutput.js.map +1 -0
  9. package/dist-electron/cli/output.js +176 -0
  10. package/dist-electron/cli/output.js.map +1 -0
  11. package/dist-electron/cli/theme.js +42 -0
  12. package/dist-electron/cli/theme.js.map +1 -0
  13. package/dist-electron/main/config.js +19 -0
  14. package/dist-electron/main/config.js.map +1 -0
  15. package/dist-electron/main/handlers.js +148 -0
  16. package/dist-electron/main/handlers.js.map +1 -0
  17. package/dist-electron/main/historyStore.js +20 -0
  18. package/dist-electron/main/historyStore.js.map +1 -0
  19. package/dist-electron/main/index.js +827 -0
  20. package/dist-electron/main/index.js.map +1 -0
  21. package/dist-electron/main/logger.js +57 -0
  22. package/dist-electron/main/logger.js.map +1 -0
  23. package/dist-electron/main/media/threads.js +152 -0
  24. package/dist-electron/main/media/threads.js.map +1 -0
  25. package/dist-electron/main/media/ytDlp.js +81 -0
  26. package/dist-electron/main/media/ytDlp.js.map +1 -0
  27. package/dist-electron/main/net/captionNetwork.js +81 -0
  28. package/dist-electron/main/net/captionNetwork.js.map +1 -0
  29. package/dist-electron/main/platforms/bilibili.js +33 -0
  30. package/dist-electron/main/platforms/bilibili.js.map +1 -0
  31. package/dist-electron/main/platforms/createRegistry.js +24 -0
  32. package/dist-electron/main/platforms/createRegistry.js.map +1 -0
  33. package/dist-electron/main/platforms/errors.js +13 -0
  34. package/dist-electron/main/platforms/errors.js.map +1 -0
  35. package/dist-electron/main/platforms/generic.js +12 -0
  36. package/dist-electron/main/platforms/generic.js.map +1 -0
  37. package/dist-electron/main/platforms/index.js +12 -0
  38. package/dist-electron/main/platforms/index.js.map +1 -0
  39. package/dist-electron/main/platforms/instagram.js +16 -0
  40. package/dist-electron/main/platforms/instagram.js.map +1 -0
  41. package/dist-electron/main/platforms/reddit.js +26 -0
  42. package/dist-electron/main/platforms/reddit.js.map +1 -0
  43. package/dist-electron/main/platforms/registry.js +23 -0
  44. package/dist-electron/main/platforms/registry.js.map +1 -0
  45. package/dist-electron/main/platforms/threads.js +168 -0
  46. package/dist-electron/main/platforms/threads.js.map +1 -0
  47. package/dist-electron/main/platforms/tiktok.js +15 -0
  48. package/dist-electron/main/platforms/tiktok.js.map +1 -0
  49. package/dist-electron/main/platforms/twitter.js +41 -0
  50. package/dist-electron/main/platforms/twitter.js.map +1 -0
  51. package/dist-electron/main/platforms/types.js +2 -0
  52. package/dist-electron/main/platforms/types.js.map +1 -0
  53. package/dist-electron/main/platforms/vimeo.js +10 -0
  54. package/dist-electron/main/platforms/vimeo.js.map +1 -0
  55. package/dist-electron/main/platforms/youtube.js +11 -0
  56. package/dist-electron/main/platforms/youtube.js.map +1 -0
  57. package/dist-electron/main/platforms/yt-dlp-adapter.js +17 -0
  58. package/dist-electron/main/platforms/yt-dlp-adapter.js.map +1 -0
  59. package/dist-electron/main/services/batch.js +26 -0
  60. package/dist-electron/main/services/batch.js.map +1 -0
  61. package/dist-electron/main/services/binaryInstaller.js +283 -0
  62. package/dist-electron/main/services/binaryInstaller.js.map +1 -0
  63. package/dist-electron/main/services/binaryRefresh.js +102 -0
  64. package/dist-electron/main/services/binaryRefresh.js.map +1 -0
  65. package/dist-electron/main/services/binaryResolver.js +62 -0
  66. package/dist-electron/main/services/binaryResolver.js.map +1 -0
  67. package/dist-electron/main/services/cliUpdater.js +149 -0
  68. package/dist-electron/main/services/cliUpdater.js.map +1 -0
  69. package/dist-electron/main/services/githubRelease.js +57 -0
  70. package/dist-electron/main/services/githubRelease.js.map +1 -0
  71. package/dist-electron/main/services/githubStar.js +69 -0
  72. package/dist-electron/main/services/githubStar.js.map +1 -0
  73. package/dist-electron/main/services/markdownFile.js +26 -0
  74. package/dist-electron/main/services/markdownFile.js.map +1 -0
  75. package/dist-electron/main/services/markdownPipeline.js +138 -0
  76. package/dist-electron/main/services/markdownPipeline.js.map +1 -0
  77. package/dist-electron/main/services/mediaDownload.js +226 -0
  78. package/dist-electron/main/services/mediaDownload.js.map +1 -0
  79. package/dist-electron/main/services/mediaInfo.js +230 -0
  80. package/dist-electron/main/services/mediaInfo.js.map +1 -0
  81. package/dist-electron/main/services/orchestrator.js +208 -0
  82. package/dist-electron/main/services/orchestrator.js.map +1 -0
  83. package/dist-electron/main/services/platformAssets.js +45 -0
  84. package/dist-electron/main/services/platformAssets.js.map +1 -0
  85. package/dist-electron/main/services/settingsDefaults.js +80 -0
  86. package/dist-electron/main/services/settingsDefaults.js.map +1 -0
  87. package/dist-electron/main/services/transcriptMarkdown.js +175 -0
  88. package/dist-electron/main/services/transcriptMarkdown.js.map +1 -0
  89. package/dist-electron/main/spawn.js +74 -0
  90. package/dist-electron/main/spawn.js.map +1 -0
  91. package/dist-electron/main/store.js +94 -0
  92. package/dist-electron/main/store.js.map +1 -0
  93. package/dist-electron/main/supabase.js +148 -0
  94. package/dist-electron/main/supabase.js.map +1 -0
  95. package/dist-electron/main/transcript/captionExtractor.js +455 -0
  96. package/dist-electron/main/transcript/captionExtractor.js.map +1 -0
  97. package/dist-electron/main/transcript/circuitBreaker.js +37 -0
  98. package/dist-electron/main/transcript/circuitBreaker.js.map +1 -0
  99. package/dist-electron/main/transcript/markdownFormatter.js +124 -0
  100. package/dist-electron/main/transcript/markdownFormatter.js.map +1 -0
  101. package/dist-electron/main/transcript/transcriptCache.js +51 -0
  102. package/dist-electron/main/transcript/transcriptCache.js.map +1 -0
  103. package/dist-electron/main/transcript/transcriptError.js +45 -0
  104. package/dist-electron/main/transcript/transcriptError.js.map +1 -0
  105. package/dist-electron/main/transcript/transcriptHandlers.js +74 -0
  106. package/dist-electron/main/transcript/transcriptHandlers.js.map +1 -0
  107. package/dist-electron/main/transcript/transcriptTypes.js +2 -0
  108. package/dist-electron/main/transcript/transcriptTypes.js.map +1 -0
  109. package/dist-electron/main/updater.js +253 -0
  110. package/dist-electron/main/updater.js.map +1 -0
  111. package/dist-electron/main/utils.js +108 -0
  112. package/dist-electron/main/utils.js.map +1 -0
  113. package/dist-electron/preload/index.js +93 -0
  114. package/dist-electron/preload/index.js.map +1 -0
  115. package/dist-electron/shared/types.js +2 -0
  116. package/dist-electron/shared/types.js.map +1 -0
  117. package/package.json +117 -0
package/README.md ADDED
@@ -0,0 +1,373 @@
1
+ # 🌊 Flucto
2
+
3
+ <p align="center">
4
+ Flucto - creator-first desktop media downloader and caption-to-Markdown exporter for short-form and long-form captures.
5
+ </p>
6
+
7
+ <p align="center">
8
+ <a href="https://github.com/DeclanJeon/flucto/releases"><img src="https://img.shields.io/github/v/release/DeclanJeon/flucto?style=flat&color=5865F2&label=Download&logo=github" alt="Download"></a>
9
+ <a href="#"><img src="https://img.shields.io/badge/Platform-Windows%20%7C%20macOS%20%7C%20Linux-007ACC?style=flat&logo=linux&logoColor=white" alt="Platform"></a>
10
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-10B981?style=flat" alt="License"></a>
11
+ <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-100%25-3178C6?style=flat&logo=typescript&logoColor=white" alt="TypeScript"></a>
12
+ </p>
13
+
14
+ <p align="center">
15
+ <img src="src/renderer/public/logo.svg" width="128" height="128" alt="Flucto wave download logo" />
16
+ </p>
17
+
18
+
19
+ > Flucto is an open-source desktop application for creators and curators who want one flowing way to capture media and turn available captions into Markdown notes from YouTube, X, Reddit, Bilibili, Instagram, Threads, TikTok, and Vimeo.
20
+
21
+ - ✨ **Stunning UI**: Apple-inspired dark mode with glassmorphism & smooth animations
22
+ - 🌍 **Universal Support**: Download from YouTube, X, Reddit, Bilibili, Instagram, Threads, TikTok, Vimeo
23
+ - 📝 **Caption to Markdown**: Convert available subtitles/captions into clean `.md` files with metadata and timestamps
24
+ - 📦 **Batch Processing**: Import `.txt` lists to download media or convert caption queues automatically
25
+ - ⚡ **Auto-Setup**: Automatically fetches and configures `yt-dlp` and `ffmpeg` binaries
26
+ - 🔒 **Privacy First**: No tracking, local processing, and proxied thumbnail loading
27
+ - 🎵 **Format Choice**: Save video (MP4), audio extraction (MP3), or Markdown transcript output
28
+ - 🛡️ **Type Safe**: Built with 100% TypeScript for stability and reliability
29
+
30
+ <p align="center">
31
+ <img src="assets/demo/flucto-channel-to-md.gif" width="100%" alt="Flucto CLI demo: channel to Markdown" />
32
+ </p>
33
+
34
+ <p align="center"><em>CLI demo — one channel → many Markdown notes in a dedicated job folder</em></p>
35
+
36
+ - [Report Bug](https://github.com/DeclanJeon/flucto/issues)
37
+
38
+ ## Key Features
39
+
40
+ - **Smart Media Engine:** Flucto parses single video, playlist, and social-media URLs while sharing platform-specific `yt-dlp` headers, referers, and retry behavior across preview, download, and transcript flows.
41
+ - **Extensible Platform Architecture:** Plugin-based `PlatformAdapter` system — adding a new platform is one file. Supports yt-dlp-based platforms, custom API extraction, and browser-based fallback strategies.
42
+ - **Caption-to-Markdown Conversion:** Uses `yt-dlp` subtitle/caption output when available, parses JSON3, XML/SRV3, and VTT captions, cleans caption markup, groups nearby captions into readable paragraphs, and writes filesystem-safe `.md` files.
43
+ - **Transcript Options:** Default new Markdown conversions to English captions (`en`) while still allowing `Auto` or a concrete caption language, include/exclude timestamps and metadata, choose paragraph gap rules, save Markdown files, and optionally copy generated Markdown to the clipboard.
44
+ - **Batch Queue System:** Supports loading hundreds of URLs via text files. Batch media downloads and batch transcript conversions both use bounded concurrency so large queues remain responsive.
45
+ - **Download History:** Records output type (`mp4`, `mp3`, or `md`) so media downloads and Markdown conversions stay visible in history.
46
+ - **Zero Configuration:** Unlike other GUI wrappers, Flucto includes a `setup-binaries` script that automatically downloads the correct version of `yt-dlp` and `ffmpeg` for your OS upon installation.
47
+ - **Network Resilience:** Implements retry logic, updater metadata checks, and transcript circuit-breaker behavior for unstable connections, rate limits, and unavailable caption sources.
48
+
49
+ ## Brand
50
+
51
+ Flucto's logo is a wave-download mark: the `🌊` idea reshaped into a cyan-to-violet flow that curls like a wave and lands as a download arrow. The mark is used consistently across the packaged app icon, favicon, Apple touch icon, web manifest, and social preview card.
52
+
53
+ Brand assets live in:
54
+
55
+ | Asset | Path |
56
+ | --- | --- |
57
+ | App icon source | `assets/icon.png` |
58
+ | Windows icon | `assets/icon.ico` |
59
+ | Web logo | `src/renderer/public/logo.svg` |
60
+ | Favicon | `src/renderer/public/favicon.svg` |
61
+ | Social preview | `src/renderer/public/og-image.svg` |
62
+ | Brand source of truth | `DESIGN.md` |
63
+
64
+
65
+ ## Output Modes
66
+
67
+ | Mode | What it creates | Best for |
68
+ | --- | --- | --- |
69
+ | `MP4` | Video files from supported URLs | Archiving videos, clips, playlists, and social media posts |
70
+ | `MP3` | Extracted audio files | Podcasts, lectures, music, and offline listening |
71
+ | `MD` | Markdown transcript files from available captions/subtitles | Research notes, summaries, quote extraction, and searchable archives |
72
+
73
+ Markdown conversion is caption-based. If a platform or video does not expose captions/subtitles through `yt-dlp`, Flucto reports the transcript as unavailable instead of silently falling back to speech-to-text. No Python/FastAPI server, Whisper runtime, or external transcription service is embedded.
74
+
75
+ ## CLI Mode
76
+
77
+ Flucto ships `flucto` and the shorter `fl` command for automation, batch jobs, and AI-agent workflows. The CLI uses the same TypeScript service layer as the desktop app; it does not launch the Electron window and does not call desktop IPC handlers.
78
+
79
+ ### Demo: channel → Markdown
80
+
81
+ ![flucto channel to-md demo](assets/demo/flucto-channel-to-md.gif)
82
+
83
+ ```bash
84
+ # Real command (creates a dedicated job folder under --out)
85
+ flucto channel to-md "@LIFECODEofficial" --limit 100 --out ./notes
86
+ # → ./notes/<channel>-channel-md-<timestamp>/001_….md …
87
+ ```
88
+
89
+ Demo assets: `assets/demo/flucto-channel-to-md.gif`, `assets/demo/flucto-channel-to-md.mp4`
90
+ (MP4 is used for Threads / social video posts; GIF for README embeds.)
91
+
92
+ ### Build and run locally
93
+
94
+ ```bash
95
+ npm install
96
+ npm run build:electron
97
+ npm link
98
+ fl h
99
+ fl doc
100
+ ```
101
+
102
+ `npm link` registers the local build as both `flucto` and `fl`. Without linking, use `npm run cli -- --help` from the project root.
103
+
104
+ Packaged releases expose both commands through `package.json`'s `bin` entry. Short command aliases are available for common flows.
105
+
106
+ ### Commands
107
+
108
+ | Command | Short form | Purpose | Typical output |
109
+ | --- | --- | --- | --- |
110
+ | `flucto doctor` | `fl doc` | Verify `yt-dlp` and `ffmpeg` discovery | Binary paths and versions |
111
+ | `flucto setup` | `fl s` | Provision missing managed `yt-dlp` and `ffmpeg` binaries | Setup status, paths, versions, and fix guidance |
112
+ | `flucto info <url>` | `fl i <url>` | Read media metadata | id, title, thumbnail, duration, uploader, view count |
113
+ | `flucto formats <url>` | `fl f <url>` | List downloadable formats | format id, extension, resolution, note |
114
+ | `flucto download <url>` | `fl d <url>` | Download MP4 video or MP3 audio | Generated media file |
115
+ | `flucto languages <url>` | `fl l <url>` | List available caption languages | language code/name and auto/manual flag |
116
+ | `flucto transcript <url>` | `fl t <url>` | Convert available captions/subtitles to Markdown | `.md` file or stdout Markdown |
117
+ | `flucto md <url>` | `fl md <url>` | Download media and convert to Markdown in one step | `.md` file with metadata + transcript |
118
+ | `flucto update check` | `fl u check` | Check GitHub releases for a newer Flucto version | Current/latest version and recommended asset |
119
+ | `flucto update download` | `fl u download` | Download the recommended GitHub release asset | Downloaded asset path and checksum status |
120
+ | `flucto update apply` | `fl u apply` | Apply an already downloaded asset when safe | Conservative apply result or manual install instructions |
121
+
122
+ Short option aliases: `-j` = `--json`, `-p` = `--progress-json`, `-f` = `--format`, `-q` = `--quality`, `-a` = `--audio-quality`, `-l` = `--language`, `-s` = `--stdout`, `-o` = `--output-dir`, and `-c` = `--concurrency`.
123
+
124
+
125
+ ### Common examples
126
+
127
+ ```bash
128
+ # Check bundled or configured binaries
129
+ fl doc -j
130
+
131
+ # Provision managed binaries without touching system package managers
132
+ fl s -j
133
+ fl s --check-only --bin-dir ./bin -j
134
+
135
+ # Inspect a media URL before downloading
136
+ fl i "https://www.youtube.com/watch?v=..." -j
137
+ fl f "https://www.youtube.com/watch?v=..."
138
+
139
+ # Download video or audio
140
+ fl d "https://www.youtube.com/watch?v=..." -f mp4 -o ./captures -j
141
+ fl d "https://www.threads.com/@user/post/ABC" -f mp4 -o ./captures
142
+ fl d "https://www.tiktok.com/@user/video/123" -f mp4 -o ./captures
143
+ fl l "https://www.youtube.com/watch?v=..." -j
144
+ fl t "https://www.youtube.com/watch?v=..." -l en -o ./notes -j
145
+ fl t "https://www.youtube.com/watch?v=..." -l auto -s > transcript.md
146
+
147
+ # Whole channel → Markdown notes (capped by --limit; dedicated job folder under --out)
148
+ fl channel to-md "@LIFECODEofficial" --limit 100 -o ./notes
149
+ flucto channel to-md "https://www.youtube.com/@learn-ai-lab" --limit 20 -o ./notes -l ko -c 2
150
+
151
+ # Process URL lists (also creates a dedicated job subfolder under the base output dir)
152
+ fl b urls.txt -f mp4 -c 2 -o ./captures -j
153
+ fl b urls.txt -f md -c 2 -o ./notes -j
154
+
155
+
156
+ # Check and download GitHub release updates from CLI
157
+ fl u check -j
158
+ fl u download -o ~/Downloads -j
159
+ fl u apply --asset ~/Downloads/Flucto-1.9.2-x86_64.AppImage -j
160
+ ```
161
+
162
+ `batch` files are plain text. Empty lines and lines starting with `#`, `;`, or `]` are ignored, so URL lists can contain comments:
163
+
164
+ ```text
165
+ # research clips
166
+ https://www.youtube.com/watch?v=...
167
+ https://samplelib.com/lib/preview/mp4/sample-5s.mp4
168
+ ```
169
+
170
+ ### Output and automation rules
171
+
172
+ - `--json` / `-j`: writes the final result object to stdout.
173
+ - `--progress-json` / `-p`: writes progress events as newline-delimited JSON to stderr.
174
+ - Human progress messages are written to stderr when `--progress-json` is not set.
175
+ - `--stdout` / `-s` on `transcript` writes Markdown content to stdout instead of only saving a file.
176
+ - **Multi-file jobs** (`batch`, `channel to-md`) always create a **dedicated subfolder** under `--output-dir` / `--out` (or the current working directory). Files are never dumped loose into the base path.
177
+ - Channel example: `./notes/라이프코드_LIFECODE-channel-md-20260710-143012/001_….md`
178
+ - Batch example: `./captures/urls-batch-mp4-20260710-143012/….mp4`
179
+ - JSON results for multi-file jobs include the resolved `outputDir` (the job folder).
180
+ - Non-zero exit codes indicate command failure; the JSON response includes the error message when `--json` is set.
181
+
182
+ ### Binary and output configuration
183
+
184
+ Flucto bundles `yt-dlp` and `ffmpeg` for the desktop release. The CLI also supports `fl s`, which provisions missing managed binaries without mutating system package managers.
185
+
186
+ ```bash
187
+ fl doc --bin-dir /opt/flucto/bin -j
188
+ fl d "$URL" --yt-dlp /usr/local/bin/yt-dlp --ffmpeg /usr/local/bin/ffmpeg
189
+ ```
190
+
191
+ Useful settings:
192
+
193
+ - `--output-dir DIR`: write generated media or Markdown files to `DIR`.
194
+ - `FLUCTO_OUTPUT_DIR`: default output directory when `--output-dir` is omitted.
195
+ - `--bin-dir DIR`: directory containing both `yt-dlp` and `ffmpeg`.
196
+ - `--yt-dlp PATH`, `--ffmpeg PATH`: explicit binary paths.
197
+ - `FLUCTO_BIN_DIR`: default managed binary directory override for `flucto setup`.
198
+
199
+ Managed binary defaults:
200
+
201
+ | OS | Default managed bin directory |
202
+ | --- | --- |
203
+ | Linux | `~/.local/share/flucto/bin` or `$XDG_DATA_HOME/flucto/bin` |
204
+ | macOS | `~/Library/Application Support/Flucto/bin` |
205
+ | Windows | `%LOCALAPPDATA%\\Flucto\\bin` |
206
+
207
+ Resolution order is explicit paths, environment paths, `--bin-dir`, managed bin directory, package-local `bin/`, module-relative `bin/`, then system `PATH`.
208
+
209
+
210
+ ### CLI updates
211
+
212
+ The desktop app continues to use Electron's auto-updater. CLI update commands use GitHub releases directly:
213
+
214
+ ```bash
215
+ flucto update check --json
216
+ flucto update download --output-dir ~/Downloads --json
217
+ flucto update apply --asset ~/Downloads/Flucto-1.9.2-x86_64.AppImage --json
218
+ ```
219
+
220
+ `check` and `download` are safe automation commands. `apply` is intentionally conservative: unsupported install modes return manual installation instructions instead of silently overwriting application files. When a release includes `checksums-sha256.txt`, downloaded assets are verified before the command reports success.
221
+
222
+ ### Current limitations
223
+
224
+ - Markdown conversion is caption-based. If the platform/video does not expose captions through `yt-dlp`, Flucto reports the transcript as unavailable; it does not run Whisper or another speech-to-text engine.
225
+ - Some platforms, including YouTube, can return media-download `403`/rate-limit/cookie errors while still allowing metadata, format, language, or caption reads. In that case the CLI returns a structured error instead of silently retrying with credentials.
226
+ - Direct media URLs from generic extractors are supported by the `v1.9.1` MP4 selector fallback.
227
+
228
+ ## Recent Updates
229
+
230
+ ### v1.12.0
231
+
232
+ - **Threads Support:** Added Threads (threads.com/threads.net) video download via dedicated `threadsdl.app` API extraction, bypassing yt-dlp.
233
+ - **Extensible Platform Architecture:** Refactored platform-specific code into a plugin-based `PlatformAdapter` system with `PlatformRegistry`, `MediaOrchestrator`, and typed error handling (`PlatformError`).
234
+ - **New Platforms:** Added TikTok and Vimeo adapters (yt-dlp-based).
235
+ - **Markdown Pipeline:** Added `MarkdownPipeline` service and `flucto md` CLI command for direct URL-to-Markdown conversion.
236
+ - **Platform Adapters:** YouTube, Twitter/X, Instagram, Reddit, Bilibili, Threads, TikTok, Vimeo — each as a single adapter file.
237
+
238
+ ### Next
239
+ ### v1.9.1
240
+
241
+ - Fixed CLI MP4 downloads for generic direct media URLs where `yt-dlp` exposes a literal `mp4` format id instead of YouTube-style `bestvideo`/`bestaudio` formats.
242
+ - Verified real CLI flows for binary discovery, metadata, format listing, caption language listing, caption-to-Markdown conversion, generic MP4 download, and generated artifact cleanup.
243
+
244
+ ### v1.9.0
245
+
246
+ - Added first-class `flucto` CLI mode for automation and AI-agent workflows.
247
+ - Added CLI commands for `doctor`, `info`, `formats`, `download`, `languages`, `transcript`, and `batch`.
248
+ - Reused the desktop TypeScript service layer without launching Electron or importing desktop IPC handlers.
249
+ - Added JSON output and NDJSON progress streams for script-friendly automation.
250
+
251
+ ### v1.7.1
252
+
253
+ - Fixed Linux `.deb` updater metadata so installed Debian/Ubuntu builds can select the `.deb` update asset instead of failing inside `DebUpdater`.
254
+ - Refreshed update metadata before manual app-update downloads so stale update checks do not trigger `electron-updater` provider-cache errors.
255
+
256
+ ### v1.7.0
257
+
258
+ - Added Markdown transcript output mode next to MP4 and MP3.
259
+ - Added transcript language selection, timestamp/metadata toggles, paragraph gap control, file saving, and clipboard copy options.
260
+ - Added JSON3, XML/SRV3, and VTT caption parsing for `yt-dlp` subtitle outputs.
261
+ - Added transcript progress UI for analyzing, extracting, formatting, saving, and completion/error states.
262
+ - Added `md` entries to download history so generated Markdown files remain visible after conversion.
263
+
264
+ ## 📦 CI/CD & Automated Releases
265
+
266
+ Flucto uses GitHub Actions and semantic-release for automated CI/CD:
267
+
268
+ - **Automatic Versioning**: Semantic versioning based on Conventional Commit types
269
+ - **Generated Release Notes**: `feat`, `fix`, and breaking-change commits become GitHub Release notes and `CHANGELOG.md` entries
270
+ - **Multi-Platform Builds**: Windows, macOS, and Linux binaries built automatically
271
+ - **Auto-Release**: New GitHub releases created on push to main/master branch
272
+
273
+ ### Commit Conventions
274
+
275
+ Follow [Conventional Commits](./COMMIT_CONVENTIONS.md) to trigger automatic releases. Keep commit subjects release-note ready because they are copied into GitHub Releases and `CHANGELOG.md`.
276
+
277
+ ```bash
278
+ # Feature release
279
+ git commit -m "feat(transcript): add caption-to-markdown output mode"
280
+
281
+ # Bug fix release
282
+ git commit -m "fix(updater): publish deb updater metadata"
283
+
284
+ # Breaking change release
285
+ git commit -m "feat!: redesign download request API"
286
+ ```
287
+
288
+ For user-facing changes, include concrete behavior in the commit subject or body: supported output modes, parser formats, UI controls, platform-specific updater behavior, and known limitations. See [COMMIT_CONVENTIONS.md](./COMMIT_CONVENTIONS.md) for full guidelines.
289
+
290
+ ## How to get started (Development)
291
+
292
+ 1. **Clone the repository** to your local machine.
293
+ ```bash
294
+ git clone https://github.com/DeclanJeon/flucto.git
295
+ cd flucto
296
+ ```
297
+
298
+ 2. **Install dependencies**
299
+
300
+ ```bash
301
+ npm install
302
+ ```
303
+
304
+ 3. **Setup Binaries** - This script will detect your OS and download the required `yt-dlp` and `ffmpeg` binaries to the `/bin` directory.
305
+
306
+ ```bash
307
+ npm run postinstall
308
+ ```
309
+
310
+ 4. **Set Supabase environment variables** before running forum features
311
+
312
+ ```bash
313
+ cp .env.example .env
314
+ ```
315
+
316
+ Required values:
317
+
318
+ - `SUPABASE_URL`
319
+ - `SUPABASE_PUBLISHABLE_KEY` (or `SUPABASE_ANON_KEY`)
320
+ - `SUPABASE_SERVICE_ROLE_KEY` (optional)
321
+
322
+ You can verify Supabase auth/RLS write behavior with:
323
+
324
+ ```bash
325
+ npm run supabase:smoke
326
+ ```
327
+
328
+ 5. **Start the development server** - This runs both the Vite renderer and the Electron main process concurrently.
329
+
330
+ ```bash
331
+ npm run dev
332
+ ```
333
+
334
+ ## Architecture & Tech Stack
335
+
336
+ Flucto is built with a modern stack prioritizing performance and developer experience:
337
+
338
+ - **Runtime**: Electron + Node.js
339
+ - **Frontend**: React 19, Tailwind CSS v4, Framer Motion
340
+ - **Language**: TypeScript (Strict Mode)
341
+ - **Core Engine**: `yt-dlp` (Python backend), `ffmpeg` (Media processing)
342
+ - **Build Tooling**: Vite, Electron-Builder, Rolldown
343
+ - **State Management**: React Hooks (`useDownloader`, `useDownloadMonitor`)
344
+
345
+ ## Build for Distribution
346
+
347
+ To create installers for your platform (NSIS for Windows, DMG for macOS, AppImage for Linux):
348
+
349
+ ```bash
350
+ # Build the renderer and main process
351
+ npm run build
352
+
353
+ # Package the application
354
+ npm run dist
355
+ ```
356
+
357
+ ## Contributing
358
+
359
+ Contributions are welcome! Whether it's fixing bugs, improving the documentation, or proposing new features.
360
+
361
+ 1. Fork the Project
362
+ 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
363
+ 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
364
+ 4. Push to the Branch (`git push origin feature/AmazingFeature`)
365
+ 5. Open a Pull Request
366
+
367
+ ## License
368
+
369
+ Distributed under the MIT License. See `LICENSE` for more information.
370
+
371
+ <p align="center">
372
+ <strong>Made with ❤️ by Flucto Team</strong>
373
+ </p>
@@ -0,0 +1,209 @@
1
+ import { parseArgs } from 'util';
2
+ const videoQualities = new Set(['4k', '1440p', '1080p', '720p', '480p', '360p', 'worst']);
3
+ const audioQualities = new Set(['320kbps', '256kbps', '192kbps', '128kbps', '64kbps', 'worst']);
4
+ const mediaFormats = new Set(['mp4', 'mp3', 'md']);
5
+ const commandAliases = {
6
+ download: 'download',
7
+ d: 'download',
8
+ batch: 'batch',
9
+ b: 'batch',
10
+ transcript: 'transcript',
11
+ t: 'transcript',
12
+ md: 'md',
13
+ m: 'md',
14
+ 'channel-to-md': 'channel-to-md',
15
+ channel: 'channel',
16
+ info: 'info',
17
+ i: 'info',
18
+ formats: 'formats',
19
+ f: 'formats',
20
+ languages: 'languages',
21
+ l: 'languages',
22
+ doctor: 'doctor',
23
+ doc: 'doctor',
24
+ setup: 'setup',
25
+ s: 'setup',
26
+ update: 'update',
27
+ u: 'update',
28
+ help: 'help',
29
+ h: 'help',
30
+ version: 'version',
31
+ v: 'version',
32
+ };
33
+ const commands = new Set(Object.keys(commandAliases));
34
+ export class CliUsageError extends Error {
35
+ exitCode = 1;
36
+ }
37
+ const stringOption = (value) => {
38
+ return typeof value === 'string' && value.trim() ? value.trim() : undefined;
39
+ };
40
+ const booleanOption = (value) => {
41
+ return value === true;
42
+ };
43
+ const parseConcurrency = (value, fallback = 2) => {
44
+ const raw = stringOption(value);
45
+ if (!raw)
46
+ return fallback;
47
+ const parsed = Number.parseInt(raw, 10);
48
+ if (!Number.isInteger(parsed) || parsed < 1 || parsed > 16) {
49
+ throw new CliUsageError('--concurrency must be an integer from 1 to 16.');
50
+ }
51
+ return parsed;
52
+ };
53
+ const parseLimit = (value, fallback) => {
54
+ const raw = stringOption(value);
55
+ if (!raw)
56
+ return fallback;
57
+ const parsed = Number.parseInt(raw, 10);
58
+ if (!Number.isInteger(parsed) || parsed < 1 || parsed > 5000) {
59
+ throw new CliUsageError('--limit must be an integer from 1 to 5000.');
60
+ }
61
+ return parsed;
62
+ };
63
+ const parseFormat = (value, fallback) => {
64
+ const raw = stringOption(value) ?? fallback;
65
+ if (!mediaFormats.has(raw)) {
66
+ throw new CliUsageError('--format must be one of mp4, mp3, md.');
67
+ }
68
+ return raw;
69
+ };
70
+ const parseVideoQuality = (value) => {
71
+ const raw = stringOption(value) ?? '1080p';
72
+ if (!videoQualities.has(raw)) {
73
+ throw new CliUsageError('--quality must be one of 4k, 1440p, 1080p, 720p, 480p, 360p, worst.');
74
+ }
75
+ return raw;
76
+ };
77
+ const parseAudioQuality = (value) => {
78
+ const raw = stringOption(value) ?? '320kbps';
79
+ if (!audioQualities.has(raw)) {
80
+ throw new CliUsageError('--audio-quality must be one of 320kbps, 256kbps, 192kbps, 128kbps, 64kbps, worst.');
81
+ }
82
+ return raw;
83
+ };
84
+ export const parseCliArgs = (argv) => {
85
+ const parsed = parseArgs({
86
+ args: argv,
87
+ allowPositionals: true,
88
+ options: {
89
+ help: { type: 'boolean', short: 'h' },
90
+ version: { type: 'boolean', short: 'v' },
91
+ json: { type: 'boolean', short: 'j' },
92
+ 'progress-json': { type: 'boolean', short: 'p' },
93
+ format: { type: 'string', short: 'f' },
94
+ quality: { type: 'string', short: 'q' },
95
+ 'audio-quality': { type: 'string', short: 'a' },
96
+ 'output-dir': { type: 'string', short: 'o' },
97
+ out: { type: 'string' },
98
+ 'bin-dir': { type: 'string' },
99
+ 'yt-dlp': { type: 'string' },
100
+ ffmpeg: { type: 'string' },
101
+ language: { type: 'string', short: 'l' },
102
+ timestamps: { type: 'boolean' },
103
+ 'no-timestamps': { type: 'boolean' },
104
+ metadata: { type: 'boolean' },
105
+ 'no-metadata': { type: 'boolean' },
106
+ stdout: { type: 'boolean', short: 's' },
107
+ concurrency: { type: 'string', short: 'c' },
108
+ cookies: { type: 'string' },
109
+ 'cookies-from-browser': { type: 'string' },
110
+ proxy: { type: 'string' },
111
+ impersonate: { type: 'string' },
112
+ limit: { type: 'string' },
113
+ force: { type: 'boolean' },
114
+ 'check-only': { type: 'boolean' },
115
+ 'yt-dlp-only': { type: 'boolean' },
116
+ asset: { type: 'string' },
117
+ },
118
+ });
119
+ if (booleanOption(parsed.values.version)) {
120
+ return baseOptions('version', [], parsed.values);
121
+ }
122
+ if (booleanOption(parsed.values.help) || parsed.positionals.length === 0) {
123
+ return baseOptions('help', parsed.positionals, parsed.values);
124
+ }
125
+ let [rawCommand, ...positional] = parsed.positionals;
126
+ // Nested: flucto channel to-md <url>
127
+ if (rawCommand === 'channel') {
128
+ const sub = positional[0];
129
+ if (sub === 'to-md' || sub === 'tomd' || sub === 'md') {
130
+ rawCommand = 'channel-to-md';
131
+ positional = positional.slice(1);
132
+ }
133
+ else {
134
+ throw new CliUsageError('channel subcommand must be: to-md');
135
+ }
136
+ }
137
+ const command = commandAliases[rawCommand];
138
+ if (!command || command === 'channel' || !commands.has(rawCommand)) {
139
+ throw new CliUsageError(`Unknown command: ${rawCommand}`);
140
+ }
141
+ const options = baseOptions(command, positional, parsed.values);
142
+ validateCommand(options);
143
+ return options;
144
+ };
145
+ const baseOptions = (command, positional, values) => {
146
+ const format = parseFormat(values.format, command === 'batch' ? 'mp4' : 'mp4');
147
+ const concurrencyFallback = (command === 'channel-to-md'
148
+ || (command === 'batch' && format === 'md')) ? 1 : 2;
149
+ return {
150
+ command,
151
+ positional,
152
+ json: booleanOption(values.json),
153
+ progressJson: booleanOption(values['progress-json']),
154
+ format,
155
+ quality: parseVideoQuality(values.quality),
156
+ audioQuality: parseAudioQuality(values['audio-quality']),
157
+ outputDir: stringOption(values['output-dir']) ?? stringOption(values.out) ?? process.env.FLUCTO_OUTPUT_DIR,
158
+ binDir: stringOption(values['bin-dir']),
159
+ ytDlpPath: stringOption(values['yt-dlp']),
160
+ ffmpegPath: stringOption(values.ffmpeg),
161
+ language: stringOption(values.language) ?? 'en',
162
+ timestamps: booleanOption(values.timestamps) ? true : booleanOption(values['no-timestamps']) ? false : undefined,
163
+ metadata: booleanOption(values.metadata) ? true : booleanOption(values['no-metadata']) ? false : undefined,
164
+ stdout: booleanOption(values.stdout),
165
+ concurrency: parseConcurrency(values.concurrency, concurrencyFallback),
166
+ limit: parseLimit(values.limit, 100),
167
+ force: booleanOption(values.force),
168
+ checkOnly: booleanOption(values['check-only']),
169
+ ytDlpOnly: booleanOption(values['yt-dlp-only']),
170
+ updateAction: parseUpdateAction(command, positional),
171
+ assetPath: stringOption(values.asset),
172
+ cookies: stringOption(values.cookies),
173
+ cookiesFromBrowser: stringOption(values['cookies-from-browser']),
174
+ proxy: stringOption(values.proxy),
175
+ impersonate: stringOption(values.impersonate),
176
+ };
177
+ };
178
+ const parseUpdateAction = (command, positional) => {
179
+ if (command !== 'update')
180
+ return 'check';
181
+ const action = positional[0] ?? 'check';
182
+ if (action === 'check' || action === 'download' || action === 'apply')
183
+ return action;
184
+ throw new CliUsageError('update action must be one of check, download, apply.');
185
+ };
186
+ const validateCommand = (options) => {
187
+ if (['download', 'transcript', 'md', 'info', 'formats', 'languages'].includes(options.command) && options.positional.length !== 1) {
188
+ throw new CliUsageError(`${options.command} requires exactly one URL.`);
189
+ }
190
+ if (options.command === 'channel-to-md' && options.positional.length !== 1) {
191
+ throw new CliUsageError('channel to-md requires exactly one channel URL or @handle.');
192
+ }
193
+ if (options.command === 'batch' && options.positional.length !== 1) {
194
+ throw new CliUsageError('batch requires exactly one file path.');
195
+ }
196
+ if (options.command === 'update') {
197
+ const expected = options.updateAction === 'check' ? [0, 1] : [1];
198
+ if (!expected.includes(options.positional.length)) {
199
+ throw new CliUsageError(`update ${options.updateAction} received unexpected arguments.`);
200
+ }
201
+ }
202
+ if (options.command === 'download' && options.format === 'md') {
203
+ throw new CliUsageError('download supports only mp4 or mp3. Use transcript, channel to-md, or batch --format md for Markdown.');
204
+ }
205
+ if (options.command === 'transcript' && options.format !== 'mp4') {
206
+ throw new CliUsageError('transcript does not accept --format.');
207
+ }
208
+ };
209
+ //# sourceMappingURL=args.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAiDjC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1F,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAChG,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AACnD,MAAM,cAAc,GAA2C;IAC7D,QAAQ,EAAE,UAAU;IACpB,CAAC,EAAE,UAAU;IACb,KAAK,EAAE,OAAO;IACd,CAAC,EAAE,OAAO;IACV,UAAU,EAAE,YAAY;IACxB,CAAC,EAAE,YAAY;IACf,EAAE,EAAE,IAAI;IACR,CAAC,EAAE,IAAI;IACP,eAAe,EAAE,eAAe;IAChC,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,CAAC,EAAE,MAAM;IACT,OAAO,EAAE,SAAS;IAClB,CAAC,EAAE,SAAS;IACZ,SAAS,EAAE,WAAW;IACtB,CAAC,EAAE,WAAW;IACd,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,QAAQ;IACb,KAAK,EAAE,OAAO;IACd,CAAC,EAAE,OAAO;IACV,MAAM,EAAE,QAAQ;IAChB,CAAC,EAAE,QAAQ;IACX,IAAI,EAAE,MAAM;IACZ,CAAC,EAAE,MAAM;IACT,O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