From 60445b7ed985b2ac4102d00dc9b26e3e0ca26ffc Mon Sep 17 00:00:00 2001 From: MengYX Date: Mon, 27 Jan 2020 12:50:24 +0800 Subject: [PATCH] #11 Add Moo Music Format --- README.md | 3 ++- package.json | 2 +- src/App.vue | 11 ++++++----- src/decrypt/common.js | 2 ++ src/decrypt/qmc.js | 25 +++++++++++-------------- 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 266e376..d30fbe6 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ # Features - [x] Unlock in browser 在浏览器中解锁 - [x] QQMusic Format QQ音乐格式 (.qmc0/.qmc3/.qmcflac/.qmcogg) -- [x] QQMusic Tm Format QQ音乐 (.tm0/.tm2/.tm3/.tm6) +- [x] MooMusic Format Moo音乐格式 ([.bkcmp3/.bkcflac](https://github.com/ix64/unlock-music/issues/11)) +- [x] QQMusic Tm Format QQ音乐Tm格式 (.tm0/.tm2/.tm3/.tm6) - [ ] QQMusic New Format QQ音乐新格式 - [x] .mflac (Partial 部分支持) - [ ] .mgg diff --git a/package.json b/package.json index 6dbd118..de71d0c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "unlock-music", - "version": "1.1.0", + "version": "1.1.1", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/src/App.vue b/src/App.vue index 8cd8fd8..ae4e303 100644 --- a/src/App.vue +++ b/src/App.vue @@ -67,7 +67,8 @@ 音乐解锁:移除已购音乐的加密保护。 - 目前支持网易云音乐(ncm)和QQ音乐(qmc0, qmc3, qmcflac, qmcogg, mflac)。 + 目前支持网易云音乐(ncm)、QQ音乐(qmc0, qmc3, qmcflac, qmcogg, mflac)以及 + 其他格式使用提示 @@ -108,7 +109,7 @@ this.$notify.info({ title: '离线使用', message: '我们使用PWA技术,无网络也能使用
' + - '最近更新:支持tm0/2/3/6
' + + '最近更新:支持bkcmp3/bkcflac
' + '点击查看 使用提示', dangerouslyUseHTMLString: true, duration: 10000, @@ -118,7 +119,7 @@ handleFile(file) { (async () => { - let data =await dec.CommonDecrypt(file); + let data = await dec.CommonDecrypt(file); if (data.status) { this.tableData.push(data); this.$notify.success({ @@ -193,8 +194,8 @@ } #app-footer a { - padding-left: 0.5em; - padding-right: 0.5em; + padding-left: 0.2em; + padding-right: 0.2em; } #app-footer { diff --git a/src/decrypt/common.js b/src/decrypt/common.js index fcb4195..9ab2ab8 100644 --- a/src/decrypt/common.js +++ b/src/decrypt/common.js @@ -27,6 +27,8 @@ async function CommonDecrypt(file) { case "qmc0"://QQ Music Android Mp3 case "qmcflac"://QQ Music Android Flac case "qmcogg"://QQ Music Android Ogg + case "bkcmp3"://Moo Music Mp3 + case "bkcflac"://Moo Music Flac rt_data = await QmcDecrypt.Decrypt(file.raw, raw_filename, raw_ext); break; case "mflac"://QQ Music Desktop Flac diff --git a/src/decrypt/qmc.js b/src/decrypt/qmc.js index f1485de..3a0fbf1 100644 --- a/src/decrypt/qmc.js +++ b/src/decrypt/qmc.js @@ -11,24 +11,21 @@ const SEED_MAP = [ [0x0e, 0x74, 0xbb, 0x90, 0xbc, 0x3f, 0x92], [0x00, 0x09, 0x5b, 0x9f, 0x62, 0x66, 0xa1]]; +const OriginalExtMap = { + "qmc0": "mp3", + "qmc3": "mp3", + "qmcogg": "ogg", + "qmcflac": "flac", + "bkcmp3": "mp3", + "bkcflac": "flac" +}; async function Decrypt(file, raw_filename, raw_ext) { // 获取扩展名 - let new_ext; - switch (raw_ext) { - case "qmc0": - case "qmc3": - new_ext = "mp3"; - break; - case "qmcogg": - new_ext = "ogg"; - break; - case "qmcflac": - new_ext = "flac"; - break; - default: - return {status: false, message: "File type is incorrect!"} + if (!(raw_ext in OriginalExtMap)) { + return {status: false, message: "File type is incorrect!"} } + let new_ext = OriginalExtMap[raw_ext] const mime = util.AudioMimeType[new_ext]; // 读取文件 const fileBuffer = await util.GetArrayBuffer(file);