$ account ytdl-org
youtube-dl is a command-line video downloader written in Python, supporting over 1000 websites through a modular extractor architecture. The system is built around a core InfoExtractor base class (common.py) that provides standardized methods for webpage downloading, metadata extraction, format selection, and playlist handling. Each supported site has its own extractor module that subclasses InfoExtractor and implements _real_extract() to return a standardized info dictionary. The architecture uses a lazy-loading mechanism (lazy_extractors.py, generated by make_lazy_extractors.py) to avoid importing all extractors at startup. Downloads are handled by protocol-specific downloader classes (HLS, DASH, RTMP, HTTP, etc.) selected based on the stream protocol. Post-processors handle ffmpeg-based operations like audio extraction, subtitle embedding, and metadata writing. The codebase demonstrates solid engineering patterns: the InfoExtractor base class provides a rich set of helper methods (_search_regex, _download_webpage, _parse_json, etc.), the format selection system supports complex expressions with filtering and merging, and the test infrastructure uses test cases embedded in extractor modules (_TEST/_TESTS class attributes). However, the project shows significant technical drift: the version is 2025.04.07 but the test data references 2013 versions, Python 2.6/2.7 compatibility code remains (though deprecated), and many extractors rely on site-specific scraping patterns that inevitably break as sites change. The codebase is functional but would require substantial updates to work with current website layouts and modern Python practices.