From 59dd81f5a07b7909f242b8195c3265937855feb7 Mon Sep 17 00:00:00 2001 From: work-dell-pc Date: Mon, 24 Jun 2024 08:48:26 +0800 Subject: [PATCH] add param identifier_flag --- ncmdump/core.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ncmdump/core.py b/ncmdump/core.py index 4313405..f0040cc 100644 --- a/ncmdump/core.py +++ b/ncmdump/core.py @@ -14,7 +14,7 @@ from Crypto.Util.strxor import strxor from mutagen import mp3, flac, id3 -def dump(input_path, output_path = None, skip = True): +def dump(input_path, output_path = None, skip = True,identifier_flag=False): output_path = (lambda path, meta: os.path.splitext(path)[0] + '.' + meta['format']) if not output_path else output_path output_path_generator = (lambda path, meta: output_path) if not callable(output_path) else output_path @@ -57,7 +57,10 @@ def dump(input_path, output_path = None, skip = True): if meta_length: meta_data = bytearray(f.read(meta_length)) meta_data = bytes(bytearray([byte ^ 0x63 for byte in meta_data])) - identifier = meta_data.decode('utf-8') + if identifier_flag == True: + identifier = meta_data.decode('utf-8') + else: + identifier = "" meta_data = base64.b64decode(meta_data[22:]) cryptor = AES.new(meta_key, AES.MODE_ECB)