$ show yutto-dev/yutto
yutto is a production-grade CLI application for downloading videos, subtitles, danmaku (bullet comments), and metadata from Bilibili. In production it resolves user-supplied URLs (UGC videos, bangumi anime, paid cheese courses, favourites, collections, watch-later lists) against Bilibili's private JSON APIs, normalizes responses into typed Pydantic download requests, and runs a planner/executor pipeline: immutable DownloadPlan construction (output paths, codec/quality selection), concurrent range-based downloading, FFmpeg muxing, and writing of NFO/SRT/ASS artifacts. It also ships an experimental WebSocket JSON-RPC server mode (`yutto serve`) for remote task submission, querying, cancellation, and live event streaming with token authentication.
The LLM identified 4 files worth highlighting for reuse:
Core of the `haya` crate: a generic bounded, multi-source HTTP range download engine. It coordinates `RangeSource` providers (with failover), ordered buffer assembly, a shared `WorkerLimit` capacity pool, retries, cancellation, and commit-to-sink semantics via the `CommitSink` trait. Fully decoupled from yutto, permissively licensed, and covered by its own tests — it can be dropped into any project needing robust concurrent resumable downloads.
Rust library that converts Bilibili XML and protobuf danmaku (bullet-comment) streams into ASS subtitles. Handles special danmaku including Flash-rotation math, configurable filters and styling, and is published as its own standalone PyO3 package (`biliass`) independent of yutto. Reusable for any project that needs to ingest or render Bilibili comment data.
A generic in-process asynchronous task runtime with structured lifecycle events (`TaskState`, `TaskEvent`), bounded replayable event history, a shared sequence allocator, and cross-runtime worker capacity pooling. Well unit-tested and used by both download and resolve services; its decoupled design can be extracted as the foundation of other async job/worker systems.
Thin reqwest-based adapter implementing `haya`'s `RangeSource` trait for HTTP/HTTPS: exact-Range header handling, content-length probing, and error mapping. A clean example of bridging a generic download core to a concrete transport, and independently reusable as a standalone HTTP range-fetch client.