nilaoda/N_m3u8DL-RE
57.0
Adequate · 23 September 2026
13k
lines of production code
C#
primary language
5
measurements over time
What this system is
N\_m3u8DL-RE is a .NET-based command-line tool for downloading and processing media streams from HLS, DASH, and MSS sources. It parses media manifests, handles encryption and decryption, and manages the download of segmented content with support for live recording. The system provides extensive filtering, URL processing, and post-processing capabilities, all exposed through a structured CLI interface.
How it got here
2022 — Parser and download architecture overhaul
26 changes.
The codebase underwent a significant architectural restructuring, introducing a modular parser system with pluggable processors for HLS, DASH, and MSS streams. This period also established a robust download and live recording framework, supported by new encryption utilities and a comprehensive CLI interface.
2025–2026 — Test coverage expansion
5 changes.
This period focused on increasing test coverage across the codebase, introducing unit tests for subtitle parsing, DASH stream handling, command-line argument parsing, and various utility functions. The work included adding helper classes for test data access and verifying logic for ad filtering, error handling, and filename management.
Features
Added AES-128 and ChaCha20 decryption utilities
The Crypto module now includes new decryption capabilities. An AES-128 utility (AESUtil) has been added to handle file decryption using the standard CBC mode and PKCS7 padding. Additionally, a ChaCha20 decryption utility (ChaCha20Util) has been introduced, which wraps the CSChaCha20 library to decrypt data in 1024-byte chunks, supporting both 12-byte and 8-byte nonces.
_src/N\m3u8DL-RE/Crypto · high confidence
Added JSON serialization support for media types
The application now includes a generated JSON serializer context that supports serialization for media-related types including MediaType, EncryptMethod, ExtractorType, Choise, StreamSpec, MediaSegment, and related collections. This enables efficient, compile-time validated JSON serialization for these core entities.
_src/N\m3u8DL-RE.Common/JsonContext · high confidence
Added MP4 parsing utilities for TTML and WebVTT subtitles
The \src/N\_m3u8DL-RE.Parser/Mp4\ directory now includes new utility classes (\BinaryReader2\, \BinaryWriter2\, \MP4Parser\, \MP4InitUtil\, \MP4TtmlUtil\, \MP4VttUtil\, and \MSSMoovProcessor\) that enable the parser to read and process MP4 container formats. These additions provide specific support for extracting TTML and WebVTT subtitle tracks from MP4 files, as well as handling initialization data for Smooth Streaming (MSS) and other DRM-protected content.
_src/N\m3u8DL-RE.Parser/Mp4 · high confidence
Added ParserUtil for parsing media playlist and MPD segment templates
A new utility class, ParserUtil, has been added to handle parsing of media playlist attributes and MPD segment template variables. This includes methods to extract key-value pairs from playlist lines, parse byte ranges, replace template variables (including special number formatting like $Number%05d$), and combine base and relative URLs. This supports the underlying parsing logic for video streaming formats.
_src/N\m3u8DL-RE.Parser/Util · high confidence
Added URL and content processors for Nowehoryzonty and demo scenarios
The download tool now supports custom URL processing and content handling through new processor classes. A new \NowehoryzontyUrlProcessor\ is introduced to calculate secure tokens and timestamps for \nowehoryzonty.pl\ links, allowing users to pass specific arguments via the \--urlprocessor-args\ flag. Additionally, two demo processors (\DemoProcessor\ and \DemoProcessor2\) are added to demonstrate how to handle MPEG-DASH and HLS content, respectively, providing a template for future custom processing logic.
_src/N\m3u8DL-RE/Processor · high confidence
Introduce StreamExtractor for unified media stream parsing
A new StreamExtractor class has been added to the parser module, providing a unified entry point for loading and parsing various media stream formats. It automatically detects and routes content to the appropriate extractor (HLS, DASH/MPD, MSS/Smooth Streaming, or Live TS) based on the source text. The implementation includes thread-safe parsing via a semaphore, automatic handling of local files and HTTP URLs, and specific retry logic for live stream playlist refreshes.
_src/N\m3u8DL-RE.Parser · high confidence
Introduce new live recording managers and enhance download manager capabilities
Added new \HTTPLiveRecordManager\ and \SimpleLiveRecordManager2\ classes to handle HTTP-TS live stream recording and general live recording logic, respectively. The \SimpleDownloadManager\ was updated to support single-file multi-threaded downloading, automatic binary merging for CENC encrypted content, and improved handling of subtitle time axis calculations. Additionally, the download manager now supports concurrent downloads, respects ad-filtering for live streams, and uses millisecond timestamps for live segment names to prevent file overwrites.
_src/N\m3u8DL-RE/DownloadManager · high confidence
Introduce structured command-line argument parsing and configuration models
The command-line interface is refactored to use a structured \CommandInvoker\ that defines all CLI options (such as \--tmp-dir\, \--save-name\, \--log-file-path\, and \--morehelp\) and maps them to a strongly-typed \MyOption\ model. This change introduces dedicated enums for \DecryptEngine\ (supporting \MP4DECRYPT\, \SHAKA\_PACKAGER\, and \FFMPEG\), \MuxFormat\ (supporting \MP4\, \MKV\, and \TS\), and \SubtitleFormat\ (supporting \VTT\ and \SRT\), providing a more robust and extensible foundation for future command-line features.
_src/N\m3u8DL-RE/CommandLine · high confidence
Introduces .NET Native AOT compilation and static linking for Linux targets
The application is now built using .NET Native AOT (Ahead-of-Time) compilation, which significantly reduces the application's memory footprint and startup time. For Linux targets (specifically linux-musl-arm64 and linux-musl-x64), the build configuration enables static linking with libc and OpenSSL, resulting in a fully self-contained executable that does not require external shared libraries. Additionally, the build process is configured to strip symbols and optimize for speed, while also enabling full trimming and metadata removal to further reduce the final binary size.
_src/N\m3u8DL-RE · high confidence
Introduces ParserConfig to centralize parser settings and processor pipelines
A new ParserConfig class has been added to centralize configuration for the parser, including URL handling, headers, and custom encryption keys. It introduces a pluggable pipeline of content, URL, and key processors, allowing users to inject custom logic for content transformation, URL processing, and key decryption. The configuration also supports passing arguments to URL processors and appending URL parameters, providing greater control over parsing behavior.
_src/N\m3u8DL-RE.Parser/Config · high confidence
Introduces new entity models for media, encryption, and subtitles
The codebase now includes new entity classes to represent media segments, playlist structures, and subtitle cues. Specifically, \MediaSegment\ and \MediaPart\ model the segmented content, while \EncryptInfo\ and \StreamSpec\ handle encryption metadata and stream specifications. Additionally, \WebVttSub\ and \SubCue\ provide structured representations for WebVTT subtitles, and \MSSData\ supports Microsoft Smooth Streaming metadata. These changes enable the application to parse and manage complex media structures and encryption details more effectively.
_src/N\m3u8DL-RE.Common/Entity · high confidence
New structured logging system with file output and ANSI support
The application now includes a dedicated logging framework in the Common library, introducing structured log output to both the console and a timestamped log file. Users will see formatted, color-coded (ANSI) console output that can be forced to plain text for non-ANSI environments, alongside automatic creation of log files containing task start times, command lines, and all INFO/WARN/ERROR/DEBUG entries. The system also resolves race conditions in log file creation to prevent crashes when multiple instances run concurrently.
_src/N\m3u8DL-RE.Common/Log · high confidence
New utility classes for download, filtering, and media processing
The download and processing logic has been refactored into new utility classes in the Util folder. DownloadUtil handles HTTP requests, file copying, and speed limiting. FilterUtil provides stream filtering and selection capabilities, including support for DASH Period IDs and live stream synchronization. Other utilities include CultureUtil for locale handling, ImageHeaderUtil for detecting and processing image headers, LanguageCodeUtil for language mapping, LargeSingleFileSplitUtil for splitting large files, MP4DecryptUtil for decryption, MediainfoUtil for reading media info, MergeUtil for combining files, OtherUtil for general tasks like GZip decompression, and PipeUtil for named pipes.
_src/N\m3u8DL-RE/Util · high confidence
Architecture
Solution file added for N\_m3u8DL-RE
The solution file (N\_m3u8DL-RE.sln) has been added, defining the build structure for the N\_m3u8DL-RE project along with its Common, Parser, and Tests sub-projects. This change organizes the codebase into distinct components, facilitating easier navigation and compilation of the m3u8 parsing and testing modules.
src · high confidence
Behavioural changes
Adds entity classes for download configuration and status tracking
The codebase introduces several new entity classes to support advanced download and filtering capabilities. CustomRange defines a download range by start/end seconds or segment indices. StreamFilter enables complex stream selection using regex patterns for group ID, language, name, codecs, resolution, frame rate, channels, video range, and URL, alongside numeric filters for segment count, playlist duration, and bandwidth, plus a role-based filter. SpeedContainer tracks download speed, total downloaded bytes, and low-speed conditions. DownloadResult reports download success and headers (image, Gzip). Mediainfo stores media metadata (type, bitrate, resolution, FPS, HDR/DOVI flags). MuxOptions configures muxing behavior (format, keep files, skip subtitles). OutputFile represents a single output file with media type, index, path, language, description, and associated metadata. These entities collectively enable users to specify precise download ranges, filter streams by various attributes, monitor download performance, and configure post-processing options.
_src/N\m3u8DL-RE/Entity · medium confidence
Automatic MPD namespace injection for DASH content
The DASH processor now automatically injects missing XML namespace declarations (such as cenc, mspr, and mas) into the MPD file when they are referenced but not defined, ensuring compatibility with various DRM systems.
_src/N\m3u8DL-RE.Parser/Processor/DASH · high confidence
Centralized, multi-language string resource system
The application now uses a centralized \ResString\ and \StaticText\ class to manage all user-facing text, including command-line help descriptions, status messages, and error prompts. This change supports English, Simplified Chinese, and Traditional Chinese, ensuring consistent and translatable UI text across the product.
_src/N\m3u8DL-RE.Common/Resource · high confidence
Improved HLS parsing and key handling for specific streaming services
The HLS parser now includes specific content processors to fix parsing issues for YK (Douyin), Disney+, and Apple TV, ensuring correct segment ordering and map handling. Additionally, the key processor now supports custom encryption methods, custom IVs, and retries HTTP key downloads up to three times before failing.
_src/N\m3u8DL-RE.Parser/Processor/HLS · high confidence
Improved download reliability with HTTP redirect handling and retry logic
The download process is now more robust against network instability and server redirects. A new HTTP utility (HTTPUtil) manually follows 302/303 redirects to prevent header loss, and a new retry mechanism (RetryUtil) automatically retries failed requests. Additionally, a binary content checker (BinaryContentCheckUtil) was added to detect and handle binary streams like MPEG-TS, improving the accuracy of content type identification.
_src/N\m3u8DL-RE.Common/Util · medium confidence
Introduce IDownloader interface and SimpleDownloader implementation for segment downloading
The Downloader module now defines an IDownloader interface and a SimpleDownloader class that handles downloading media segments. The implementation supports decryption for AES-128, AES-128-ECB, and ChaCha20 encryption methods, and automatically processes image headers and Gzip-compressed content. It also includes retry logic with a 1-second delay between attempts and speed tracking for downloaded segments.
_src/N\m3u8DL-RE/Downloader · medium confidence
Introduce new configuration options and environment variables for download and muxing
The application now supports additional configuration for download behavior and environment-based control. Users can set the \RE\_KEEP\_IMAGE\_SEGMENTS\ environment variable to 1 to prevent the deletion of original files after subtitle conversion to PNG. Additionally, the \RE\_LIVE\_PIPE\_OPTIONS\ and \RE\_LIVE\_PIPE\_TMP\_DIR\ environment variables allow control over the \ffmpeg\ command line and temporary directory for live pipe muxing. The \DownloaderConfig\ class introduces new properties for download settings, including \DirPrefix\, \SavePattern\, \CheckContentLength\, and \Headers\.
_src/N\m3u8DL-RE/Config · medium confidence
Introduces new enumerations for media types, encryption methods, extractors, and roles
The codebase now includes several new enum definitions that formalize supported media types (audio, video, subtitles, closed captions), encryption methods (including CENC, CHACHA20, and various AES variants), extractor types (MPEG-DASH, HLS, HTTP-LIVE, MSS), and media roles (including a new 'ForcedSubtitle' role). These additions provide the structural foundation for handling diverse content formats and security schemes.
_src/N\m3u8DL-RE.Common/Enum · high confidence
New progress columns for download speed, status, and recording metrics
The application now displays additional progress information in the console UI. A new DownloadSpeedColumn shows the current download speed and tracks low-speed states. A DownloadStatusColumn displays the downloaded size and total estimated size. A MyPercentageColumn shows the percentage and byte counts. For live recording, a RecordingDurationColumn shows the recording duration, and a RecordingStatusColumn indicates whether the recording is active or finished. These columns provide more detailed feedback on download and recording progress.
_src/N\m3u8DL-RE/Column · high confidence
Refactored parser processors into an extensible interface
The parser's processing logic has been refactored to use abstract base classes (ContentProcessor, KeyProcessor, UrlProcessor) with dedicated implementations (DefaultBOMContentProcessor, DefaultUrlProcessor). This introduces a new mechanism to automatically strip the UTF-8 BOM header from content and allows appending URL parameters from the parser configuration to media URLs, improving compatibility and customizability for HLS, DASH, and MSS streams.
_src/N\m3u8DL-RE.Parser/Processor · high confidence
Rewrite of media extractors for DASH, HLS, MSS, and live TS
The media extraction logic has been completely rewritten to improve parsing accuracy and support for live streams. The DASH, HLS, and MSS extractors have been replaced with new implementations that better handle BaseURL resolution, segment indexing, and live stream refresh logic. A new LiveTS extractor has been added to support HTTP-TS live streams. These changes result in more reliable parsing of media manifests and segments across different streaming protocols.
_src/N\m3u8DL-RE.Parser/Extractor · high confidence
Test coverage
Added test utility for reading embedded resources; Added tests for ComplexParamParser; Added tests for DASH period selection and segment deduplication; Added unit tests for WebVTT parsing, logging, and utility functions; Added unit tests for ad filtering, merge error handling, and filename utilities.
Dependencies
Upgrade to .NET 10 and update test framework dependencies
The project has been upgraded to target .NET 10 (net10.0) across all components, including the main application, common library, parser, and test suite. Additionally, the test suite has been updated to use xUnit 2.9.3, Microsoft.NET.Test.Sdk 18.7.0, Shouldly 4.3.0, and coverlet.collector 10.0.1, while the main application now references System.CommandLine 2.0.0-rc.2.25502.107.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 52 → 57 (+4.7)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 64 → 62 (-1.8)
- Architecture 98 → 97 (-0.3)
- Maturity 55 → 55 (+0.1)
- Readiness 52 → 52 (+0.0)
- Security 46 → 62 (+16.0)
Resolved (39)
- Coverage not measured — analyzer environment
- Duplicated block (10 lines × 2) (src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs)
- Duplicated block (10 lines × 2) (src/N_m3u8DL-RE/Util/ImageHeaderUtil.cs)
- Duplicated block (11 lines × 2) (src/N_m3u8DL-RE/DownloadManager/HTTPLiveRecordManager.cs)
- Duplicated block (11 lines × 4) (src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs)
- Duplicated block (13 lines × 2) (src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs)
- Duplicated block (13 lines × 3) (src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs)
- Duplicated block (14 lines × 2) (src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs)
- Duplicated block (15 lines × 2) (src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs)
- Duplicated block (24 lines × 2) (src/N_m3u8DL-RE/DownloadManager/HTTPLiveRecordManager.cs)
- Duplicated block (5 lines × 2) (src/N_m3u8DL-RE.Parser/Mp4/MSSMoovProcessor.cs)
- Duplicated block (5 lines × 2) (src/N_m3u8DL-RE/Crypto/CSChaCha20.cs)
- Duplicated block (7 lines × 2) (src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs)
- Duplicated block (7 lines × 3) (src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs)
- Duplicated block (8 lines × 2) (src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- …and 19 more
New (108)
- Boundary-crossing change coupling: StaticText.cs ↔ FilterUtil.cs (src/N_m3u8DL-RE.Common/Resource/StaticText.cs)
- CI runs a third-party container image from a mutable tag (.github/workflows/build_latest.yml)
- Change coupling: CommandInvoker.cs ↔ FilterUtil.cs (src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs)
- CommentedOutCode (src/N_m3u8DL-RE.Parser/Mp4/MSSMoovProcessor.cs)
- CommentedOutCode (src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs)
- CommentedOutCode (src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (10 lines × 2) (src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs)
- Duplicated block (10 lines × 2) (src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs)
- Duplicated block (10 lines × 2) (src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs)
- Duplicated block (10–11 lines × 2) (src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs)
- Duplicated block (11 lines × 2) (src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs)
- Duplicated block (11 lines × 2) (src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs)
- Duplicated block (11 lines × 2) (src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs)
- Duplicated block (11 lines × 3) (src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs)
- Duplicated block (12 lines × 2) (src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs)
- Duplicated block (13 lines × 2) (src/N_m3u8DL-RE.Common/Util/HTTPUtil.cs)
- Duplicated block (13 lines × 2) (src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs)
- Duplicated block (13 lines × 2) (src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs)
- …and 88 more
Architecture
- Unchanged — 1 containers · 0 contexts · 0 edges
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
nilaoda/N_m3u8DL-RE was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 23 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit e113dee70c924ee08dae5460624909b04d84cb76 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-955b9cee9818.