$ show EstrellaXD/Auto_Bangumi
AutoBangumi is a fully automated anime download and organization tool. It subscribes to RSS feeds (Mikanani, etc.), downloads torrents via qBittorrent or Aria2, parses release titles to extract episode/metadata, renames and organizes files for media libraries (Plex, Jellyfin), and provides a web UI for management. The backend is a FastAPI application with async SQLite storage, background schedulers, and a multi-provider notification system. The frontend is a Vue 3 + TypeScript single-page app with a custom component library. The architecture employs clean abstraction layers for downloaders, notification providers, and LLM-based title parsing, with a state machine for durable rename operations and a secure online update mechanism. It is a well-engineered application with extensive test coverage (unit, integration, E2E with Playwright) and active development reflected in frequent releases and a robust CI pipeline.
The LLM identified 4 files worth highlighting for reuse:
A notification system with an abstract base class (NotificationProvider), a provider registry, and async broadcast to multiple channels (Telegram, Discord, Bark, etc.). Providers register themselves via a class decorator. The manager dispatches typed system events (RssFailureEvent, DownloadFailureEvent) to all configured providers. This pattern is self-contained and could be extracted for any application needing multi-channel async notifications.
A downloader abstraction using a Python protocol (DownloaderClient) with capability flags (can_query, can_rename, can_manage, can_rss_rules). Concrete implementations for qBittorrent and Aria2 each expose only supported operations. The pattern demonstrates clean interface design with runtime capability detection, enabling clients to adapt behavior without instanceof checks. Reusable for any application needing multiple backends with varying feature sets.
A tokenizer-based release title parser that extracts structured data (episode, season, resolution, group, etc.) through segment analysis and candidate resolution. It produces typed Observations and Candidates, resolves overlaps and conflicts via priority and shadow policies, and outputs a ParseTrace for diagnostics. The algorithm is non-obvious, highly modular, and could be extracted as a library for any domain-specific structured text parsing.
A durable state machine for file rename operations with states: planned, old_staged, new_promoted, old_removed, done, conflict, retry, running. It uses lease-based concurrency control (claim_replacement_lease, recover_stale_running) to fence across async boundaries. The repository pattern with atomic state transitions makes this a reusable saga implementation for any distributed file management workflow.