Architecture
Architecture Overview
The main boundaries in Ghost Downloader: UI, services, tasks, Feature Packs, and the browser bridge.
Ghost Downloader's architecture can be summarized in one sentence: the UI raises intent, CoreService schedules work, FeatureService selects the right capability, protocol logic stays inside features/*_pack, and the browser extension connects through BrowserService.
Architecture Boundaries
Protocol parsing belongs to Feature Packs, task scheduling belongs to CoreService, UI interaction belongs to app/view, and the browser bridge is an extension-facing local service rather than a public remote-control API.
Layers and Responsibilities
| Layer | Main Source | Responsibility |
|---|---|---|
| Entry | Ghost-Downloader-3.py | Logging, config loading, translation, service startup, window creation. |
| UI | app/view | Task list, settings page, dialogs, tray integration. |
| Services | app/services | Task scheduling, Feature Pack loading, browser bridge. |
| Models | app/bases/models.py | Task, TaskStage, state, and serialization. |
| Feature Packs | features/*_pack | Protocol parsing, download execution, external runtime integration. |
| Extension | browser_extension/app | Resource capture, extension UI, WebSocket requests. |
Core Data Flow
- A user action or browser extension submits a URL or payload.
CoreServiceasksFeatureServiceto choose a Feature Pack that can handle it.- The chosen Feature Pack creates a
Task. CoreServiceruns the task under concurrency limits.- The UI, extension, and
taskRecorderconsume task state updates.
