$ show soimort/you-get
You-Get is a command-line media downloader that scrapes web pages to extract and download video, audio, and image files from over 100 websites including YouTube, Bilibili, and Youku. The architecture is a monolithic Python package with a modular extractor system: each supported site has a dedicated module under `src/you_get/extractors/` that implements a consistent interface (module-level `download` and `download_playlist` functions). The core engine in `common.py` handles URL resolution, HTTP requests with retry, proxy support, cookie loading, and download orchestration via external tools like ffmpeg or rtmpdump. The CLI entry point in `__main__.py` provides options for format selection, playlist handling, JSON output, and streaming to media players. While the project is functionally complete and has sustained community interest for over a decade, the codebase shows signs of organic growth: heavy reliance on fragile regex-based scraping, global state management, and embedded API keys. The most technically notable component is the standalone MP4 merger in `join_mp4.py` that implements ISO BMFF atom parsing without external dependencies.
The LLM identified 2 files worth highlighting for reuse:
Implements a complete MP4 file concatenation routine that parses and reassembles ISO Base Media File Format (ISOBMFF) atoms without relying on ffmpeg or any external binary. It reads the moov and mdat atoms from multiple MP4 files, rewrites offsets, and writes a single output file. This is a non-trivial binary data manipulation pattern that is self-contained (only uses Python standard library) and could be extracted as a reusable library for any project needing to merge MP4 segments.
Provides `legitimize()` function that strips or replaces characters unsafe for filenames across Windows, macOS, and Linux. It handles reserved names, trailing dots/spaces, and length limits. This is a simple but correct utility that can be directly reused in any Python project requiring safe filename generation.