Move Track OnDownloaded event before decryption

This commit is contained in:
rlaphoenix
2024-02-10 17:50:06 +00:00
parent a98d1d98ac
commit 87779f4e7d
4 changed files with 9 additions and 6 deletions

View File

@@ -502,6 +502,10 @@ class DASH:
f.write(segment_data)
segment_file.unlink()
track.path = save_path
if callable(track.OnDownloaded):
track.OnDownloaded()
if drm:
progress(downloaded="Decrypting", completed=0, total=100)
drm.decrypt(save_path)
@@ -510,7 +514,6 @@ class DASH:
track.OnDecrypted(drm)
progress(downloaded="Decrypted", completed=100)
track.path = save_path
save_dir.rmdir()
progress(downloaded="Downloaded")