feat(drm): decrypt plugin segments as they land on the fetch_segments decrypter seam

This commit is contained in:
imSp4rky
2026-12-03 15:51:42 -07:00
parent e9adc50594
commit f1f91a7d5c
14 changed files with 309 additions and 84 deletions
+7 -5
View File
@@ -198,8 +198,8 @@ ranges must all match the previous download, or the download silently restarts c
- Single-file (non-segmented) downloads and DASH tracks collapsed to a single ranged
download never make segment files, so this option does not apply to them (the
downloader has its own in-flight partial-file handling for those).
- HLS resumes Widevine/PlayReady and unencrypted titles only. An AES-128 title always
restarts. An HLS failure after the post-download merge step starts to join or decrypt
- HLS resumes Widevine/PlayReady titles, unencrypted titles, and titles of a DRM plugin
that decrypts each segment. An AES-128 title always restarts. An HLS failure after the post-download merge step starts to join or decrypt
segments also restarts, and so does a failure of a multi-period DASH WebVTT subtitle
during its merge step. A failure before that point, such as a failed init segment
fetch, keeps the downloaded segments.
@@ -207,7 +207,7 @@ ranges must all match the previous download, or the download silently restarts c
[`decrypt_segments`](drm.md#decrypt_segments) resumes too. A merge during the download
keeps its output file up to the last segment it appended, and the next download cuts the
file back to that point and appends from there. A segment that
[`decrypt_segments`](drm.md#decrypt_segments) decrypted stays decrypted. The next
[`decrypt_segments`](drm.md#decrypt_segments) or a DRM plugin decrypted stays decrypted. The next
download reuses it only with the same content key, and downloads it again when the
content key changed.
- A multi-period DASH track whose periods restart their timeline does not resume with
@@ -247,8 +247,10 @@ with the option on, turn it off.
This applies to video and audio tracks from DASH, ISM, and HLS. An HLS track qualifies
only when every segment shares one init segment and one `EXT-X-KEY`, with no
`EXT-X-DISCONTINUITY`, and the DRM is Widevine, PlayReady, or none. AES-128 tracks, tracks
with content key rotation or discontinuities, and subtitle tracks keep the merge after the download.
`EXT-X-DISCONTINUITY`, and the DRM is Widevine, PlayReady, or none. A track of a DRM plugin that
decrypts each segment needs no init segment and no `EXT-X-KEY`, only no `EXT-X-DISCONTINUITY`.
AES-128 tracks, tracks with content key rotation or discontinuities, and subtitle tracks keep the
merge after the download.
With [`continue_downloads`](#continue_downloads) on, a failed track keeps its output file and
the number of segments in it, and the next download continues from there.