How aninsomniacy/aria2-next works
Aria2 Next is a multi-protocol download engine with CLI, JSON-RPC, and embeddable-library interfaces. The main workflow is to accept a request, manage it as a task, dispatch it to a protocol-specific transfer path, write payload data, and retain resumable state and results. Major branches include HTTP(S)/SFTP, BitTorrent, ED2K, Metalink, and native HLS/DASH media. The graph combines README-documented capabilities with relationships visible in sampled source; unsampled wiring is left unasserted or marked unverified.
Main entry points: RequestGroup.h Download task · TaskManagerQueue.cc Task management · main.cc Engine executable · StreamStorage.cc HTTP stream transfer
Components 25
Engine and tasks
- Engine executable
src/main.cc - Options
src/option_processing.cc - Download engine
src/DownloadEngine.cc - Task management
src/task/TaskManagerQueue.cc - Download task
src/RequestGroup.h
Transfer protocols
- HTTP stream transfer
src/stream/StreamStorage.cc - Curl session
src/CurlSession.h - BitTorrent
src/bittorrent/BtSessionControl.cc - ED2K
src/ed2k/Ed2kCommandSupport.cc - Metalink
src/MetalinkParserController.cc
Interfaces and media
- JSON-RPC
src/rpc/TaskStatusMethods.cc - HLS/DASH media
src/media/MediaSession.cc
Payload and state
- Download context
src/DownloadContext.h - Piece storage
src/DefaultPieceStorage.cc - Task persistence
src/task/TaskStorage.cc - Session state
src/task/TaskManagerStorage.cc - Logging
src/Log.h - Shared utilities
src/a2functional.h - Message catalog
src/message.h
Other components
- CLI user
- RPC client
- libcurl
- libtorrent
- GPAC and FFmpeg
- Payload files
Connections 23
- CLI user → Engine executable: runs
- RPC client → JSON-RPC: calls methods
- Engine executable → Options: accepts options
- Engine executable → Download engine: starts engine
- Options → Task management: configures tasks
- Task management → Download task: manages tasks
src/task/TaskManagerQueue.cc - Download task → HTTP stream transfer: dispatches transfer
src/RequestGroup.h - HTTP stream transfer → Curl session: uses session
src/stream/StreamStorage.cc - HTTP stream transfer → libcurl: transfers via
- Download task → BitTorrent: supports transfer
src/bittorrent/BtSessionControl.cc - BitTorrent → libtorrent: uses native engine
- Download task → ED2K: supports transfer
- Download task → Metalink: supports metadata
- JSON-RPC → Task management: controls tasks
- Download task → HLS/DASH media: supports media tasks
- HLS/DASH media → libcurl: uses for transfers
- HLS/DASH media → GPAC and FFmpeg: uses libraries
- Download task → Download context: holds context
src/RequestGroup.h - Download context → Piece storage: tracks pieces
src/DefaultPieceStorage.cc - Piece storage → Payload files: writes payload
- Task management → Task persistence: stores task state
src/task/TaskManagerQueue.cc - Task persistence → Session state: persists session
src/task/TaskManagerStorage.cc - Download engine → Logging: logs events
src/DownloadEngine.cc