Browse Source
Merge pull request #16 from HarrisonXi/master
get original meta_data and set it to mp3 file
pull/17/head
Nzix
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
0 deletions
-
ncmdump.py
|
|
@ -56,6 +56,7 @@ 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])) |
|
|
|
comment_data = meta_data.decode('utf-8') |
|
|
|
meta_data = base64.b64decode(meta_data[22:]) |
|
|
|
|
|
|
|
cryptor = AES.new(meta_key, AES.MODE_ECB) |
|
|
@ -109,6 +110,7 @@ def dump(input_path, output_path = None, skip = True): |
|
|
|
image = id3.APIC() |
|
|
|
embed(image, image_data) |
|
|
|
audio.tags.add(image) |
|
|
|
audio.tags.add(id3.COMM(text = comment_data)) |
|
|
|
audio.save() |
|
|
|
|
|
|
|
if meta_length: |
|
|
|