|
|
@ -5,7 +5,8 @@ import {
|
|
|
|
GetFileInfo,
|
|
|
|
GetFileInfo,
|
|
|
|
GetMetaCoverURL,
|
|
|
|
GetMetaCoverURL,
|
|
|
|
GetWebImage,
|
|
|
|
GetWebImage,
|
|
|
|
IXAREA_API_ENDPOINT
|
|
|
|
IXAREA_API_ENDPOINT,
|
|
|
|
|
|
|
|
WriteMp3Meta
|
|
|
|
} from "./util";
|
|
|
|
} from "./util";
|
|
|
|
import {QmcMaskCreate58, QmcMaskDetectMflac, QmcMaskDetectMgg, QmcMaskGetDefault} from "./qmcMask";
|
|
|
|
import {QmcMaskCreate58, QmcMaskDetectMflac, QmcMaskDetectMgg, QmcMaskGetDefault} from "./qmcMask";
|
|
|
|
import {fromByteArray as Base64Encode, toByteArray as Base64Decode} from 'base64-js'
|
|
|
|
import {fromByteArray as Base64Encode, toByteArray as Base64Decode} from 'base64-js'
|
|
|
@ -85,14 +86,9 @@ export async function Decrypt(file, raw_filename, raw_ext) {
|
|
|
|
imgUrl = imageInfo.url
|
|
|
|
imgUrl = imageInfo.url
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (ext === "mp3") {
|
|
|
|
if (ext === "mp3") {
|
|
|
|
let writer = new ID3Writer(musicDecoded)
|
|
|
|
musicDecoded = await WriteMp3Meta(musicDecoded,
|
|
|
|
writer.setFrame('APIC', {
|
|
|
|
info.artist.split(" _ "), info.title, "",
|
|
|
|
type: 3,
|
|
|
|
imageInfo.buffer, "Cover", musicMeta)
|
|
|
|
data: imageInfo.buffer,
|
|
|
|
|
|
|
|
description: "Cover",
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
writer.addTag();
|
|
|
|
|
|
|
|
musicDecoded = writer.arrayBuffer
|
|
|
|
|
|
|
|
musicBlob = new Blob([musicDecoded], {type: mime});
|
|
|
|
musicBlob = new Blob([musicDecoded], {type: mime});
|
|
|
|
} else if (ext === 'flac') {
|
|
|
|
} else if (ext === 'flac') {
|
|
|
|
const writer = new MetaFlac(Buffer.from(musicDecoded))
|
|
|
|
const writer = new MetaFlac(Buffer.from(musicDecoded))
|
|
|
|