Skip to content
CAI
Software that uses CAICheck a score

nilaoda/N_m3u8DL-RE

37.3

Weak · 12 November 2026

23.1k

lines of production code

C#

primary language

8

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Added AES-128 and ChaCha20 decryption utilities

The Crypto module now includes new utility classes to support decryption of encrypted media segments. AESUtil provides AES-128 decryption (CBC mode, PKCS7 padding) for files and byte arrays, while ChaCha20Util implements ChaCha20 stream decryption, processing data in 1024-byte chunks and supporting both 8-byte and 12-byte nonces. These additions enable the application to handle content protected by these specific encryption standards.

_src/N\m3u8DL-RE/Crypto · high confidence

Added demo processors for HLS key and DASH content handling

Two new demo processors have been added to the \Processor\ module to demonstrate extensibility. \DemoProcessor\ handles MPEG-DASH content specifically for URLs containing 'bitmovin', while \DemoProcessor2\ processes HLS encryption keys for URLs from 'playertest.longtailvideo.com', logging the key details during processing.

_src/N\m3u8DL-RE/Processor · high confidence

Added source-generated JSON serialization context

A new JsonContext class has been introduced to enable source-generated JSON serialization for core entities including MediaType, EncryptMethod, ExtractorType, Choise, StreamSpec, MediaSegment, and related collections. This configuration uses camel-case naming and indented output, providing a more efficient and type-safe JSON serialization path for these components.

_src/N\m3u8DL-RE.Common/JsonContext · high confidence

Initial release of N\_m3u8DL-RE with AOT publishing and live-stream support

This entry introduces the N\_m3u8DL-RE application, a command-line tool for downloading and processing media streams. The code establishes the core entry point (Program.cs) and build configuration (Directory.Build.props), enabling Ahead-of-Time (AOT) compilation with full trimming and static linking for Linux musl targets. Key user-facing capabilities include initial support for live stream recording, HTTP-TS recording, and binary direct-link downloads. The tool features robust terminal handling, including ANSI console support, cursor restoration on exit, and PowerShell command-line completion. It also supports complex media processing such as multi-period MPD parsing, CENC encryption handling, custom HLS decryption parameters, and post-download muxing using ffmpeg or mkvmerge. Configuration is managed via command-line arguments and user config files, with support for proxies, cookies, network interface binding, and logging.

_src/N\m3u8DL-RE · high confidence

Introduces configurable parser settings for URL processing, encryption, and retries

The new ParserConfig class centralizes configuration for the media parser, allowing users to control how URLs are processed and how encrypted content is handled. Users can now pass custom arguments to URL processors via the UrlProcessorArgs property, define custom encryption methods and keys (CustomMethod, CustomeKey, CustomeIV), and adjust the number of retries for key downloads (KeyRetryCount, defaulting to 3). Additionally, the config supports appending original URL parameters to segment URLs (AppendUrlParams) and scopes custom HLS overrides (CustomHLSScope), providing finer control over parsing behavior for complex streams.

_src/N\m3u8DL-RE.Parser/Config · high confidence

Introduces extensible processor architecture for URL and key handling

The parser now uses abstract base classes (ContentProcessor, KeyProcessor, UrlProcessor) to allow custom processing logic. A default URL processor is provided to append query parameters from the base URL to media segments, respecting local file vs. remote URL contexts and preserving existing parameters.

_src/N\m3u8DL-RE.Parser/Processor · high confidence

Introduces unified stream extraction with support for HLS, DASH, MSS, Live TS, and binary streams

The parser now uses a central StreamExtractor class to detect and handle multiple stream formats automatically. Based on the content of the loaded source, it instantiates the appropriate extractor for HLS (.m3u8), DASH/MPD, Microsoft Smooth Streaming (MSS), raw Live TS, or binary data. This allows the tool to parse and extract stream specifications from a wider variety of input sources, including direct binary links and live streams, in addition to traditional playlist files.

_src/N\m3u8DL-RE.Parser · high confidence

New MP4 subtitle parser and MSS stream support

The application now includes a dedicated MP4 parsing engine (Mp4SubtitleParser) capable of extracting and converting TTML and WebVTT subtitles from MP4 containers, including handling time-shifting for segmented content. It also introduces initial support for parsing Microsoft Smooth Streaming (MSS) ISM files, enabling the extraction of codec configurations, KIDs, and protection system IDs for encrypted streams.

_src/N\m3u8DL-RE.Parser/Mp4 · high confidence

New binary direct download and HTTP live recording capabilities

The download manager now supports downloading single binary files (such as MPD-specified whole files) with concurrent range requests, progress reporting, and bandwidth limiting, while also introducing a dedicated HTTP live recording mode for TS streams that captures raw data, parses TS service information (program ID, service name), and handles live-specific logic like segment tracking and timeout policies.

_src/N\m3u8DL-RE/DownloadManager · high confidence

New common entity model for media streams and subtitles

The \N\_m\_m3u8DL-RE.Common\ library now includes a comprehensive set of entity classes to represent media content, including \StreamSpec\ for track metadata (bandwidth, codecs, language, roles), \Playlist\ and \MediaPart\ for organizing segments and periods, \MediaSegment\ for individual chunks with encryption info, and \WebVttSub\/\SubCue\ for subtitle handling. This refactoring introduces structured support for DASH periods, HLS discontinuities, and MSS stream data, enabling more accurate stream selection, subtitle synchronization, and encryption management.

_src/N\m3u8DL-RE.Common/Entity · high confidence

New configuration model and environment variable controls

The application introduces a new \DownloaderConfig\ class to centralize download settings, including filename templates (\SavePattern\), header management, and content-length validation. It also adds an \EnvConfigKey\ class that exposes environment variables (\RE\_KEEP\_IMAGE\_SEGMENTS\, \RE\_LIVE\_PIPE\_OPTIONS\, \RE\_LIVE\_PIPE\_TMP\_DIR\) to allow users to control specific behaviors, such as retaining image segment files after subtitle processing or customizing live stream piping options.

_src/N\m3u8DL-RE/Config · high confidence

New extractor architecture for DASH, HLS, MSS, and binary streams

The parser now uses a new \IExtractor\ interface with dedicated implementations for MPEG-DASH (\DASHExtractor2\), HLS (\HLSExtractor\), Microsoft Smooth Streaming (\MSSExtractor\), binary direct links (\BinaryExtractor\), and live HTTP-TS streams (\LiveTSExtractor\). This refactors the previous monolithic parsing logic into modular components, introducing support for MSS live streams, binary direct-link downloads, and improved handling of DASH multi-period, HLS master lists, and live stream refresh logic.

_src/N\m3u8DL-RE.Parser/Extractor · high confidence

New multi-language resource system for CLI options and messages

The application now uses a structured localization system (ResString and StaticText) to manage user-facing strings in English, Simplified Chinese, and Traditional Chinese. This change introduces support for numerous new command-line options and configuration settings, including live-streaming controls (e.g., \--live-take-count\, \--live-idle-timeout\, \--live-real-time-merge\), media selection filters (video, audio, subtitles), download limits (\--max-speed\, \--download-retry-count\), and advanced muxing/decryption paths (mkvmerge, shaka-packager, CENC). Users will see updated help text and status messages reflecting these new capabilities and improved error reporting for network, decryption, and file handling.

_src/N\m3u8DL-RE.Common/Resource · high confidence

New progress columns for binary downloads and live recording

The CLI now displays dedicated progress columns for binary direct-link downloads and live stream recording. Binary downloads show size and speed using new BinaryDownloadSizeColumn and BinaryDownloadSpeedColumn classes. Live recording tasks display recording duration (RecordingDurationColumn), recorded file size (RecordingSizeColumn), and status (RecordingStatusColumn), giving users real-time visibility into ongoing captures.

_src/N\m3u8DL-RE/Column · high confidence

New structured logging system with file output and ANSI-safe console rendering

The application now uses a dedicated logging subsystem (N\_m3u8DL\_RE.Common.Log) that supports multiple log levels (OFF, ERROR, WARN, INFO, DEBUG) and writes logs to timestamped files in a Logs directory. The console output is handled by a custom ANSI-aware writer that strips escape sequences for non-interactive or redirected environments, preventing display corruption and ensuring clean output for piped consumers. Log file creation uses atomic file operations to prevent race conditions between concurrent instances.

_src/N\m3u8DL-RE.Common/Log · high confidence

Added several new utility classes in the Common.Util namespace: BinaryContentCheckUtil for detecting binary content and MPEG-2 TS streams, CookieFileHandler and CookieFileJar for managing Netscape cookie files and updating cookies from responses, GlobalUtil for JSON serialization and file/time formatting, HexUtil for hex and Base64 conversion, NetscapeCookieFile for parsing cookie files, NetworkInterfaceBinding for binding to specific network interfaces or IP addresses, and RetryUtil for handling transient network errors with retries.

_src/N\m3u8DL-RE.Common/Util · high confidence

Support for user configuration files merged with command-line arguments

Users can now persist default settings in a configuration file (typically located at %APPDATA%\\N\_m3u8DL-RE\\config.conf on Windows or \~/.config/N\_m3u8DL-RE/config.conf on Linux/macOS) which is automatically merged with command-line arguments. The system respects command-line overrides, supports response files for loading arguments from other files, and handles specific logic for options like language and FFmpeg concat modes to ensure consistent behavior between stored defaults and runtime inputs.

_N\m3u8DL-RE · high confidence

Behavioural changes

Adds new enumerations for media types, roles, encryption, and extractors

The application introduces several new enumerations in the common library to support expanded media handling capabilities. New enum values include \ForcedSubtitle\ in \RoleType\ to allow filtering of forced subtitles, \BINARY\ and \MSS\ in \ExtractorType\ to support binary direct links and Microsoft Smooth Streaming, \CENC\ in \EncryptMethod\ for CENC encryption recognition, and \CustomHlsScope\ to limit custom HLS decryption parameters to video or audio tracks. These changes provide the underlying type definitions required for the corresponding behavioral changes in parsing and extraction logic.

_src/N\m3u8DL-RE.Common/Enum · high confidence

Automatic DASH MPD namespace injection

The DASH parser now automatically detects and injects missing XML namespace declarations (specifically for cenc, mspr, and mas) into MPD content. This ensures that manifests referencing these namespaces are processed correctly even when the xmlns attributes are absent from the root MPD element.

_src/N\m3u8DL-RE.Parser/Processor/DASH · high confidence

Command-line interface restructured with new options and PowerShell completion

The command-line argument handling has been rebuilt using System.CommandLine, introducing a comprehensive set of new options including \--config\ for user profiles, \--log-file-path\ for logging, \--interface\ for network binding, and \--urlprocessor-args\ for passing arguments to URL processors. The tool now supports PowerShell tab-completion via the \--generate-completion powershell\ flag. Muxing capabilities have been expanded with \--mux-after-done\ and \--mux-import\ to support external file mixing and formats like MKV and TS, while decryption is now configurable via \--decryption-engine\ to select between MP4Decrypt, ShakaPackager, or FFmpeg. Additionally, the default subtitle format has changed to SRT, and the default download thread count is now set to the machine's logical processor count.

_src/N\m3u8DL-RE/CommandLine · high confidence

Improved HLS decryption reliability and platform-specific fixes

The HLS parser now handles m3u8 files with \\r line endings and corrects malformed tag ordering (e.g., \#EXT-X-KEY before \#EXTINF). It includes specific fixes for Disney+ subtitles, Apple TV, and Youku content to ensure proper parsing. Key loading is more robust, supporting custom keys/IVs, base64/data URIs, and local file paths, while caching AES-128 keys per URL to prevent redundant HTTP requests. Additionally, key retrieval now includes retry logic for non-live streams and better error handling for network issues.

_src/N\m3u8DL-RE.Parser/Processor/HLS · high confidence

Introduces local TCP-based concat input server to resolve file handle exhaustion during FFmpeg merging

The application now uses a local \ConcatInputServer\ utility to serve concatenated media segments via a temporary HTTP endpoint, replacing the previous method of passing multiple file paths directly to FFmpeg. This change prevents the 'Too many open files' error that occurred when merging streams with a large number of segments, as the server maintains a constant number of file handles and connections rather than opening every segment simultaneously.

_src/N\m3u8DL-RE/Util · high confidence

New downloader implementation with CHACHA20, Gzip, and image header support

The download engine has been replaced with a new implementation that introduces support for CHACHA20 decryption, automatic Gzip decompression, and image header detection. It also includes improved retry logic with a 1-second interval, better handling of network timeouts for live streams, and optimized caching for initialization segments to prevent redundant downloads.

_src/N\m3u8DL-RE/Downloader · high confidence

New entity models for download configuration, filtering, and status tracking

The application introduces a set of new data models in the Entity layer to support advanced download capabilities. CustomRange allows users to specify custom time or segment-based download ranges. StreamFilter enables granular selection of media streams using regex patterns for attributes like language, resolution, and codecs, as well as filters for segment count, duration, bandwidth, and DASH period/role schemes. MuxOptions provides configuration for post-download muxing, including format selection, MKVmerge usage, and the ability to skip subtitles. DownloadResult tracks download success, content length verification, and header types (image/GZip). Mediainfo displays detailed media properties (bitrate, resolution, HDR/DOVI status) in the console. OutputFile manages output metadata and timestamp preservation for multi-period streams. SpeedContainer handles download speed statistics, rate limiting, and automatic retry logic when speed drops to zero for 20 seconds.

_src/N\m3u8DL-RE/Entity · high confidence

Fixes

New MPD segment number formatting logic in ParserUtil

The MPD parser now correctly handles hexadecimal segment numbering formats (e.g., $Number%08x$) in DASH manifests, ensuring that segment indices are formatted with the specified base and padding. This change resolves issues where hexadecimal segment numbers were not being parsed or replaced correctly during playlist processing.

_src/N\m3u8DL-RE.Parser/Util · high confidence

Test coverage

Added DASH manifest test resources; Added tests for DASH and HLS extractor improvements; Added tests for URL parameter handling and HLS key caching; Added tests for command-line argument parsing and configuration; Added tests for download progress and speed column logic; Added tests for logging output, concurrency, and ANSI handling; Added tests for media info parsing, local file concatenation, and environment diagnostics; Added unit tests for WebVTT subtitle parsing and manipulation; Added unit tests for utility components; Expanded test coverage for download and live recording managers.

Dependencies

Upgrade to .NET 10 and update dependencies

The project has been upgraded to target .NET 10.0 (net10.0) across all libraries and the main executable, with the C\# language version set to 13.0. This change includes updating the Spectre.Console dependency to version 0.57.1 in the Common library, refreshing the test suite with xUnit 2.9.3, Shouldly 4.3.0, and Microsoft.NET.Test.Sdk 18.7.0, and updating the System.CommandLine dependency to version 2.0.0-rc.2.25502.107 in the main application.

(dependencies) · high confidence

Housekeeping

Solution file added for N\_m3u8DL-RE

A new Visual Studio solution file (N\_m3u8DL-RE.sln) has been added, defining the build configuration for the project. It includes four projects: the main application (N\_m3u8DL-RE), a common library (N\_m3u8DL-RE.Common), a parser library (N\_m3u8DL-RE.Parser), and a test project (N\_m3u8DL-RE.Tests). This enables building and running the solution in Visual Studio 17.

src · high confidence

Written by cca.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 39 → 37 (-1.3)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.

Lenses

  • Code Health 63 → 62 (-1.0)
  • Architecture 77 → 58 (-19.5)
  • Maturity 51 → 56 (+4.7)
  • Readiness 50 → 50 (+0.0)
  • Security 20 → 18 (-2.6)
  • Performance 61 → 60 (-1.5)

Resolved (9)

  • Duplicated block (5 lines × 2) (src/N_m3u8DL-RE/Crypto/CSChaCha20.cs)
  • Duplicated block (9 lines × 2) (src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs)
  • High: security finding (details withheld)
  • Near-duplicate member pair (49 shared lines) (src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs)
  • SimpleLiveRecordManager2.DownloadLiveSegmentAsync (cognitive 24) (src/N_m3u8DL-RE/DownloadManager/SimpleLiveRecordManager2.cs)
  • Two private fields in the same class are named similarly but with a numeric suffix on one, suggesting a copy-paste or refactoring artifact where the second name was not updated to reflect its distinct purpose or position.
  • XML-doc coverage: N_m3u8DL-RE (src/N_m3u8DL-RE/N_m3u8DL-RE.csproj)
  • XML-doc coverage: N_m3u8DL-RE.Common (src/N_m3u8DL-RE.Common/N_m3u8DL-RE.Common.csproj)
  • XML-doc coverage: N_m3u8DL-RE.Parser (src/N_m3u8DL-RE.Parser/N_m3u8DL-RE.Parser.csproj)

New (34)

  • Boundary-crossing change coupling: HTTPUtil.cs ↔ CommandInvoker.cs (src/N_m3u8DL-RE.Common/Util/HTTPUtil.cs)
  • Duplicated block (18 lines × 2) (src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs)
  • Edited copy of a member (11 corresponding lines) (src/N_m3u8DL-RE.Parser/Mp4/BinaryWriter2.cs)
  • Edited copy of a member (12 corresponding lines) (src/N_m3u8DL-RE.Parser/Mp4/MSSMoovProcessor.cs)
  • Edited copy of a member (12 corresponding lines) (src/N_m3u8DL-RE/Util/LargeSingleFileSplitUtil.cs)
  • Edited copy of a member (15 corresponding lines) (src/N_m3u8DL-RE/Crypto/CSChaCha20.cs)
  • Edited copy of a member (15 corresponding lines) (src/N_m3u8DL-RE/Util/ConcatInputStream.cs)
  • Edited copy of a member (18 corresponding lines) (src/N_m3u8DL-RE.Parser/Mp4/MP4TtmlUtil.cs)
  • Edited copy of a member (18 corresponding lines) (src/N_m3u8DL-RE/CommandLine/ConfigFile.cs)
  • Edited copy of a member (2 corresponding lines) (src/N_m3u8DL-RE.Common/Entity/WebVttSub.cs)
  • Edited copy of a member (2 corresponding lines) (src/N_m3u8DL-RE/Util/HlsSubtitleTimeline.cs)
  • Edited copy of a member (22 corresponding lines) (src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs)
  • Edited copy of a member (33 corresponding lines) (src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs)
  • Edited copy of a member (4 corresponding lines) (src/N_m3u8DL-RE.Parser/Extractor/DASHExtractor2.cs)
  • HLSVariableSubstitution.Process (cognitive 66) (src/N_m3u8DL-RE.Parser/Util/HLSVariableSubstitution.cs)
  • HLSVariableSubstitution.Process (cyclomatic 32) (src/N_m3u8DL-RE.Parser/Util/HLSVariableSubstitution.cs)
  • High CVE: Microsoft.DotNet.ILCompiler 10.0.11
  • High: security finding (details withheld)
  • Hotspot: src/N_m3u8DL-RE/Util/MediainfoUtil.cs (src/N_m3u8DL-RE/Util/MediainfoUtil.cs)
  • LiveSegmentDownloadQueue.AttemptAsync (cognitive 29) (src/N_m3u8DL-RE/DownloadManager/LiveSegmentDownloadQueue.cs)
  • …and 14 more

Changes since last survey

  • 9 commits — 9 feature/other, 0 fixes

By area

  • src/N_m3u8DL-RE — 4 commits
  • src/N_m3u8DL-RE.Tests — 2 commits
  • (root) — 1 commit
  • src/N_m3u8DL-RE.Common — 1 commit
  • src/N_m3u8DL-RE.Parser — 1 commit

Notable commits

  • change: 优化直播分片超时与补片调度并提示 HLS 序号跳变 (#1012)
  • change: 保护混流外部输入并修正命令帮助 (#1006)
  • change: 修复 HLS TS 回放过度分段并优化多段合并 (#1018)
  • change: 修复多段 HLS TS 下载忽略二进制合并选项 (#1007)
  • change: 修复并发下载清理临时目录时的竞态异常 (#1014)
  • change: 支持 HLS 变量替换并修正子清单失败回退 (#1010)
  • change: 改善 MP4 HEVC 与杜比视界视频标记兼容性 (#1009)
  • change: 统一工具目录识别并自动选择合并模式 (#1017)
  • change: 默认使用 HTTP/1.1 并支持选择 HTTP 协议版本 (#1011)

Architecture

  • Unchanged — 1 containers · 1 contexts · 0 edges

Written by cca.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 12 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 7849be8437148b33324d5ba298804d49d3add3d8 — the exact code this score is about.
  • Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.42+preprod-6bc2a431cb25.