8 Commits
1.0.0 ... 1.0.1

Author SHA1 Message Date
MengYX
0ca830e896 Fix No Status Error 2019-11-23 19:11:40 +08:00
MengYX
2266ca2cf1 Fix Download Button 2019-11-23 18:56:45 +08:00
MengYX
c71cb8ee85 Show Detail Info While Error Occurred 2019-11-23 18:30:59 +08:00
MengYX
b68efea15b Update Dependencies 2019-11-23 18:14:15 +08:00
MengYX
591c1a5312 Add Partial Support For .mflac 2019-11-23 18:09:33 +08:00
MengYX
95de3e8cc5 Reformat Code [SKIP CI] 2019-11-23 15:10:08 +08:00
MengYX
d91f48aa70 Add tips for qmcogg 2019-11-23 15:03:45 +08:00
MengYX
497a63486d CI: Auto Deploy and Use Cache 2019-11-10 22:38:43 +08:00
13 changed files with 285 additions and 113 deletions

View File

@@ -7,10 +7,20 @@ clone:
depth: 1
steps:
- name: restore-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount:
- ./node_modules
- name: installDependencies
image: node:lts
commands:
- npm config set registry http://registry.npm.taobao.org
- npm config set registry http://registry.npm.taobao.org --global
- npm install
- name: build
@@ -31,3 +41,30 @@ steps:
- sha256
when:
event: [tag]
- name: deploy
image: plugins/s3
settings:
bucket: unlock-music
access_key:
from_secret: aws_access_key_id
secret_key:
from_secret: aws_secret_access_key
source: dist/**/*
target: /
path_style: true
endpoint: https://fs.sz2.ixarea.com
- name: rebuild-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- ./node_modules
volumes:
- name: cache
host:
path: /tmp/cache

View File

@@ -7,8 +7,11 @@
## Features
- [x] Unlock in browser 在浏览器中解锁
- [x] QQMusic File QQ音乐文件 (.qmc0/.qmc3/.qmcflac)
- [x] Netease File 网易云音乐文件 (.ncm)
- [x] QQMusic File QQ音乐格式 (.qmc0/.qmc3/.qmcflac/.qmcogg)
- [ ] QQMusic New Format QQ音乐新格式
- [x] .mflac (Partial 部分支持)
- [ ] .mgg
- [x] Netease Format 网易云音乐格式 (.ncm)
- [x] Drag and Drop 拖放文件
- [x] Play instantly 在线播放
- [x] Batch unlocking 批量解锁

30
package-lock.json generated
View File

@@ -2274,9 +2274,9 @@
"dev": true
},
"browser-id3-writer": {
"version": "4.2.0",
"resolved": "https://registry.npm.taobao.org/browser-id3-writer/download/browser-id3-writer-4.2.0.tgz",
"integrity": "sha1-tdQwtw0NHgiDmDyFHuFdS98xYPQ="
"version": "4.3.0",
"resolved": "https://registry.npm.taobao.org/browser-id3-writer/download/browser-id3-writer-4.3.0.tgz",
"integrity": "sha1-fHnGl3gqSkt+woHLz8zJVtelj1Q="
},
"browserify-aes": {
"version": "1.2.0",
@@ -6941,15 +6941,15 @@
"dev": true
},
"music-metadata": {
"version": "4.8.4",
"resolved": "https://registry.npm.taobao.org/music-metadata/download/music-metadata-4.8.4.tgz",
"integrity": "sha1-5NHdKFtHzm3eI4hQn4XC8T+GctU=",
"version": "5.0.1",
"resolved": "https://registry.npm.taobao.org/music-metadata/download/music-metadata-5.0.1.tgz",
"integrity": "sha1-lKqtul6CZFEIx6jSzHcujnvvrrk=",
"requires": {
"content-type": "^1.0.4",
"debug": "^4.1.0",
"file-type": "^12.4.0",
"media-typer": "^1.1.0",
"strtok3": "^3.0.6",
"strtok3": "^3.1.0",
"token-types": "^1.1.0"
},
"dependencies": {
@@ -6961,14 +6961,14 @@
}
},
"music-metadata-browser": {
"version": "1.6.3",
"resolved": "https://registry.npm.taobao.org/music-metadata-browser/download/music-metadata-browser-1.6.3.tgz",
"integrity": "sha1-Utjto4DW3fydFfMxs8zrkJktzVg=",
"version": "1.8.1",
"resolved": "https://registry.npm.taobao.org/music-metadata-browser/download/music-metadata-browser-1.8.1.tgz",
"integrity": "sha1-jDhGLoizhGZFNdjT20vT8Hbf2HA=",
"requires": {
"assert": "^2.0.0",
"buffer": "^5.2.1",
"debug": "^4.0.1",
"music-metadata": "^4.8.4",
"music-metadata": "^5.0.1",
"readable-stream": "^3.3.0",
"readable-web-to-node-stream": "^2.0.0",
"remove": "^0.1.5",
@@ -9695,9 +9695,9 @@
"dev": true
},
"strtok3": {
"version": "3.0.6",
"resolved": "https://registry.npm.taobao.org/strtok3/download/strtok3-3.0.6.tgz",
"integrity": "sha1-t1rUvQAUa4vFZQcmbMCN8KArT+w=",
"version": "3.1.1",
"resolved": "https://registry.npm.taobao.org/strtok3/download/strtok3-3.1.1.tgz",
"integrity": "sha1-W6gVLby3RIhBX4Y7PgdnSUUKY9k=",
"requires": {
"debug": "^4.1.1",
"then-read-stream": "^2.0.8",
@@ -10044,7 +10044,7 @@
},
"typedarray-to-buffer": {
"version": "3.1.5",
"resolved": "https://registry.npm.taobao.org/typedarray-to-buffer/download/typedarray-to-buffer-3.1.5.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftypedarray-to-buffer%2Fdownload%2Ftypedarray-to-buffer-3.1.5.tgz",
"resolved": "https://registry.npm.taobao.org/typedarray-to-buffer/download/typedarray-to-buffer-3.1.5.tgz",
"integrity": "sha1-qX7nqf9CaRufeD/xvFES/j/KkIA=",
"requires": {
"is-typedarray": "^1.0.0"

View File

@@ -7,11 +7,11 @@
"build": "vue-cli-service build"
},
"dependencies": {
"browser-id3-writer": "^4.2.0",
"browser-id3-writer": "^4.3.0",
"core-js": "^2.6.10",
"crypto-js": "^3.1.9-1",
"element-ui": "^2.11.1",
"music-metadata-browser": "^1.6.3",
"music-metadata-browser": "^1.8.1",
"register-service-worker": "^1.6.2",
"vue": "^2.6.10"
},

View File

@@ -2,15 +2,15 @@
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="width=device-width,initial-scale=1.0" name="viewport">
<script>var _paq = window._paq || [];
_paq.push(['trackPageView'], ['enableLinkTracking'], ['setSiteId', '2'],
['setTrackerUrl', 'https://stats.ixarea.com/ixarea-stats/report']);
</script>
<script async src="https://stats.ixarea.com/ixarea-stats.js"></script>
<title>音乐解锁 - By IXarea</title>
<meta content="音乐,解锁,ncm,qmc,qmc0,qmc3,qmcflac,qq音乐,网易云音乐,加密" name="keywords"/>
<meta content="音乐,解锁,ncm,qmc,qmc0,qmc3,qmcflac,qmcogg,mflac,qq音乐,网易云音乐,加密" name="keywords"/>
<meta content="音乐解锁 - 在任何设备上解锁已购的加密音乐!" name="description"/>
<style>
#loader {
@@ -60,9 +60,9 @@
style="border:0"/>
</noscript>
<strong>音乐解锁采用了一些新特性!建议使用
<a target="_blank" href="https://www.google.cn/chrome/">Google Chrome</a>
<a target="_blank" href="https://www.firefox.com.cn/">Mozilla Firefox</a>
| <a target="_blank" href="https://github.com/ix64/unlock-music/wiki/使用提示">使用提示</a>
<a href="https://www.google.cn/chrome/" target="_blank">Google Chrome</a>
<a href="https://www.firefox.com.cn/" target="_blank">Mozilla Firefox</a>
| <a href="https://github.com/ix64/unlock-music/wiki/使用提示" target="_blank">使用提示</a>
</strong>
</div>
<div id="app"></div>

View File

@@ -6,7 +6,7 @@
:auto-upload="false"
:on-change="handleFile"
:show-file-list="false"
accept=".ncm,.qmc0,.qmc3,.qmcflac,.qmcogg"
accept=".ncm,.qmc0,.qmc3,.qmcflac,.qmcogg,.mflac"
action=""
drag
multiple>
@@ -26,9 +26,13 @@
<el-table :data="tableData" style="width: 100%">
<el-table-column label="图片">
<el-table-column label="封面">
<template slot-scope="scope">
<el-image :src="scope.row.picture" style="width: 100px; height: 100px"></el-image>
<el-image :src="scope.row.picture" style="width: 100px; height: 100px">
<div class="image-slot el-image__error" slot="error">
暂无封面
</div>
</el-image>
</template>
</el-table-column>
<el-table-column label="歌曲" sortable>
@@ -51,14 +55,9 @@
<el-button @click="handlePlay(scope.$index, scope.row)"
circle icon="el-icon-video-play" type="success">
</el-button>
<el-button circle>
<el-link :download="scope.row.filename" :href="scope.row.file"
:underline="false" icon="el-icon-download">
</el-link>
<el-button @click="handleDownload(scope.row)"
circle icon="el-icon-download">
</el-button>
<el-button @click="handleDelete(scope.$index, scope.row)"
circle icon="el-icon-delete" type="danger">
</el-button>
@@ -69,7 +68,7 @@
<el-footer id="app-footer">
<el-row>
音乐解锁移除已购音乐的加密保护
目前支持网易云音乐(ncm)和QQ音乐(qmc0, qmc3, qmcflac)
目前支持网易云音乐(ncm)和QQ音乐(qmc0, qmc3, qmcflac, qmcogg, mflac)
<a href="https://github.com/ix64/unlock-music/wiki/使用提示" target="_blank">使用提示</a>
</el-row>
<el-row>
@@ -90,6 +89,7 @@
const NcmDecrypt = require("./plugins/ncm");
const QmcDecrypt = require("./plugins/qmc");
const RawDecrypt = require("./plugins/raw");
const MFlacDecrypt = require("./plugins/mflac");
export default {
name: 'app',
components: {},
@@ -135,10 +135,17 @@
case "qmcogg":
data = await QmcDecrypt.Decrypt(file.raw);
break;
case "mflac":
data = await MFlacDecrypt.Decrypt(file.raw);
break;
default:
data = {
status: false,
message: "不支持此文件格式",
};
break;
}
if (null != data) {
if (data.status) {
this.tableData.push(data);
this.$notify.success({
title: '解锁成功',
@@ -155,17 +162,14 @@
window._paq.push(["trackEvent", "Unlock", "Success", JSON.stringify(_rp_data)]);
} else {
this.$notify.error({
title: '错误',
message: '解析此文件时出现问题,请查看<a target="_blank" href="https://github.com/ix64/unlock-music/wiki/使用提示">使用提示</a>',
title: '出现问题',
message: data.message + "" + file.name +
',参考<a target="_blank" href="https://github.com/ix64/unlock-music/wiki/使用提示">使用提示</a>',
dangerouslyUseHTMLString: true
});
window._paq.push(["trackEvent", "Unlock", "Error", file.name]);
}
})();
},
handlePlay(index, row) {
this.playing_url = row.file;
@@ -177,6 +181,14 @@
URL.revokeObjectURL(row.picture);
this.tableData.splice(index, 1);
},
handleDownload(row) {
let a = document.createElement('a');
a.href = row.file;
a.download = row.filename;
document.body.append(a);
a.click();
a.remove();
},
handleDeleteAll() {
this.tableData.forEach(value => {
URL.revokeObjectURL(value.file);
@@ -188,17 +200,11 @@
let index = 0;
let c = setInterval(() => {
if (index < this.tableData.length) {
let a = document.createElement('a');
a.href = this.tableData[index].file;
a.download = this.tableData[index].filename;
document.body.append(a);
a.click();
a.remove();
this.handleDownload(this.tableData[index]);
index++;
} else {
clearInterval(c);
}
}, 1000);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -1,18 +1,18 @@
import Vue from 'vue'
import {
Image,
Button,
Col,
Container,
Footer,
Icon,
Image,
Link,
Main,
Notification,
Row,
Table,
TableColumn,
Main,
Footer,
Container,
Icon,
Row,
Col,
Upload,
Notification,
Link
Upload
} from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'
@@ -29,5 +29,3 @@ Vue.use(Row);
Vue.use(Col);
Vue.use(Upload);
Vue.prototype.$notify = Notification;

124
src/plugins/mflac.js Normal file
View File

@@ -0,0 +1,124 @@
const musicMetadata = require("music-metadata-browser");
export {Decrypt}
async function Decrypt(file) {
// 获取扩展名
let filename_ext = file.name.substring(file.name.lastIndexOf(".") + 1, file.name.length).toLowerCase();
if (filename_ext !== "mflac") return {
status: false,
message: "File type is incorrect!",
};
// 读取文件
const fileBuffer = await new Promise(resolve => {
const reader = new FileReader();
reader.onload = (e) => {
resolve(e.target.result);
};
reader.readAsArrayBuffer(file);
});
const audioData = new Uint8Array(fileBuffer.slice(0, -0x170));
const audioDataLen = audioData.length;
// 转换数据
const seed = new Mask();
if (!seed.DetectMask(audioData)) return{
status: false,
message: "此音乐无法解锁目前mflac格式不提供完整支持",
};
for (let cur = 0; cur < audioDataLen; ++cur) {
audioData[cur] ^= seed.NextMask();
}
// 导出
const musicData = new Blob([audioData], {type: "audio/flac"});
const musicUrl = URL.createObjectURL(musicData);
// 读取Meta
let tag = await musicMetadata.parseBlob(musicData);
// 处理无标题歌手
let filename_array = file.name.substring(0, file.name.lastIndexOf(".")).split("-");
let title = tag.common.title;
let artist = tag.common.artist;
if (filename_array.length > 1) {
if (artist === undefined) artist = filename_array[0].trim();
if (title === undefined) title = filename_array[1].trim();
} else if (filename_array.length === 1) {
if (title === undefined) title = filename_array[0].trim();
}
const filename = artist + " - " + title + ".flac";
// 处理无封面
let pic_url = "";
if (tag.common.picture !== undefined && tag.common.picture.length >= 1) {
const picture = tag.common.picture[0];
const blobPic = new Blob([picture.data], {type: picture.format});
pic_url = URL.createObjectURL(blobPic);
}
// 返回*/
return {
status: true,
message: "",
filename: filename,
title: title,
artist: artist,
album: tag.common.album,
picture: pic_url,
file: musicUrl,
mime: "audio/flac"
}
}
class Mask {
FLAC_HEADER = [0x66, 0x4C, 0x61, 0x43, 0x00];
constructor() {
this.index = -1;
this.mask_index = -1;
this.mask = Array(128).fill(0x00);
}
DetectMask(data) {
let search_len = data.length - 256, mask;
for (let block_idx = 0; block_idx < search_len; block_idx += 128) {
let flag = true;
mask = data.slice(block_idx, block_idx + 128);
let next_mask = data.slice(block_idx + 128, block_idx + 256);
for (let idx = 0; idx < 128; idx++) {
if (mask[idx] !== next_mask[idx]) {
flag = false;
break;
}
}
if (!flag) continue;
for (let test_idx = 0; test_idx < this.FLAC_HEADER.length; test_idx++) {
let p = data[test_idx] ^ mask[test_idx];
if (p !== this.FLAC_HEADER[test_idx]) {
flag = false;
debugger;
break;
}
}
if (!flag) continue;
this.mask = mask;
return true;
}
return false;
}
NextMask() {
this.index++;
this.mask_index++;
if (this.index === 0x8000 || (this.index > 0x8000 && (this.index + 1) % 0x8000 === 0)) {
this.index++;
this.mask_index++;
}
if (this.mask_index >= 128) {
this.mask_index -= 128;
}
return this.mask[this.mask_index]
}
}

View File

@@ -24,10 +24,10 @@ async function Decrypt(file) {
if (dataView.getUint32(0, true) !== 0x4e455443 ||
dataView.getUint32(4, true) !== 0x4d414446
) {
console.log({type: "error", data: "not ncm file"});
return;
}
) return {
status: false,
message: "此ncm文件已损坏",
};
let offset = 10;
@@ -50,14 +50,13 @@ async function Decrypt(file) {
const result = new Uint8Array(plainText.sigBytes);
{
const words = plainText.words;
const sigBytes = plainText.sigBytes;
for (let i = 0; i < sigBytes; i++) {
result[i] = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
}
const words = plainText.words;
const sigBytes = plainText.sigBytes;
for (let i = 0; i < sigBytes; i++) {
result[i] = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
}
return result.slice(17);
})();
@@ -130,13 +129,12 @@ async function Decrypt(file) {
}
if (musicMeta.format === undefined) {
musicMeta.format = (() => {
const [f, L, a, C] = audioData;
if (f === 0x66 && L === 0x4c && a === 0x61 && C === 0x43) {
return "flac";
}
return "mp3";
})();
const [f, L, a, C] = audioData;
if (f === 0x66 && L === 0x4c && a === 0x61 && C === 0x43) {
musicMeta.format = "flac";
} else {
musicMeta.format = "mp3";
}
}
const mime = audio_mime_type[musicMeta.format];
@@ -172,6 +170,7 @@ async function Decrypt(file) {
const musicUrl = URL.createObjectURL(musicData);
const filename = artists.join(" & ") + " - " + musicMeta.musicName + "." + musicMeta.format;
return {
status: true,
filename: filename,
title: musicMeta.musicName,
artist: artists.join(" & "),

View File

@@ -11,7 +11,8 @@ const SEED_MAP = [
[0x00, 0x09, 0x5b, 0x9f, 0x62, 0x66, 0xa1]];
const audio_mime_type = {
mp3: "audio/mpeg",
flac: "audio/flac"
flac: "audio/flac",
ogg: "audio/ogg"
};
async function Decrypt(file) {
@@ -21,14 +22,19 @@ async function Decrypt(file) {
switch (filename_ext) {
case "qmc0":
case "qmc3":
case "qmcogg":
new_ext = "mp3";
break;
case "qmcogg":
new_ext = "ogg";
break;
case "qmcflac":
new_ext = "flac";
break;
default:
return;
return {
status: false,
message: "File type is incorrect!",
};
}
const mime = audio_mime_type[new_ext];
// 读取文件
@@ -75,6 +81,7 @@ async function Decrypt(file) {
}
// 返回
return {
status:true,
filename: filename,
title: title,
artist: artist,
@@ -114,7 +121,4 @@ class Mask {
return ret
}
}

View File

@@ -32,6 +32,7 @@ async function Decrypt(file) {
const filename = artist + " - " + title + "." + filename_ext;
return {
status:true,
filename: filename,
title: title,
artist: artist,

View File

@@ -1,32 +1,32 @@
/* eslint-disable no-console */
import { register } from 'register-service-worker'
import {register} from 'register-service-worker'
if (process.env.NODE_ENV === 'production') {
register(`${process.env.BASE_URL}service-worker.js`, {
ready () {
console.log(
'App is being served from cache by a service worker.\n' +
'For more details, visit https://goo.gl/AFskqB'
)
},
registered () {
console.log('Service worker has been registered.')
},
cached () {
console.log('Content has been cached for offline use.')
},
updatefound () {
console.log('New content is downloading.')
},
updated () {
console.log('New content is available; please refresh.')
},
offline () {
console.log('No internet connection found. App is running in offline mode.')
},
error (error) {
console.error('Error during service worker registration:', error)
}
})
register(`${process.env.BASE_URL}service-worker.js`, {
ready() {
console.log(
'App is being served from cache by a service worker.\n' +
'For more details, visit https://goo.gl/AFskqB'
)
},
registered() {
console.log('Service worker has been registered.')
},
cached() {
console.log('Content has been cached for offline use.')
},
updatefound() {
console.log('New content is downloading.')
},
updated() {
console.log('New content is available; please refresh.')
},
offline() {
console.log('No internet connection found. App is running in offline mode.')
},
error(error) {
console.error('Error during service worker registration:', error)
}
})
}