3 Commits

Author SHA1 Message Date
Andy
63d2ba60c4 chore(changelog): tag v4.0.0 release 2026-03-17 08:57:34 -06:00
Andy
f46aa9d8c8 chore(changelog): update changelog for upcoming release and reorganize sections 2026-03-17 08:55:14 -06:00
Andy
b1447eb14b fix(dl): filter CC subtitle languages with --s-lang and extract all manifest CCs
Fixes issues introduced in 15acaea where CC extraction only used the first manifest entry and ignored --s-lang filtering entirely. Now all CC languages from the HLS manifest are iterated and filtered against --s-lang using the same match logic as regular subtitle selection.
2026-03-16 14:09:05 -06:00
2 changed files with 53 additions and 29 deletions

View File

@@ -6,7 +6,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
This changelog is automatically generated using [git-cliff](https://git-cliff.org). This changelog is automatically generated using [git-cliff](https://git-cliff.org).
## [Unreleased] ## [4.0.0] - 2026-03-17
### Features ### Features
@@ -19,6 +19,11 @@ This changelog is automatically generated using [git-cliff](https://git-cliff.or
- *tracks*: Add edition tags to output filenames - *tracks*: Add edition tags to output filenames
- *templates*: [**breaking**] Add customizable output filename templates - *templates*: [**breaking**] Add customizable output filename templates
- *templates*: Add configurable language tagging rule engine - *templates*: Add configurable language tagging rule engine
- Update unshackle version to 4.0.0
- *dl*: Add --animeapi and --enrich options for anime metadata and tagging
- *dl*: Add skip messages for --no-audio and --no-chapters flags
- *dl*: Extract closed captions from HLS manifests and improve CC extraction
- *dl*: Add --worst flag and SHIELD OkHttp fingerprint preset
### Bug Fixes ### Bug Fixes
@@ -33,6 +38,13 @@ This changelog is automatically generated using [git-cliff](https://git-cliff.or
- *n_m3u8dl_re*: Disable segment count validation for duration-based DASH - *n_m3u8dl_re*: Disable segment count validation for duration-based DASH
- Correct formatting and add missing newlines in selector and EXAMPLE service - Correct formatting and add missing newlines in selector and EXAMPLE service
- *dependencies*: Update pyplayready version to 0.8.3 and adjust dependencies - *dependencies*: Update pyplayready version to 0.8.3 and adjust dependencies
- *drm*: Update PlayReady KID extraction for pyplayready 0.8.3 compatibility
- *api*: Resolve Sentinel serialization, missing params, and add search endpoint
- *dash*: Pass period_filter to n_m3u8dl_re via filtered MPD file
- *title*: Add HDR Vivid Format HDR Tag
- *ism*: Prevent duplicate track IDs for audio tracks with same lang/codec/bitrate
- *aria2c*: Correct progress bar tracking for HLS downloads
- *dl*: Filter CC subtitle languages with --s-lang and extract all manifest CCs
### Documentation ### Documentation
@@ -45,10 +57,6 @@ This changelog is automatically generated using [git-cliff](https://git-cliff.or
- *example*: Migrate EXAMPLE service to track_request pattern - *example*: Migrate EXAMPLE service to track_request pattern
- *providers*: Extract metadata providers into modular system - *providers*: Extract metadata providers into modular system
### Maintenance
- *changelog*: Update changelog for upcoming release and reorganize sections
## [3.0.0] - 2026-02-15 ## [3.0.0] - 2026-02-15
### Features ### Features

View File

@@ -62,7 +62,7 @@ from unshackle.core.tracks import Audio, Subtitle, Tracks, Video
from unshackle.core.tracks.attachment import Attachment from unshackle.core.tracks.attachment import Attachment
from unshackle.core.tracks.hybrid import Hybrid from unshackle.core.tracks.hybrid import Hybrid
from unshackle.core.utilities import (find_font_with_fallbacks, get_debug_logger, get_system_fonts, init_debug_logger, from unshackle.core.utilities import (find_font_with_fallbacks, get_debug_logger, get_system_fonts, init_debug_logger,
is_close_match, suggest_font_packages, time_elapsed_since) is_close_match, is_exact_match, suggest_font_packages, time_elapsed_since)
from unshackle.core.utils import tags from unshackle.core.utils import tags
from unshackle.core.utils.click_types import (AUDIO_CODEC_LIST, LANGUAGE_RANGE, QUALITY_LIST, SEASON_RANGE, from unshackle.core.utils.click_types import (AUDIO_CODEC_LIST, LANGUAGE_RANGE, QUALITY_LIST, SEASON_RANGE,
ContextData, MultipleChoice, MultipleVideoCodecChoice, ContextData, MultipleChoice, MultipleVideoCodecChoice,
@@ -1712,8 +1712,6 @@ class dl:
f"Required languages found ({', '.join(require_subs)}), downloading all available subtitles" f"Required languages found ({', '.join(require_subs)}), downloading all available subtitles"
) )
elif s_lang and "all" not in s_lang: elif s_lang and "all" not in s_lang:
from unshackle.core.utilities import is_exact_match
match_func = is_exact_match if exact_lang else is_close_match match_func = is_exact_match if exact_lang else is_close_match
missing_langs = [ missing_langs = [
@@ -2105,6 +2103,7 @@ class dl:
and not video_only and not video_only
and not no_video and not no_video
): ):
match_func = is_exact_match if exact_lang else is_close_match
for video_track_n, video_track in enumerate(title.tracks.videos): for video_track_n, video_track in enumerate(title.tracks.videos):
has_manifest_cc = bool(getattr(video_track, "closed_captions", None)) has_manifest_cc = bool(getattr(video_track, "closed_captions", None))
has_eia_cc = ( has_eia_cc = (
@@ -2118,14 +2117,31 @@ class dl:
if not has_manifest_cc and not has_eia_cc: if not has_manifest_cc and not has_eia_cc:
continue continue
# Build list of CC entries to extract
if has_manifest_cc:
cc_entries = video_track.closed_captions
# Filter CC languages against --s-lang if specified
if s_lang and "all" not in s_lang:
cc_entries = [
entry for entry in cc_entries
if entry.get("language")
and match_func(Language.get(entry["language"]), s_lang)
]
if not cc_entries:
continue
else:
# EIA fallback: single entry with unknown language
cc_entries = [{}]
with console.status(f"Checking Video track {video_track_n + 1} for Closed Captions..."): with console.status(f"Checking Video track {video_track_n + 1} for Closed Captions..."):
try: try:
for cc_idx, cc_entry in enumerate(cc_entries):
cc_lang = ( cc_lang = (
Language.get(video_track.closed_captions[0]["language"]) Language.get(cc_entry["language"])
if has_manifest_cc and video_track.closed_captions[0].get("language") if cc_entry.get("language")
else title.language or video_track.language else title.language or video_track.language
) )
track_id = f"ccextractor-{video_track.id}" track_id = f"ccextractor-{video_track.id}-{cc_idx}"
cc = video_track.ccextractor( cc = video_track.ccextractor(
track_id=track_id, track_id=track_id,
out_path=config.directories.temp out_path=config.directories.temp
@@ -2137,7 +2153,7 @@ class dl:
cc.cc = True cc.cc = True
title.tracks.add(cc) title.tracks.add(cc)
self.log.info( self.log.info(
f"Extracted a Closed Caption from Video track {video_track_n + 1}" f"Extracted a Closed Caption ({cc_lang}) from Video track {video_track_n + 1}"
) )
else: else:
self.log.info( self.log.info(