From 2a4dfb3e93259423e270312a4ad07da4b8222085 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Fri, 17 Mar 2023 01:52:47 +0000 Subject: [PATCH] Improve anti-duplicate checks in Widevine tree logs While it already has anti-duplicate checks, these checks did not take into account the `*` indicator, or `from x vault` e.t.c. This rework of the duplicate check ignores all messages. --- devine/commands/dl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devine/commands/dl.py b/devine/commands/dl.py index bba5f16..40f854e 100644 --- a/devine/commands/dl.py +++ b/devine/commands/dl.py @@ -643,7 +643,7 @@ class dl: if content_key: drm.content_keys[kid] = content_key label = f"[text2]{kid.hex}:{content_key}{is_track_kid} from {vault_used}" - if not any(x.label == label for x in cek_tree.children): + if not any(f"{kid.hex}:{content_key}" in x.label for x in cek_tree.children): cek_tree.add(label) self.vaults.add_key(kid, content_key, excluding=vault_used) elif vaults_only: @@ -676,7 +676,7 @@ class dl: if key == "0" * 32: key = f"[red]{key}[/]" label = f"[text2]{kid_.hex}:{key}{is_track_kid}" - if not any(x.label == label for x in cek_tree.children): + if not any(f"{kid_.hex}:{key}" in x.label for x in cek_tree.children): cek_tree.add(label) drm.content_keys = {