From 6bf1119b81edac1717f69a997f86ce037e70b300 Mon Sep 17 00:00:00 2001 From: Nzix Date: Tue, 25 Jun 2019 14:49:43 +0800 Subject: [PATCH] fix audio tags none error --- ncmdump.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ncmdump.py b/ncmdump.py index 445d9e6..22566e5 100644 --- a/ncmdump.py +++ b/ncmdump.py @@ -61,8 +61,8 @@ def dump(input_path, output_path = None, skip = True): meta_data = base64.b64decode(meta_data[22:]) cryptor = AES.new(meta_key, AES.MODE_ECB) - meta_data = unpad(cryptor.decrypt(meta_data)).decode('utf-8')[6:] - meta_data = json.loads(meta_data) + meta_data = unpad(cryptor.decrypt(meta_data)).decode('utf-8') + meta_data = json.loads(meta_data[6:]) else: meta_data = {'format': 'flac' if os.fstat(f.fileno()).st_size > 1024 ** 2 * 16 else 'mp3'} @@ -120,6 +120,7 @@ def dump(input_path, output_path = None, skip = True): audio['description'] = identification else: audio = mp3.EasyMP3(output_path) + audio['title'] = 'placeholder' audio.tags.RegisterTextKey('comment', 'COMM') audio['comment'] = identification audio['title'] = meta_data['musicName']