mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2025-10-23 15:11:08 +00:00
feat(dl): Improve DRM track decryption handling
This commit is contained in:
@@ -992,12 +992,15 @@ class dl:
|
|||||||
with console.status(f"Decrypting tracks with {decrypt_tool}..."):
|
with console.status(f"Decrypting tracks with {decrypt_tool}..."):
|
||||||
has_decrypted = False
|
has_decrypted = False
|
||||||
for track in drm_tracks:
|
for track in drm_tracks:
|
||||||
for drm in track.drm:
|
drm = track.get_drm_for_cdm(self.cdm)
|
||||||
if hasattr(drm, "decrypt"):
|
if drm and hasattr(drm, "decrypt"):
|
||||||
drm.decrypt(track.path, use_mp4decrypt=use_mp4decrypt)
|
drm.decrypt(track.path, use_mp4decrypt=use_mp4decrypt)
|
||||||
has_decrypted = True
|
has_decrypted = True
|
||||||
events.emit(events.Types.TRACK_REPACKED, track=track)
|
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:
|
if has_decrypted:
|
||||||
self.log.info(f"Decrypted tracks with {decrypt_tool}")
|
self.log.info(f"Decrypted tracks with {decrypt_tool}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user