$ show recloudstream/cloudstream
CloudStream is an Android media aggregation application that streams and downloads movies, TV series, and anime via a plugin-based provider system. The app has no built-in content; all media sources are provided by community extensions implementing `MainAPI` and `ExtractorApi` interfaces. The architecture comprises a Kotlin Multiplatform library defining plugin APIs and an Android app with ExoPlayer/Media3 playback, download manager, sync with tracking services (MAL, AniList, Kitsu, Simkl, Trakt), multi-source subtitle fetching, Chromecast support, and adaptive phone/TV UI. Content acquisition relies on web scraping: over 100 built-in extractors parse video hosting sites, often using JavaScript deobfuscation (via a custom JS interpreter) and AES decryption. The plugin system supports repository-based distribution, versioning, and binary compatibility checks. While the codebase is actively maintained and demonstrates good engineering practices (MVVM, coroutines, custom adapters), many extractors are brittle due to external site dependencies, and some modules exhibit tight coupling and deprecated API usage.
The LLM identified 3 files worth highlighting for reuse:
A self-contained, budget-limited JavaScript interpreter implemented in pure Kotlin. It safely evaluates obfuscated JS code extracted from web pages to obtain video URLs, without requiring a WebView. The interpreter supports basic scripting constructs, cancellation via execution budget, and reports intermediate values. This component is reusable in any Kotlin project that needs to execute simple JavaScript for deobfuscation or data extraction.
Comprehensive subtitle language resolution utility. Maps IETF BCP 47 tags, ISO 639 codes, OpenSubtitles identifiers, and unofficial names to a unified language representation. Includes fuzzy name matching, flag emoji generation, and validation of well-formed language tags. This module is highly portable and can be extracted for any application dealing with multilingual subtitles or locale processing.
Utility class providing AES-CBC encryption and decryption with MD5-based key derivation, compatible with CryptoJS/PHP implementations commonly used in video hosting sites. Offers functions for encryption, decryption, string-to-key conversion, and hex digest generation. This helper is reusable in any Kotlin project requiring AES decryption for scraping or data processing, and demonstrates non-obvious cryptographic handling.