Browse Source

Fix GBK Detect Bug

20230320
MengYX 5 years ago
parent
commit
0b52a0acb2
No known key found for this signature in database GPG Key ID: E63F9C7303E8F604
  1. 7
      src/decrypt/qmc.js

7
src/decrypt/qmc.js

@ -42,13 +42,14 @@ export async function Decrypt(file, raw_filename, raw_ext) {
let musicBlob = new Blob([musicDecoded], {type: mime}); let musicBlob = new Blob([musicDecoded], {type: mime});
const musicMeta = await musicMetadata.parseBlob(musicBlob); const musicMeta = await musicMetadata.parseBlob(musicBlob);
let isGbk = musicMeta.native["ID3v2.3"] for (let metaIdx in musicMeta.native) {
.some(item => item.id === "TCON" && item.value === "(12)"); if (musicMeta.native[metaIdx].some(item => item.id === "TCON" && item.value === "(12)")) {
if (isGbk) {
musicMeta.common.artist = decode(musicMeta.common.artist, "gbk"); musicMeta.common.artist = decode(musicMeta.common.artist, "gbk");
musicMeta.common.title = decode(musicMeta.common.title, "gbk"); musicMeta.common.title = decode(musicMeta.common.title, "gbk");
musicMeta.common.album = decode(musicMeta.common.album, "gbk"); musicMeta.common.album = decode(musicMeta.common.album, "gbk");
} }
}
//todo: Use artists list to replace artist //todo: Use artists list to replace artist
const info = GetFileInfo(musicMeta.common.artist, musicMeta.common.title, raw_filename); const info = GetFileInfo(musicMeta.common.artist, musicMeta.common.title, raw_filename);
if (handler.detect) reportKeyUsage(keyData, seed.Matrix128, if (handler.detect) reportKeyUsage(keyData, seed.Matrix128,

Loading…
Cancel
Save