From 42d6ef5765f8bc52aa855526d892106e336bbd07 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 25 Feb 2026 11:11:41 -0700 Subject: [PATCH] fix(n_m3u8dl_re): disable segment count validation for duration-based DASH N_m3u8DL-RE uses Math.Ceiling to calculate segment counts from SegmentTemplate @duration, which overshoots by 1 when the division has a small fractional remainder. This causes 404 on the phantom last segment and fails with "Segment count check not pass". Upstream bug: nilaoda/N_m3u8DL-RE#108 --- unshackle/core/downloaders/n_m3u8dl_re.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unshackle/core/downloaders/n_m3u8dl_re.py b/unshackle/core/downloaders/n_m3u8dl_re.py index 7789d10..c88ab3f 100644 --- a/unshackle/core/downloaders/n_m3u8dl_re.py +++ b/unshackle/core/downloaders/n_m3u8dl_re.py @@ -191,6 +191,9 @@ def build_download_args( args["--skip-merge"] = skip_merge if ad_keyword: args["--ad-keyword"] = ad_keyword + # Disable segment count validation to work around N_m3u8DL-RE's Math.Ceiling + # bug in duration-based SegmentTemplate calculation (see nilaoda/N_m3u8DL-RE#108) + args["--check-segments-count"] = False key_args = [] if content_keys: