feat(dl): Improve DRM track decryption handling

This commit is contained in:
Andy
2025-08-04 05:40:45 +00:00
parent c6c83ee43b
commit 3e0835d9fb

View File

@@ -992,12 +992,15 @@ class dl:
with console.status(f"Decrypting tracks with {decrypt_tool}..."):
has_decrypted = False
for track in drm_tracks:
for drm in track.drm:
if hasattr(drm, "decrypt"):
drm = track.get_drm_for_cdm(self.cdm)
if drm and hasattr(drm, "decrypt"):
drm.decrypt(track.path, use_mp4decrypt=use_mp4decrypt)
has_decrypted = True
events.emit(events.Types.TRACK_REPACKED, track=track)
break
else:
self.log.warning(
f"No matching DRM found for track {track} with CDM type {type(self.cdm).__name__}"
)
if has_decrypted:
self.log.info(f"Decrypted tracks with {decrypt_tool}")