From e2d42830033cda018fe40bcfecfe04f033b181a4 Mon Sep 17 00:00:00 2001 From: MengYX Date: Sat, 18 Jul 2020 18:48:07 +0800 Subject: [PATCH] Write meta for qq music mp3 --- src/decrypt/qmc.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/decrypt/qmc.js b/src/decrypt/qmc.js index 73386bd..bcc4788 100644 --- a/src/decrypt/qmc.js +++ b/src/decrypt/qmc.js @@ -76,12 +76,14 @@ export async function Decrypt(file, raw_filename, raw_ext) { if (imageInfo.url !== "") { imgUrl = imageInfo.url if (ext === "mp3") { - let writer = new ID3Writer(audioData) + let writer = new ID3Writer(musicDecoded) writer.setFrame('APIC', { type: 3, data: imageInfo.buffer, description: "Cover", }) + writer.addTag(); + musicDecoded = writer.arrayBuffer musicBlob = new Blob([musicDecoded], {type: mime}); } } @@ -133,11 +135,12 @@ async function queryAlbumCoverImage(artist, title, album) { jsonpData = await RequestJsonp(song_query_url, "callback"); queriedSong = jsonpData["data"]["song"]["list"][0]; } catch (e) { + console.log(e) } let imgUrl = ""; if (!!queriedSong && !!queriedSong["album"]) { if (queriedSong["album"]["pmid"] !== undefined) { - imgUrl = "https://stats.ixarea.com/collect/qq-cover/1/" + queriedSong["album"]["pmid"] + imgUrl = "https://stats.ixarea.com/collect/music/qq-cover/1/" + queriedSong["album"]["pmid"] } else if (queriedSong["album"]["id"] !== undefined) { imgUrl = "https://stats.ixarea.com/collect/music/qq-cover/2/" + queriedSong["album"]["id"] }