Chunked decryption, resume & selection fixes

Implement chunked decryption of .m4s segments (avoid loading entire stream into memory) by changing decrypt() to accept a segment directory, process ~1GB chunks with mp4ff-decrypt, and concatenate results. Add resume support in segment downloader by skipping already downloaded .m4s files and initializing successful counter accordingly. Improve manifest handling: gracefully handle missing AVC/HEVC tracks, bruteforce ticks conditionally, and mark representations for removal when no valid tick is found. Add fallback unfiltered selection in select_track when filtered lookup yields no candidates. Replace naive UTC offset logic with explicit Europe/Paris timezone utilities and adjust related time conversion signatures. Bump project version to 1.0.
This commit is contained in:
√(noham)²
2026-06-17 16:49:49 +02:00
parent 4b524b2ead
commit e51a108d28
7 changed files with 189 additions and 84 deletions

View File

@@ -439,8 +439,16 @@ def select_track(content_dict, quality_spec, content_type):
candidates.extend(tracks)
if not candidates:
logger.warning("No %s track found for '%s'.", content_type, quality_spec)
return None
if filter_part:
logger.warning(
"No %s track found for '%s'. Falling back to unfiltered selection.",
content_type, quality_spec
)
for key, tracks in content_dict.items():
candidates.extend(tracks)
if not candidates:
logger.warning("No %s track found for '%s'.", content_type, quality_spec)
return None
if pref == "best":
selected = max(candidates, key=lambda x: x["bandwidth"])