Ghost Downloader
Architecture

Feature Pack System

How packs are discovered, loaded, ordered, and invoked.

Feature Packs are the capability decomposition mechanism in Ghost Downloader. app/services/feature_service.py scans the features directory for subdirectories containing manifest.toml, reads the entry file and dependencies, and then instantiates the matching pack class.

API Stability

This page documents internal implementation details, not a stable external plugin API. app/feature_pack and features/*_pack may still change together with the task model.

Loading Flow

StepDescription
DiscoveryFind features/<pack>/manifest.toml.
Manifest readLoad entry and dependencies from [pack].
Dependency orderingLoad packs in dependency order, for example media features may depend on FFmpeg.
InstantiationImport the Feature Pack class from the entry module.
UI registrationLoad settings cards if the pack provides any.
URL matchingAsk packs whether they can handle the current input during parsing.

Implementation Checklist

Checklist ItemWhere It Lands
Input coveragecanHandle or payload-based task creation logic.
Pack dependenciesdependencies in manifest.toml.
Task typeTask subclass, pause/resume behavior, persistence fields.
User configPackConfig, settings cards, defaults, and validators.
Error messagesReadable failure messages for parse failures, missing dependencies, or network errors.

Minimal Manifest Example

[pack]
entry = "pack.py"
dependencies = ["http_pack"]

A pack directory usually contains at least manifest.toml and an entry file. More complex packs may also include task.py, config.py, runtime helpers, or UI setting cards. In a PR, explain supported inputs, dependencies, pause support, and failure scenarios.

Related Entry Points

Entry PointPurpose
app/services/feature_service.pyDiscover and load packs.
app/feature_packCurrent shared Feature Pack base capabilities.
features/http_packThe easiest simple protocol pack to start reading.
features/m3u8_packA more complex pack that depends on external runtimes.
deploy.pyCopies Feature Packs into build outputs and currently excludes jack_yao.

On this page