How imputnet/cobalt works
Cobalt is a browser-based downloader backed by an API that resolves public media links and provides download or streaming responses; it also supports client-side processing. The principal user flow is link submission, API request, then download, selection, or local processing. The web task manager coordinates fetch and FFmpeg workers, while settings and file storage support configurable and local workflows. The README describes the API as a non-caching proxy. Some internal API wiring is unsampled, so those call relationships are intentionally omitted.
Main entry points: saving-handler.ts Save handler · api.js API routing · api.ts API client · run-worker.ts Worker dispatch
Components 22
Web application
- Link entry
web/src/components/save/Omnibox.svelte - Save handler
web/src/lib/api/saving-handler.ts - API client
web/src/lib/api/api.ts - Download handling
web/src/lib/download.ts - Supported services
web/src/components/save/SupportedServices.svelte - Server information
web/src/lib/api/server-info.ts
API and services
- API entry
api/src/cobalt.js - API routing
api/src/core/api.js - Media request
api/src/processing/request.js - URL matching
api/src/processing/match.js - Service adapters
api/src/processing/services - Streaming proxy
api/src/stream/stream.js - Stream management
api/src/stream/manage.js - Request security
api/src/security - API storage
api/src/store/store.js
Local processing
- Task pipeline
web/src/lib/task-manager/queue.ts - Worker dispatch
web/src/lib/task-manager/run-worker.ts - Fetch worker
web/src/lib/task-manager/runners/fetch.ts - FFmpeg worker
web/src/lib/task-manager/runners/ffmpeg.ts
Client state
- Download settings
web/src/lib/state/settings.ts - Local file storage
web/src/lib/storage/index.ts
Other components
- User
Connections 22
- User → Link entry: enters link
- Link entry → Save handler: submits request
- Save handler → API client: sends request
- Save handler → Download settings: reads options
- API client → API routing: calls API
- Save handler → Download handling: starts download
- Save handler → Task pipeline: starts local job
- Task pipeline → Worker dispatch: dispatches tasks
- Worker dispatch → Fetch worker: runs fetch
- Worker dispatch → FFmpeg worker: runs conversion
- User → Supported services: views services
- Supported services → Server information: loads service list
- API client → API entry: sends API request
- API entry → API routing: routes request
- API routing → Request security: checks access
- API routing → Media request: handles media request
- Media request → URL matching: matches link
- URL matching → Service adapters: selects service
- API routing → Stream management: manages stream
- Stream management → Streaming proxy: dispatches stream
- API routing → API storage: uses storage
- Save handler → Local file storage: local processing files