$ show manga-download/haruneko
HakuNeko is a cross-platform manga, anime, and novel downloader with a plugin-based architecture. It scrapes content from hundreds of websites using a decorator-driven pattern that allows declarative extraction of manga, chapters, and pages. The application supports multiple frontends (Svelte-based Classic and Fluent-core), desktop runtimes (Electron and NW.js), and includes features like bookmark management, download queues, image descrambling, DRM decryption, and anti-scraping evasion. The core engine provides reusable abstractions for task pooling, rate limiting, storage, and platform-specific IPC. While the codebase is large and actively maintained, it shows signs of technical drift through legacy stubs, hardcoded secrets, and fragile anti-scraping logic that requires constant updates as target websites change.
The LLM identified 4 files worth highlighting for reuse:
A generic task pool that manages concurrent execution with configurable concurrency limits, priority scheduling, and rate limiting. It is self-contained, depends only on standard promises and a RateLimit class, and can be extracted for any project needing throttled async operations.
A utility that descrambles images by reordering tiles on a canvas based on a permutation seed. It handles various scrambling patterns (row, column, grid) and is independent of the rest of the engine, making it reusable for any application that needs to reverse image scrambling.
Provides a unified interface for fetching data from websites using multiple strategies: JSON, CSS selectors, window script execution, GraphQL, and NextJS data. It abstracts away the underlying fetch mechanism and can be reused in any scraping project that needs to extract structured data from web pages.
A lightweight observable implementation that supports value, array, and map types with change notifications. It is self-contained and can be extracted for any frontend or backend application that needs simple reactive state management without a heavy framework.