$ show markcxx/coco-downloader
CoCo Downloader is a multi-platform music retrieval and acquisition tool with a web frontend (Next.js/React) and a desktop client (Python/PyQt5). It enables users to search, preview, and download music from multiple Chinese streaming services (QQ Music, NetEase Cloud Music, Kugou, etc.) by reverse-engineering their APIs and scraping their HTML. The architecture follows a monolithic design for each platform, with shared provider abstraction patterns but separate implementations. The web app exposes API routes that proxy requests to music providers, while the desktop client uses a similar pattern with Qt-based UI. Notable features include multi-quality downloads, playback with lyrics display, caching, and theme support. The repository demonstrates moderate engineering craftsmanship with clean provider interfaces but suffers from duplicated code across platforms, hardcoded and potentially brittle API parameters, and security concerns (exposed API keys). It is a functional hobbyist-grade application with a dedicated community (553 stars, 166 forks).
The LLM identified 2 files worth highlighting for reuse:
Abstract base class for music providers in the desktop app. Defines a common interface with methods like search(), get_play_info(), get_lyric(), etc. Subclasses implement provider-specific logic. This pattern isolates provider implementations and enables easy addition of new providers. The design is clean and could be reused in any scraper or multi-source aggregation project.
Custom HTTP client module with helper functions for JSON requests, POST requests, and URL resolution (following redirects). Includes robust error handling for timeouts and connection errors, content-type validation, safe JSON parsing, and file extension extraction from headers. This is a self-contained utility that can be extracted and used in any Python project requiring a resilient HTTP client.