Compare commits
51 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
211b4e0206 | ||
![]() |
4cd5b45986 | ||
![]() |
60445b7ed9 | ||
![]() |
4e499b2deb | ||
![]() |
0cddb98612 | ||
![]() |
ca3f4c1aa4 | ||
![]() |
eec5bd0fb8 | ||
![]() |
bddde78fcd | ||
![]() |
bc138c4078 | ||
![]() |
51a5a8a44f | ||
![]() |
2fb5aecdb2 | ||
![]() |
8014c33538 | ||
![]() |
e6bce501bb | ||
![]() |
de37519f8c | ||
![]() |
a483594c4b | ||
![]() |
014fe5ae26 | ||
![]() |
73f3959094 | ||
![]() |
48658701a2 | ||
![]() |
c4e9fb0dcc | ||
![]() |
d51d7ec773 | ||
![]() |
683f58964c | ||
![]() |
0ca830e896 | ||
![]() |
2266ca2cf1 | ||
![]() |
c71cb8ee85 | ||
![]() |
b68efea15b | ||
![]() |
591c1a5312 | ||
![]() |
95de3e8cc5 | ||
![]() |
d91f48aa70 | ||
![]() |
497a63486d | ||
![]() |
538705187a | ||
![]() |
04be04204a | ||
![]() |
d99cd23e0c | ||
![]() |
c9770bdd59 | ||
![]() |
757d4d4847 | ||
![]() |
0913337612 | ||
![]() |
23ff9cdec1 | ||
![]() |
0b0b19163b | ||
![]() |
382a637a2c | ||
![]() |
82e4ec6312 | ||
![]() |
0e59843944 | ||
![]() |
c7ed517ede | ||
![]() |
bd377db39b | ||
![]() |
32128ed425 | ||
![]() |
9416ded167 | ||
![]() |
1ba40d1fc2 | ||
![]() |
76c0577185 | ||
![]() |
3ceb56900d | ||
![]() |
e0ffd3f477 | ||
![]() |
94136ec2e6 | ||
![]() |
428a4505ad | ||
![]() |
6ed0291e54 |
54
.drone.yml
Normal file
@@ -0,0 +1,54 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
clone:
|
||||
depth: 1
|
||||
|
||||
steps:
|
||||
- name: installDependencies
|
||||
image: node:lts
|
||||
commands:
|
||||
- npm ci
|
||||
|
||||
- name: build
|
||||
image: node:lts
|
||||
commands:
|
||||
- npm run build
|
||||
- tar -czf legacy.tar.gz ./dist/*
|
||||
- npm run build -- --modern
|
||||
- tar -czf morden.tar.gz ./dist/*
|
||||
|
||||
|
||||
- name: release
|
||||
image: plugins/gitea-release
|
||||
settings:
|
||||
base_url: https://git.ixarea.com
|
||||
files:
|
||||
- morden.tar.gz
|
||||
- legacy.tar.gz
|
||||
api_key:
|
||||
from_secret: gitea_token
|
||||
checksum:
|
||||
- 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
|
||||
|
||||
volumes:
|
||||
- name: cache
|
||||
host:
|
||||
path: /tmp/cache
|
55
README.md
@@ -1,29 +1,34 @@
|
||||
# music-crack
|
||||
# Unlock Music 音乐解锁
|
||||
- Unlock encrypted music file in browser.
|
||||
- 在浏览器中解锁加密的音乐文件。
|
||||
- unlock-music项目是以学习和技术研究的初衷创建的。
|
||||
- 由于存在可能的法律风险以及滥用风险,不再提供Demo服务。
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
[](https://ci.ixarea.com/ix64/unlock-music)
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
# Features
|
||||
- [x] Unlock in browser 在浏览器中解锁
|
||||
- [x] QQMusic Format QQ音乐格式 (.qmc0/.qmc3/.qmcflac/.qmcogg/.tkm)
|
||||
- [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
|
||||
- [x] Netease Format 网易云音乐格式 (.ncm)
|
||||
- [x] Drag and Drop 拖放文件
|
||||
- [x] Play instantly 在线播放
|
||||
- [x] Batch unlocking 批量解锁
|
||||
- [x] Progressive Web App 渐进式Web应用
|
||||
- [x] Complete ID3 for ncm 补全ncm的ID3信息
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
# 使用方法
|
||||
## 下载已构建版本
|
||||
- 已构建的版本发布在 [GitHub Release](https://github.com/ix64/unlock-music/releases/latest), 下载解压缩后即可部署或本地使用
|
||||
|
||||
### Run your tests
|
||||
```
|
||||
npm run test
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
## 自行构建
|
||||
- 环境要求
|
||||
- nodejs
|
||||
- npm
|
||||
1. 获取项目源代码后执行 `npm install` 安装相关依赖
|
||||
2. 执行 `npm run build` 即可进行构建,构建输出为 dist 目录
|
||||
- `npm run serve` 可用于开发
|
||||
|
@@ -1,5 +1,5 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/app'
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
||||
|
4977
package-lock.json
generated
22
package.json
@@ -1,26 +1,26 @@
|
||||
{
|
||||
"name": "music-crack",
|
||||
"version": "0.1.0",
|
||||
"name": "unlock-music",
|
||||
"version": "1.1.2",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build"
|
||||
},
|
||||
"dependencies": {
|
||||
"browser-id3-writer": "^4.1.0",
|
||||
"core-js": "^2.6.5",
|
||||
"browser-id3-writer": "^4.3.0",
|
||||
"core-js": "^3.6.4",
|
||||
"crypto-js": "^3.1.9-1",
|
||||
"element-ui": "^2.4.5",
|
||||
"jsmediatags": "^3.9.1",
|
||||
"element-ui": "^2.13.0",
|
||||
"music-metadata-browser": "^1.10.0",
|
||||
"register-service-worker": "^1.6.2",
|
||||
"vue": "^2.6.10"
|
||||
"vue": "^2.6.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^3.9.0",
|
||||
"@vue/cli-plugin-pwa": "^3.9.0",
|
||||
"@vue/cli-service": "^3.9.0",
|
||||
"@vue/cli-plugin-babel": "^4.1.2",
|
||||
"@vue/cli-plugin-pwa": "^4.1.2",
|
||||
"@vue/cli-service": "^4.1.2",
|
||||
"babel-plugin-component": "^1.1.1",
|
||||
"vue-cli-plugin-element": "^1.0.1",
|
||||
"vue-template-compiler": "^2.6.10"
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 799 B After Width: | Height: | Size: 641 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 4.2 KiB |
@@ -1,149 +1,17 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
||||
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
||||
width="16.000000pt" height="16.000000pt" viewBox="0 0 16.000000 16.000000"
|
||||
preserveAspectRatio="xMidYMid meet">
|
||||
<metadata>
|
||||
Created by potrace 1.11, written by Peter Selinger 2001-2013
|
||||
</metadata>
|
||||
<g transform="translate(0.000000,16.000000) scale(0.000320,-0.000320)"
|
||||
fill="#000000" stroke="none">
|
||||
<path d="M18 46618 c45 -75 122 -207 122 -211 0 -2 25 -45 55 -95 30 -50 55
|
||||
-96 55 -102 0 -5 5 -10 10 -10 6 0 10 -4 10 -9 0 -5 73 -135 161 -288 89 -153
|
||||
173 -298 187 -323 14 -25 32 -57 41 -72 88 -149 187 -324 189 -335 2 -7 8 -13
|
||||
13 -13 5 0 9 -4 9 -10 0 -5 46 -89 103 -187 175 -302 490 -846 507 -876 8 -16
|
||||
20 -36 25 -45 28 -46 290 -498 339 -585 13 -23 74 -129 136 -236 61 -107 123
|
||||
-215 137 -240 14 -25 29 -50 33 -56 5 -5 23 -37 40 -70 18 -33 38 -67 44 -75
|
||||
11 -16 21 -33 63 -109 14 -25 29 -50 33 -56 4 -5 21 -35 38 -65 55 -100 261
|
||||
-455 269 -465 4 -5 14 -21 20 -35 15 -29 41 -75 103 -180 24 -41 52 -88 60
|
||||
-105 9 -16 57 -100 107 -185 112 -193 362 -626 380 -660 8 -14 23 -38 33 -55
|
||||
11 -16 23 -37 27 -45 4 -8 26 -46 48 -85 23 -38 53 -90 67 -115 46 -81 64
|
||||
-113 178 -310 62 -107 121 -210 132 -227 37 -67 56 -99 85 -148 16 -27 32 -57
|
||||
36 -65 4 -8 15 -27 25 -42 9 -15 53 -89 96 -165 44 -76 177 -307 296 -513 120
|
||||
-206 268 -463 330 -570 131 -227 117 -203 200 -348 36 -62 73 -125 82 -140 10
|
||||
-15 21 -34 25 -42 4 -8 20 -37 36 -65 17 -27 38 -65 48 -82 49 -85 64 -111 87
|
||||
-153 13 -25 28 -49 32 -55 4 -5 78 -134 165 -285 87 -151 166 -288 176 -305
|
||||
10 -16 26 -43 35 -59 9 -17 125 -217 257 -445 132 -229 253 -441 270 -471 17
|
||||
-30 45 -79 64 -108 18 -29 33 -54 33 -57 0 -2 20 -37 44 -77 24 -40 123 -212
|
||||
221 -383 97 -170 190 -330 205 -355 16 -25 39 -65 53 -90 13 -25 81 -144 152
|
||||
-265 70 -121 137 -238 150 -260 12 -22 37 -65 55 -95 18 -30 43 -73 55 -95 12
|
||||
-22 48 -85 80 -140 77 -132 163 -280 190 -330 13 -22 71 -123 130 -225 59
|
||||
-102 116 -199 126 -217 10 -17 29 -50 43 -72 15 -22 26 -43 26 -45 0 -2 27
|
||||
-50 60 -106 33 -56 60 -103 60 -105 0 -2 55 -98 90 -155 8 -14 182 -316 239
|
||||
-414 13 -22 45 -79 72 -124 27 -46 49 -86 49 -89 0 -2 14 -24 30 -48 16 -24
|
||||
30 -46 30 -49 0 -5 74 -135 100 -176 5 -8 24 -42 43 -75 50 -88 58 -101 262
|
||||
-455 104 -179 199 -345 213 -370 14 -25 28 -49 32 -55 4 -5 17 -26 28 -45 10
|
||||
-19 62 -109 114 -200 114 -197 133 -230 170 -295 16 -27 33 -57 38 -65 17 -28
|
||||
96 -165 103 -180 4 -8 16 -28 26 -45 10 -16 77 -131 148 -255 72 -124 181
|
||||
-313 243 -420 62 -107 121 -209 131 -227 35 -62 323 -560 392 -678 38 -66 83
|
||||
-145 100 -175 16 -30 33 -59 37 -65 4 -5 17 -27 29 -47 34 -61 56 -100 90
|
||||
-156 17 -29 31 -55 31 -57 0 -2 17 -32 39 -67 21 -35 134 -229 251 -433 117
|
||||
-203 235 -407 261 -451 27 -45 49 -85 49 -88 0 -4 8 -19 19 -34 15 -21 200
|
||||
-341 309 -533 10 -19 33 -58 51 -87 17 -29 31 -54 31 -56 0 -2 25 -44 55 -94
|
||||
30 -50 55 -95 55 -98 0 -4 6 -15 14 -23 7 -9 27 -41 43 -71 17 -30 170 -297
|
||||
342 -594 171 -296 311 -542 311 -547 0 -5 5 -9 10 -9 6 0 10 -4 10 -10 0 -5
|
||||
22 -47 49 -92 27 -46 58 -99 68 -118 24 -43 81 -140 93 -160 5 -8 66 -114 135
|
||||
-235 69 -121 130 -227 135 -235 12 -21 259 -447 283 -490 10 -19 28 -47 38
|
||||
-62 11 -14 19 -29 19 -32 0 -3 37 -69 83 -148 99 -170 305 -526 337 -583 13
|
||||
-22 31 -53 41 -70 11 -16 22 -37 26 -45 7 -14 82 -146 103 -180 14 -24 181
|
||||
-311 205 -355 13 -22 46 -80 75 -130 29 -49 64 -110 78 -135 14 -25 51 -88 82
|
||||
-140 31 -52 59 -102 63 -110 4 -8 18 -33 31 -55 205 -353 284 -489 309 -535
|
||||
17 -30 45 -78 62 -106 18 -28 36 -60 39 -72 4 -12 12 -22 17 -22 5 0 9 -4 9
|
||||
-10 0 -5 109 -197 241 -427 133 -230 250 -431 259 -448 51 -90 222 -385 280
|
||||
-485 37 -63 78 -135 92 -160 14 -25 67 -117 118 -205 51 -88 101 -175 111
|
||||
-193 34 -58 55 -95 149 -257 51 -88 101 -173 110 -190 9 -16 76 -131 147 -255
|
||||
72 -124 140 -241 151 -260 61 -108 281 -489 355 -615 38 -66 77 -133 87 -150
|
||||
35 -63 91 -161 100 -175 14 -23 99 -169 128 -220 54 -97 135 -235 142 -245 4
|
||||
-5 20 -32 35 -60 26 -48 238 -416 276 -480 10 -16 26 -46 37 -65 30 -53 382
|
||||
-661 403 -695 10 -16 22 -37 26 -45 4 -8 26 -48 50 -88 24 -41 43 -75 43 -77
|
||||
0 -2 22 -40 50 -85 27 -45 50 -84 50 -86 0 -3 38 -69 83 -147 84 -142 302
|
||||
-520 340 -587 10 -19 34 -60 52 -90 18 -30 44 -75 57 -100 14 -25 45 -79 70
|
||||
-120 25 -41 56 -96 70 -121 14 -25 77 -133 138 -240 62 -107 122 -210 132
|
||||
-229 25 -43 310 -535 337 -581 11 -19 26 -45 34 -59 17 -32 238 -414 266 -460
|
||||
11 -19 24 -41 28 -49 3 -7 75 -133 160 -278 84 -146 153 -269 153 -274 0 -5 5
|
||||
-9 10 -9 6 0 10 -4 10 -10 0 -5 82 -150 181 -322 182 -314 201 -346 240 -415
|
||||
12 -21 80 -139 152 -263 71 -124 141 -245 155 -270 14 -25 28 -49 32 -55 6 -8
|
||||
145 -248 220 -380 37 -66 209 -362 229 -395 11 -19 24 -42 28 -49 4 -8 67
|
||||
-118 140 -243 73 -125 133 -230 133 -233 0 -2 15 -28 33 -57 19 -29 47 -78 64
|
||||
-108 17 -30 53 -93 79 -139 53 -90 82 -141 157 -272 82 -142 115 -199 381
|
||||
-659 142 -245 268 -463 281 -485 12 -22 71 -125 132 -230 60 -104 172 -298
|
||||
248 -430 76 -132 146 -253 156 -270 11 -16 22 -36 26 -44 3 -8 30 -54 60 -103
|
||||
29 -49 53 -91 53 -93 0 -3 18 -34 40 -70 22 -36 40 -67 40 -69 0 -2 37 -66 81
|
||||
-142 45 -77 98 -168 119 -204 20 -36 47 -81 58 -100 12 -19 27 -47 33 -62 6
|
||||
-16 15 -28 20 -28 5 0 9 -4 9 -9 0 -6 63 -118 140 -251 77 -133 140 -243 140
|
||||
-245 0 -2 18 -33 41 -70 22 -37 49 -83 60 -101 10 -19 29 -51 40 -71 25 -45
|
||||
109 -189 126 -218 7 -11 17 -29 22 -40 6 -11 22 -38 35 -60 14 -22 37 -62 52
|
||||
-90 14 -27 35 -62 45 -77 11 -14 19 -29 19 -32 0 -3 18 -35 40 -71 22 -36 40
|
||||
-67 40 -69 0 -2 19 -35 42 -72 23 -38 55 -94 72 -124 26 -47 139 -244 171
|
||||
-298 6 -9 21 -36 34 -60 28 -48 37 -51 51 -19 6 12 19 36 29 52 10 17 27 46
|
||||
38 65 11 19 104 181 208 360 103 179 199 345 213 370 14 25 42 74 64 109 21
|
||||
34 38 65 38 67 0 2 18 33 40 69 22 36 40 67 40 69 0 3 177 310 199 346 16 26
|
||||
136 234 140 244 2 5 25 44 52 88 27 44 49 81 49 84 0 2 18 34 40 70 22 36 40
|
||||
67 40 69 0 2 20 36 43 77 35 58 169 289 297 513 9 17 50 86 90 155 40 69 86
|
||||
150 103 180 16 30 35 62 41 70 6 8 16 24 22 35 35 64 72 129 167 293 59 100
|
||||
116 199 127 220 11 20 30 53 41 72 43 72 1070 1850 1121 1940 14 25 65 113
|
||||
113 195 48 83 96 166 107 185 10 19 28 50 38 68 11 18 73 124 137 235 64 111
|
||||
175 303 246 427 71 124 173 299 225 390 52 91 116 202 143 248 27 45 49 85 49
|
||||
89 0 4 6 14 14 22 7 9 28 43 46 76 26 47 251 436 378 655 11 19 29 51 40 70
|
||||
11 19 101 176 201 348 99 172 181 317 181 323 0 5 5 9 10 9 6 0 10 5 10 11 0
|
||||
6 8 23 18 37 11 15 32 52 49 82 16 30 130 228 253 440 122 212 234 405 248
|
||||
430 13 25 39 70 57 100 39 65 69 117 130 225 25 44 50 87 55 95 12 19 78 134
|
||||
220 380 61 107 129 224 150 260 161 277 222 382 246 425 15 28 47 83 71 123
|
||||
24 41 43 78 43 83 0 5 4 9 8 9 4 0 13 12 19 28 7 15 23 45 36 67 66 110 277
|
||||
478 277 483 0 3 6 13 14 21 7 9 27 41 43 71 17 30 45 80 63 110 34 57 375 649
|
||||
394 685 6 11 16 27 22 35 6 8 26 42 44 75 18 33 41 74 51 90 10 17 24 41 32
|
||||
55 54 97 72 128 88 152 11 14 19 28 19 30 0 3 79 141 175 308 96 167 175 305
|
||||
175 308 0 3 6 13 14 21 7 9 26 39 41 66 33 60 276 483 338 587 24 40 46 80 50
|
||||
88 4 8 13 24 20 35 14 23 95 163 125 215 11 19 52 91 92 160 40 69 80 139 90
|
||||
155 9 17 103 179 207 360 105 182 200 346 211 365 103 181 463 802 489 845 7
|
||||
11 15 27 19 35 4 8 29 51 55 95 64 110 828 1433 848 1470 9 17 24 41 33 55 9
|
||||
14 29 48 45 77 15 28 52 93 82 145 30 51 62 107 71 123 17 30 231 398 400 690
|
||||
51 88 103 179 115 202 12 23 26 48 32 55 6 7 24 38 40 68 17 30 61 107 98 170
|
||||
37 63 84 144 103 180 19 36 41 72 48 81 8 8 14 18 14 21 0 4 27 51 59 106 32
|
||||
55 72 124 89 154 16 29 71 125 122 213 51 88 104 180 118 205 13 25 28 50 32
|
||||
55 4 6 17 26 28 45 11 19 45 80 77 135 31 55 66 116 77 135 11 19 88 152 171
|
||||
295 401 694 620 1072 650 1125 11 19 87 152 170 295 83 143 158 273 166 288 9
|
||||
16 21 36 26 45 6 9 31 52 55 96 25 43 54 94 66 115 11 20 95 164 186 321 91
|
||||
157 173 299 182 315 9 17 26 46 37 65 12 19 66 114 121 210 56 96 108 186 117
|
||||
200 8 14 24 40 34 59 24 45 383 664 412 713 5 9 17 29 26 45 15 28 120 210
|
||||
241 419 36 61 68 117 72 125 4 8 12 23 19 34 35 57 245 420 262 453 11 20 35
|
||||
61 53 90 17 29 32 54 32 56 0 3 28 51 62 108 33 57 70 119 80 138 10 19 23 42
|
||||
28 50 5 8 32 53 59 100 27 47 149 258 271 470 122 212 234 405 248 430 30 53
|
||||
62 108 80 135 6 11 15 27 19 35 4 8 85 150 181 315 96 165 187 323 202 350 31
|
||||
56 116 202 130 225 5 8 25 42 43 75 19 33 92 159 162 280 149 257 157 271 202
|
||||
350 19 33 38 67 43 75 9 14 228 392 275 475 12 22 55 96 95 165 40 69 80 139
|
||||
90 155 24 42 202 350 221 383 9 15 27 47 41 72 14 25 75 131 136 236 61 106
|
||||
121 210 134 232 99 172 271 470 279 482 5 8 23 40 40 70 18 30 81 141 142 245
|
||||
60 105 121 210 135 235 14 25 71 124 127 220 56 96 143 247 194 335 51 88 96
|
||||
167 102 175 14 24 180 311 204 355 23 43 340 590 356 615 5 8 50 87 101 175
|
||||
171 301 517 898 582 1008 25 43 46 81 46 83 0 2 12 23 27 47 14 23 40 67 56
|
||||
97 16 30 35 62 42 70 7 8 15 22 18 30 4 8 20 38 37 65 16 28 33 57 37 65 6 12
|
||||
111 196 143 250 5 8 55 95 112 193 57 98 113 195 126 215 12 20 27 46 32 57 6
|
||||
11 14 27 20 35 5 8 76 130 156 270 80 140 165 287 187 325 23 39 52 90 66 115
|
||||
13 25 30 52 37 61 8 8 14 18 14 21 0 4 41 77 92 165 50 87 175 302 276 478
|
||||
101 176 208 360 236 408 28 49 67 117 86 152 19 35 41 70 48 77 6 6 12 15 12
|
||||
19 0 7 124 224 167 291 12 21 23 40 23 42 0 2 21 40 46 83 26 43 55 92 64 109
|
||||
54 95 327 568 354 614 19 30 45 75 59 100 71 128 82 145 89 148 4 2 8 8 8 13
|
||||
0 5 42 82 94 172 311 538 496 858 518 897 14 25 40 70 58 100 18 30 42 71 53
|
||||
90 10 19 79 139 152 265 73 127 142 246 153 265 10 19 43 76 72 125 29 50 63
|
||||
108 75 130 65 116 80 140 87 143 4 2 8 8 8 12 0 8 114 212 140 250 6 8 14 24
|
||||
20 35 5 11 54 97 108 190 l100 170 -9611 3 c-5286 1 -9614 -1 -9618 -5 -5 -6
|
||||
-419 -719 -619 -1068 -89 -155 -267 -463 -323 -560 -38 -66 -81 -140 -95 -165
|
||||
-31 -56 -263 -457 -526 -910 -110 -190 -224 -388 -254 -440 -29 -52 -61 -109
|
||||
-71 -125 -23 -39 -243 -420 -268 -465 -11 -19 -204 -352 -428 -740 -224 -388
|
||||
-477 -826 -563 -975 -85 -148 -185 -322 -222 -385 -37 -63 -120 -207 -185
|
||||
-320 -65 -113 -177 -306 -248 -430 -72 -124 -172 -297 -222 -385 -51 -88 -142
|
||||
-245 -202 -350 -131 -226 -247 -427 -408 -705 -65 -113 -249 -432 -410 -710
|
||||
-160 -278 -388 -673 -506 -877 -118 -205 -216 -373 -219 -373 -3 0 -52 82
|
||||
-109 183 -58 100 -144 250 -192 332 -95 164 -402 696 -647 1120 -85 149 -228
|
||||
396 -317 550 -212 365 -982 1700 -1008 1745 -10 19 -43 76 -72 125 -29 50 -64
|
||||
110 -77 135 -14 25 -63 110 -110 190 -47 80 -96 165 -110 190 -14 25 -99 171
|
||||
-188 325 -89 154 -174 300 -188 325 -13 25 -64 113 -112 195 -48 83 -140 242
|
||||
-205 355 -65 113 -183 317 -263 454 -79 137 -152 264 -163 282 -50 89 -335
|
||||
583 -354 614 -12 19 -34 58 -50 85 -15 28 -129 226 -253 440 -124 215 -235
|
||||
408 -247 430 -12 22 -69 121 -127 220 -58 99 -226 389 -373 645 -148 256 -324
|
||||
561 -392 678 -67 117 -134 232 -147 255 -13 23 -33 59 -46 80 l-22 37 -9615 0
|
||||
-9615 0 20 -32z"/>
|
||||
</g>
|
||||
</svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns:xlink="http://www.w3.org/1999/xlink" t="1566718842150" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" p-id="1244" width="16" height="16">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#2674FD" p-id="1245"></path>
|
||||
<path d="M512 512m-425.57245 0a425.57245 425.57245 0 1 0 851.1449 0 425.57245 425.57245 0 1 0-851.1449 0Z"
|
||||
fill="#FFFFFF" p-id="1246"></path>
|
||||
<path d="M512 512m-214.271074 0a214.271074 214.271074 0 1 0 428.542148 0 214.271074 214.271074 0 1 0-428.542148 0Z"
|
||||
fill="#FFE41F" p-id="1247"></path>
|
||||
<path d="M635.968268 408.15377l-89.224127-8.722657a15.980441 15.980441 0 0 0-16.859365 11.479283l-1.784482 6.28564a22.372617 22.372617 0 0 0-2.237262 5.193643l-26.088069 91.754363a67.410825 67.410825 0 1 0 12.984108 61.498063c0.332926-1.185216 0.639218-2.370432 0.905558-3.555648h0.093219l33.106147-116.457461 48.527271-1.891019a48.84688 48.84688 0 0 0 37.767108-20.308477l8.735974-12.158452a8.336463 8.336463 0 0 0-5.92608-13.117278z"
|
||||
fill="#FFFFFF" p-id="1248"></path>
|
||||
<path d="M214.231123 503.383879c4.527792-160.563477 136.113403-289.339194 297.768877-289.339194s293.241085 128.775717 297.768877 289.339194h214.151221C1019.339038 224.61841 791.910734 0 512 0S4.647645 224.61841 0.079902 503.383879z"
|
||||
fill="#2674FD" p-id="1249"></path>
|
||||
</svg>
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -2,14 +2,17 @@
|
||||
<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">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<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(['setRequestMethod', 'POST'], ['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>
|
||||
/* Center the loader */
|
||||
#loader {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
@@ -52,18 +55,16 @@
|
||||
<div id="loader-mask">
|
||||
<div id="loader"></div>
|
||||
<noscript>
|
||||
<strong>很抱歉,音乐解锁需要启用JavaScript的现代浏览器!如
|
||||
<a href="https://www.google.cn/chrome/">Google Chrome</a>
|
||||
<a href="https://www.firefox.com.cn/">Mozilla Firefox</a>
|
||||
</strong>
|
||||
<img alt=""
|
||||
src="https://stats.ixarea.com/ixarea-stats/report?idsite=2&rec=1&action_name=音乐解锁+-+By+IXarea"
|
||||
style="border:0"/>
|
||||
</noscript>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
document.getElementById("loader-mask").remove();
|
||||
};
|
||||
</script>
|
||||
<strong>音乐解锁采用了一些新特性!建议使用
|
||||
<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>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
|
105
src/App.vue
@@ -17,7 +17,7 @@
|
||||
<el-row id="app-control">
|
||||
|
||||
<el-button @click="handleDownloadAll" icon="el-icon-download" plain>下载全部</el-button>
|
||||
<el-button @click="handleDeleteAll" icon="el-icon-download" plain type="danger">删除全部</el-button>
|
||||
<el-button @click="handleDeleteAll" icon="el-icon-delete" plain type="danger">删除全部</el-button>
|
||||
|
||||
</el-row>
|
||||
<audio :autoplay="playing_auto" :src="playing_url" controls></audio>
|
||||
@@ -25,9 +25,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>
|
||||
@@ -50,14 +54,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>
|
||||
@@ -68,15 +67,17 @@
|
||||
<el-footer id="app-footer">
|
||||
<el-row>
|
||||
音乐解锁:移除已购音乐的加密保护。
|
||||
目前支持网易云音乐(ncm)和QQ音乐(qmc0, qmc3, qmcflac)。
|
||||
|
||||
|
||||
目前支持网易云音乐(ncm)、QQ音乐(qmc, mflac, tkm)以及
|
||||
<a href="https://github.com/ix64/unlock-music/blob/master/README.md" target="_blank">其他格式</a>。
|
||||
<a href="https://github.com/ix64/unlock-music/wiki/使用提示" target="_blank">使用提示</a>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<span>Copyright © 2019</span>
|
||||
<a href="https://ixarea.com" target="_blank">IXarea</a>
|
||||
<span>and</span>
|
||||
<a href="https://github.com/ix64" target="_blank">MengYX</a>
|
||||
音乐解锁使用
|
||||
<a href="https://github.com/ix64/unlock-music/blob/master/LICENSE" target="_blank">MIT许可协议</a>
|
||||
开放
|
||||
<a href="https://github.com/ix64/unlock-music" target="_blank">源代码</a>
|
||||
</el-row>
|
||||
</el-footer>
|
||||
</el-container>
|
||||
@@ -85,9 +86,7 @@
|
||||
|
||||
<script>
|
||||
|
||||
const NcmDecrypt = require("./plugins/ncm");
|
||||
const QmcDecrypt = require("./plugins/qmc");
|
||||
const RawDecrypt = require("./plugins/raw");
|
||||
const dec = require("./decrypt/common");
|
||||
export default {
|
||||
name: 'app',
|
||||
components: {},
|
||||
@@ -106,62 +105,59 @@
|
||||
},
|
||||
methods: {
|
||||
finishLoad() {
|
||||
|
||||
document.getElementById("loader-mask").remove();
|
||||
this.$notify.info({
|
||||
title: '离线使用',
|
||||
message: "音乐解锁加载成功。我们使用PWA技术,可以添加到桌面或收藏夹,无网络状况下也能使用。",
|
||||
duration: 30000,
|
||||
message: '我们使用PWA技术,无网络也能使用<br/>' +
|
||||
'最近更新:支持bkcmp3/bkcflac/tkm<br/>' +
|
||||
'点击查看 <a target="_blank" href="https://github.com/ix64/unlock-music/wiki/使用提示">使用提示</a>',
|
||||
dangerouslyUseHTMLString: true,
|
||||
duration: 10000,
|
||||
position: 'top-left'
|
||||
});
|
||||
},
|
||||
handleFile(file) {
|
||||
let ext = file.name.substring(file.name.lastIndexOf(".") + 1, file.name.length).toLowerCase();
|
||||
|
||||
(async () => {
|
||||
let data = null;
|
||||
switch (ext) {
|
||||
case "ncm":
|
||||
data = await NcmDecrypt.Decrypt(file.raw);
|
||||
break;
|
||||
case "mp3":
|
||||
case "flac":
|
||||
data = await RawDecrypt.Decrypt(file.raw);
|
||||
break;
|
||||
case "qmc3":
|
||||
case "qmc0":
|
||||
case "qmcflac":
|
||||
data = await QmcDecrypt.Decrypt(file.raw);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (null != data) {
|
||||
let data = await dec.CommonDecrypt(file);
|
||||
if (data.status) {
|
||||
this.tableData.push(data);
|
||||
this.$notify.success({
|
||||
title: '解锁成功',
|
||||
message: '成功解锁 ' + data.title
|
||||
message: '成功解锁 ' + data.title,
|
||||
duration: 3000
|
||||
});
|
||||
let _rp_data = [data.title, data.artist, data.album];
|
||||
window._paq.push(["trackEvent", "Unlock", data.rawExt + "," + data.mime, JSON.stringify(_rp_data)]);
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '不支持此文件类型'
|
||||
title: '出现问题',
|
||||
message: data.message + "," + file.name +
|
||||
',参考<a target="_blank" href="https://github.com/ix64/unlock-music/wiki/使用提示">使用提示</a>',
|
||||
dangerouslyUseHTMLString: true,
|
||||
duration: 6000
|
||||
});
|
||||
window._paq.push(["trackEvent", "Error", data.message, file.name]);
|
||||
}
|
||||
|
||||
|
||||
})();
|
||||
|
||||
|
||||
},
|
||||
handlePlay(index, row) {
|
||||
this.playing_url = row.file;
|
||||
this.playing_auto = true;
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
console.log(index);
|
||||
URL.revokeObjectURL(row.file);
|
||||
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);
|
||||
@@ -173,24 +169,17 @@
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@@ -205,8 +194,8 @@
|
||||
}
|
||||
|
||||
#app-footer a {
|
||||
padding-left: 0.5em;
|
||||
padding-right: 0.5em;
|
||||
padding-left: 0.2em;
|
||||
padding-right: 0.2em;
|
||||
}
|
||||
|
||||
#app-footer {
|
||||
|
Before Width: | Height: | Size: 6.7 KiB |
51
src/decrypt/common.js
Normal file
@@ -0,0 +1,51 @@
|
||||
const NcmDecrypt = require("./ncm");
|
||||
const QmcDecrypt = require("./qmc");
|
||||
const RawDecrypt = require("./raw");
|
||||
const MFlacDecrypt = require("./mflac");
|
||||
const TmDecrypt = require("./tm");
|
||||
|
||||
export {CommonDecrypt}
|
||||
|
||||
async function CommonDecrypt(file) {
|
||||
let raw_ext = file.name.substring(file.name.lastIndexOf(".") + 1, file.name.length).toLowerCase();
|
||||
let raw_filename = file.name.substring(0, file.name.lastIndexOf("."));
|
||||
let rt_data;
|
||||
switch (raw_ext) {
|
||||
case "ncm":// Netease Mp3/Flac
|
||||
rt_data = await NcmDecrypt.Decrypt(file.raw);
|
||||
break;
|
||||
case "mp3":// Raw Mp3
|
||||
case "flac"://Raw Flac
|
||||
case "m4a":// Raw M4a
|
||||
case "ogg":// Raw Ogg
|
||||
rt_data = await RawDecrypt.Decrypt(file.raw, raw_filename, raw_ext);
|
||||
break;
|
||||
case "tm0":// QQ Music IOS Mp3
|
||||
case "tm3":// QQ Music IOS Mp3
|
||||
rt_data = await RawDecrypt.Decrypt(file.raw, raw_filename, "mp3");
|
||||
break;
|
||||
case "qmc3"://QQ Music Android Mp3
|
||||
case "qmc0"://QQ Music Android Mp3
|
||||
case "qmcflac"://QQ Music Android Flac
|
||||
case "qmcogg"://QQ Music Android Ogg
|
||||
case "tkm"://QQ Music Accompaniment M4a
|
||||
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
|
||||
rt_data = await MFlacDecrypt.Decrypt(file.raw, raw_filename, raw_ext);
|
||||
break;
|
||||
case "tm2":// QQ Music IOS M4a
|
||||
case "tm6":// QQ Music IOS M4a
|
||||
rt_data = await TmDecrypt.Decrypt(file.raw, raw_filename);
|
||||
break;
|
||||
default:
|
||||
rt_data = {status: false, message: "不支持此文件格式",}
|
||||
}
|
||||
if (rt_data.status) {
|
||||
rt_data.rawExt = raw_ext;
|
||||
rt_data.rawFilename = raw_filename;
|
||||
}
|
||||
return rt_data;
|
||||
}
|
99
src/decrypt/mflac.js
Normal file
@@ -0,0 +1,99 @@
|
||||
const musicMetadata = require("music-metadata-browser");
|
||||
const util = require("./util");
|
||||
export {Decrypt}
|
||||
|
||||
async function Decrypt(file, raw_filename, raw_ext) {
|
||||
// 获取扩展名
|
||||
if (raw_ext !== "mflac") return {
|
||||
status: false,
|
||||
message: "File type is incorrect!",
|
||||
};
|
||||
// 读取文件
|
||||
const fileBuffer = await util.GetArrayBuffer(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);
|
||||
const info = util.GetFileInfo(tag.common.artist, tag.common.title, raw_filename, "flac");
|
||||
let picUrl = util.GetCoverURL(tag);
|
||||
// 返回
|
||||
return {
|
||||
status: true,
|
||||
filename: info.filename,
|
||||
title: info.title,
|
||||
artist: info.artist,
|
||||
album: tag.common.album,
|
||||
picture: picUrl,
|
||||
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]
|
||||
}
|
||||
|
||||
}
|
171
src/decrypt/ncm.js
Normal file
@@ -0,0 +1,171 @@
|
||||
const CryptoJS = require("crypto-js");
|
||||
const ID3Writer = require("browser-id3-writer");
|
||||
const util = require("./util");
|
||||
const CORE_KEY = CryptoJS.enc.Hex.parse("687a4852416d736f356b496e62617857");
|
||||
const META_KEY = CryptoJS.enc.Hex.parse("2331346C6A6B5F215C5D2630553C2728");
|
||||
|
||||
|
||||
export {Decrypt};
|
||||
|
||||
async function Decrypt(file) {
|
||||
|
||||
const fileBuffer = await util.GetArrayBuffer(file);
|
||||
const dataView = new DataView(fileBuffer);
|
||||
|
||||
if (dataView.getUint32(0, true) !== 0x4e455443 ||
|
||||
dataView.getUint32(4, true) !== 0x4d414446)
|
||||
return {status: false, message: "此ncm文件已损坏"};
|
||||
|
||||
|
||||
const keyDataObj = getKeyData(dataView, fileBuffer, 10);
|
||||
const keyBox = getKeyBox(keyDataObj.data);
|
||||
|
||||
const musicMetaObj = getMetaData(dataView, fileBuffer, keyDataObj.offset);
|
||||
const musicMeta = musicMetaObj.data;
|
||||
|
||||
let audioOffset = musicMetaObj.offset + dataView.getUint32(musicMetaObj.offset + 5, true) + 13;
|
||||
let audioData = new Uint8Array(fileBuffer, audioOffset);
|
||||
|
||||
for (let cur = 0; cur < audioData.length; ++cur) {
|
||||
audioData[cur] ^= keyBox[cur & 0xff];
|
||||
}
|
||||
|
||||
if (musicMeta.format === undefined) {
|
||||
const [f, L, a, C] = audioData;
|
||||
if (f === 0x66 && L === 0x4c && a === 0x61 && C === 0x43) {
|
||||
musicMeta.format = "flac";
|
||||
} else {
|
||||
musicMeta.format = "mp3";
|
||||
}
|
||||
}
|
||||
const mime = util.AudioMimeType[musicMeta.format];
|
||||
|
||||
const artists = [];
|
||||
musicMeta.artist.forEach(arr => {
|
||||
artists.push(arr[0]);
|
||||
});
|
||||
if (musicMeta.format === "mp3") {
|
||||
audioData = await writeID3(audioData, artists, musicMeta.musicName, musicMeta.album, musicMeta.albumPic)
|
||||
}
|
||||
|
||||
const musicData = new Blob([audioData], {type: mime});
|
||||
const musicUrl = URL.createObjectURL(musicData);
|
||||
const filename = artists.join(" & ") + " - " + musicMeta.musicName + "." + musicMeta.format;
|
||||
return {
|
||||
status: true,
|
||||
filename: filename,
|
||||
title: musicMeta.musicName,
|
||||
artist: artists.join(" & "),
|
||||
album: musicMeta.album,
|
||||
picture: musicMeta.albumPic,
|
||||
file: musicUrl,
|
||||
mime: mime
|
||||
};
|
||||
}
|
||||
|
||||
async function writeID3(audioData, artistList, title, album, picture) {
|
||||
const writer = new ID3Writer(audioData);
|
||||
writer.setFrame("TPE1", artistList)
|
||||
.setFrame("TIT2", title)
|
||||
.setFrame("TALB", album);
|
||||
if (picture !== "") {
|
||||
try {
|
||||
const img = await (await fetch(picture)).arrayBuffer();
|
||||
writer.setFrame('APIC', {
|
||||
type: 3,
|
||||
data: img,
|
||||
description: 'Cover'
|
||||
})
|
||||
} catch (e) {
|
||||
console.log("Fail to write cover image!");
|
||||
}
|
||||
}
|
||||
writer.addTag();
|
||||
return writer.arrayBuffer;
|
||||
}
|
||||
|
||||
function getKeyData(dataView, fileBuffer, offset) {
|
||||
const keyLen = dataView.getUint32(offset, true);
|
||||
offset += 4;
|
||||
const cipherText = new Uint8Array(fileBuffer, offset, keyLen).map(
|
||||
uint8 => uint8 ^ 0x64
|
||||
);
|
||||
offset += keyLen;
|
||||
|
||||
const plainText = CryptoJS.AES.decrypt(
|
||||
{ciphertext: CryptoJS.lib.WordArray.create(cipherText)},
|
||||
CORE_KEY,
|
||||
{
|
||||
mode: CryptoJS.mode.ECB,
|
||||
padding: CryptoJS.pad.Pkcs7
|
||||
}
|
||||
);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
return {offset: offset, data: result.slice(17)};
|
||||
}
|
||||
|
||||
function getKeyBox(keyData) {
|
||||
const box = new Uint8Array(Array(256).keys());
|
||||
|
||||
const keyDataLen = keyData.length;
|
||||
|
||||
let j = 0;
|
||||
|
||||
for (let i = 0; i < 256; i++) {
|
||||
j = (box[i] + j + keyData[i % keyDataLen]) & 0xff;
|
||||
[box[i], box[j]] = [box[j], box[i]];
|
||||
}
|
||||
|
||||
return box.map((_, i, arr) => {
|
||||
i = (i + 1) & 0xff;
|
||||
const si = arr[i];
|
||||
const sj = arr[(i + si) & 0xff];
|
||||
return arr[(si + sj) & 0xff];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} MusicMetaType
|
||||
* @property {Number} musicId
|
||||
* @property {String} musicName
|
||||
* @property {[[String, Number]]} artist
|
||||
* @property {String} album
|
||||
* @property {"flac"|"mp3"} format
|
||||
* @property {String} albumPic
|
||||
*/
|
||||
|
||||
function getMetaData(dataView, fileBuffer, offset) {
|
||||
const metaDataLen = dataView.getUint32(offset, true);
|
||||
offset += 4;
|
||||
if (metaDataLen === 0) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const cipherText = new Uint8Array(fileBuffer, offset, metaDataLen).map(
|
||||
data => data ^ 0x63
|
||||
);
|
||||
offset += metaDataLen;
|
||||
|
||||
const plainText = CryptoJS.AES.decrypt({
|
||||
ciphertext: CryptoJS.enc.Base64.parse(
|
||||
CryptoJS.lib.WordArray.create(cipherText.slice(22)).toString(CryptoJS.enc.Utf8)
|
||||
)
|
||||
},
|
||||
META_KEY,
|
||||
{mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7}
|
||||
);
|
||||
|
||||
const result = JSON.parse(plainText.toString(CryptoJS.enc.Utf8).slice(6));
|
||||
result.albumPic = result.albumPic.replace("http:", "https:");
|
||||
return {data: result, offset: offset};
|
||||
}
|
||||
|
||||
|
89
src/decrypt/qmc.js
Normal file
@@ -0,0 +1,89 @@
|
||||
const musicMetadata = require("music-metadata-browser");
|
||||
const util = require("./util");
|
||||
export {Decrypt}
|
||||
const SEED_MAP = [
|
||||
[0x4a, 0xd6, 0xca, 0x90, 0x67, 0xf7, 0x52],
|
||||
[0x5e, 0x95, 0x23, 0x9f, 0x13, 0x11, 0x7e],
|
||||
[0x47, 0x74, 0x3d, 0x90, 0xaa, 0x3f, 0x51],
|
||||
[0xc6, 0x09, 0xd5, 0x9f, 0xfa, 0x66, 0xf9],
|
||||
[0xf3, 0xd6, 0xa1, 0x90, 0xa0, 0xf7, 0xf0],
|
||||
[0x1d, 0x95, 0xde, 0x9f, 0x84, 0x11, 0xf4],
|
||||
[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",
|
||||
"tkm": "m4a"
|
||||
};
|
||||
|
||||
async function Decrypt(file, raw_filename, raw_ext) {
|
||||
// 获取扩展名
|
||||
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);
|
||||
const audioData = new Uint8Array(fileBuffer);
|
||||
// 转换数据
|
||||
const seed = new Mask();
|
||||
for (let cur = 0; cur < audioData.length; ++cur) {
|
||||
audioData[cur] ^= seed.NextMask();
|
||||
}
|
||||
// 导出
|
||||
const musicData = new Blob([audioData], {type: mime});
|
||||
const musicUrl = URL.createObjectURL(musicData);
|
||||
// 读取Meta
|
||||
let tag = await musicMetadata.parseBlob(musicData);
|
||||
const info = util.GetFileInfo(tag.common.artist, tag.common.title, raw_filename, new_ext);
|
||||
let picUrl = util.GetCoverURL(tag);
|
||||
|
||||
// 返回
|
||||
return {
|
||||
status: true,
|
||||
filename: info.filename,
|
||||
title: info.title,
|
||||
artist: info.artist,
|
||||
album: tag.common.album,
|
||||
picture: picUrl,
|
||||
file: musicUrl,
|
||||
mime: mime
|
||||
}
|
||||
}
|
||||
|
||||
class Mask {
|
||||
constructor() {
|
||||
this.x = -1;
|
||||
this.y = 8;
|
||||
this.dx = 1;
|
||||
this.index = -1;
|
||||
}
|
||||
|
||||
NextMask() {
|
||||
let ret;
|
||||
this.index++;
|
||||
if (this.x < 0) {
|
||||
this.dx = 1;
|
||||
this.y = (8 - this.y) % 8;
|
||||
ret = 0xc3
|
||||
} else if (this.x > 6) {
|
||||
this.dx = -1;
|
||||
this.y = 7 - this.y;
|
||||
ret = 0xd8
|
||||
} else {
|
||||
ret = SEED_MAP[this.y][this.x]
|
||||
}
|
||||
this.x += this.dx;
|
||||
if (this.index === 0x8000 || (this.index > 0x8000 && (this.index + 1) % 0x8000 === 0)) {
|
||||
return this.NextMask()
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
}
|
25
src/decrypt/raw.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const musicMetadata = require("music-metadata-browser");
|
||||
const util = require("./util");
|
||||
export {Decrypt}
|
||||
|
||||
|
||||
async function Decrypt(file, raw_filename, raw_ext) {
|
||||
let tag = await musicMetadata.parseBlob(file);
|
||||
|
||||
let fileUrl = URL.createObjectURL(file);
|
||||
|
||||
const picUrl = util.GetCoverURL(tag);
|
||||
const mime = util.AudioMimeType[raw_ext];
|
||||
const info = util.GetFileInfo(tag.common.artist, tag.common.title, raw_filename, raw_ext);
|
||||
|
||||
return {
|
||||
status: true,
|
||||
filename: info.filename,
|
||||
title: info.title,
|
||||
artist: info.artist,
|
||||
album: tag.common.album,
|
||||
picture: picUrl,
|
||||
file: fileUrl,
|
||||
mime: mime
|
||||
}
|
||||
}
|
14
src/decrypt/tm.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const rawDecrypt = require("./raw");
|
||||
const util = require("./util");
|
||||
export {Decrypt}
|
||||
const header = [0x00, 0x00, 0x00, 0x20, 0x66, 0x74, 0x79, 0x70];
|
||||
|
||||
async function Decrypt(file, raw_filename) {
|
||||
const fileBuffer = await util.GetArrayBuffer(file);
|
||||
const audioData = new Uint8Array(fileBuffer);
|
||||
for (let cur = 0; cur < 8; ++cur) {
|
||||
audioData[cur] = header[cur];
|
||||
}
|
||||
const musicData = new Blob([audioData], {type: "audio/mp4"});
|
||||
return await rawDecrypt.Decrypt(musicData, raw_filename, "m4a")
|
||||
}
|
51
src/decrypt/util.js
Normal file
@@ -0,0 +1,51 @@
|
||||
export {GetArrayBuffer, GetFileInfo, GetCoverURL, AudioMimeType}
|
||||
|
||||
// Also a new draft API: blob.arrayBuffer()
|
||||
async function GetArrayBuffer(blobObject) {
|
||||
return await new Promise(resolve => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
resolve(e.target.result);
|
||||
};
|
||||
reader.readAsArrayBuffer(blobObject);
|
||||
});
|
||||
}
|
||||
|
||||
const AudioMimeType = {
|
||||
mp3: "audio/mpeg",
|
||||
flac: "audio/flac",
|
||||
m4a: "audio/mp4",
|
||||
ogg: "audio/ogg"
|
||||
};
|
||||
|
||||
function GetFileInfo(artist, title, filenameNoExt, ext) {
|
||||
let newArtist = "", newTitle = "";
|
||||
let filenameArray = filenameNoExt.split("-");
|
||||
if (filenameArray.length > 1) {
|
||||
newArtist = filenameArray[0].trim();
|
||||
newTitle = filenameArray[1].trim();
|
||||
} else if (filenameArray.length === 1) {
|
||||
newTitle = filenameArray[0].trim();
|
||||
}
|
||||
|
||||
if (typeof artist == "string" && artist !== "") {
|
||||
newArtist = artist;
|
||||
}
|
||||
if (typeof title == "string" && title !== "") {
|
||||
newTitle = title;
|
||||
}
|
||||
let newFilename = newArtist + " - " + newTitle + "." + ext;
|
||||
return {artist: newArtist, title: newTitle, filename: newFilename};
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {string}
|
||||
*/
|
||||
function GetCoverURL(metadata) {
|
||||
let pic_url = "";
|
||||
if (metadata.common.picture !== undefined && metadata.common.picture.length > 0) {
|
||||
let pic = new Blob([metadata.common.picture[0].data], {type: metadata.common.picture[0].format});
|
||||
pic_url = URL.createObjectURL(pic);
|
||||
}
|
||||
return pic_url;
|
||||
}
|
@@ -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;
|
||||
|
||||
|
||||
|
@@ -1,165 +0,0 @@
|
||||
const CryptoJS = require("crypto-js");
|
||||
const CORE_KEY = CryptoJS.enc.Hex.parse("687a4852416d736f356b496e62617857");
|
||||
const META_KEY = CryptoJS.enc.Hex.parse("2331346C6A6B5F215C5D2630553C2728");
|
||||
|
||||
const audio_mime_type = {
|
||||
mp3: "audio/mpeg",
|
||||
flac: "audio/flac"
|
||||
};
|
||||
|
||||
|
||||
export {Decrypt};
|
||||
|
||||
async function Decrypt(file) {
|
||||
|
||||
const fileBuffer = await new Promise(reslove => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
reslove(e.target.result);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
});
|
||||
|
||||
const dataView = new DataView(fileBuffer);
|
||||
|
||||
if (dataView.getUint32(0, true) !== 0x4e455443 ||
|
||||
dataView.getUint32(4, true) !== 0x4d414446
|
||||
) {
|
||||
console.log({type: "error", data: "not ncm file"});
|
||||
return;
|
||||
}
|
||||
|
||||
let offset = 10;
|
||||
|
||||
const keyData = (() => {
|
||||
const keyLen = dataView.getUint32(offset, true);
|
||||
offset += 4;
|
||||
const cipherText = new Uint8Array(fileBuffer, offset, keyLen).map(
|
||||
uint8 => uint8 ^ 0x64
|
||||
);
|
||||
offset += keyLen;
|
||||
|
||||
const plainText = CryptoJS.AES.decrypt(
|
||||
{ciphertext: CryptoJS.lib.WordArray.create(cipherText)},
|
||||
CORE_KEY,
|
||||
{
|
||||
mode: CryptoJS.mode.ECB,
|
||||
padding: CryptoJS.pad.Pkcs7
|
||||
}
|
||||
);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
return result.slice(17);
|
||||
})();
|
||||
|
||||
const keyBox = (() => {
|
||||
const box = new Uint8Array(Array(256).keys());
|
||||
|
||||
const keyDataLen = keyData.length;
|
||||
|
||||
let j = 0;
|
||||
|
||||
for (let i = 0; i < 256; i++) {
|
||||
j = (box[i] + j + keyData[i % keyDataLen]) & 0xff;
|
||||
[box[i], box[j]] = [box[j], box[i]];
|
||||
}
|
||||
|
||||
return box.map((_, i, arr) => {
|
||||
i = (i + 1) & 0xff;
|
||||
const si = arr[i];
|
||||
const sj = arr[(i + si) & 0xff];
|
||||
return arr[(si + sj) & 0xff];
|
||||
});
|
||||
})();
|
||||
|
||||
/**
|
||||
* @typedef {Object} MusicMetaType
|
||||
* @property {Number} musicId
|
||||
* @property {String} musicName
|
||||
* @property {[[String, Number]]} artist
|
||||
* @property {String} album
|
||||
* @property {"flac"|"mp3"} format
|
||||
* @property {String} albumPic
|
||||
*/
|
||||
|
||||
/** @type {MusicMetaType|undefined} */
|
||||
const musicMeta = (() => {
|
||||
const metaDataLen = dataView.getUint32(offset, true);
|
||||
offset += 4;
|
||||
if (metaDataLen === 0) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const cipherText = new Uint8Array(fileBuffer, offset, metaDataLen).map(
|
||||
data => data ^ 0x63
|
||||
);
|
||||
offset += metaDataLen;
|
||||
|
||||
const plainText = CryptoJS.AES.decrypt(
|
||||
{
|
||||
ciphertext: CryptoJS.enc.Base64.parse(
|
||||
CryptoJS.lib.WordArray.create(cipherText.slice(22)).toString(CryptoJS.enc.Utf8)
|
||||
)
|
||||
},
|
||||
META_KEY,
|
||||
{mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7}
|
||||
);
|
||||
|
||||
const result = JSON.parse(plainText.toString(CryptoJS.enc.Utf8).slice(6));
|
||||
result.albumPic = result.albumPic.replace("http:", "https:");
|
||||
return result;
|
||||
})();
|
||||
|
||||
offset += dataView.getUint32(offset + 5, true) + 13;
|
||||
|
||||
const audioData = new Uint8Array(fileBuffer, offset);
|
||||
const audioDataLen = audioData.length;
|
||||
|
||||
|
||||
for (let cur = 0; cur < audioDataLen; ++cur) {
|
||||
audioData[cur] ^= keyBox[cur & 0xff];
|
||||
}
|
||||
|
||||
|
||||
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 mime = audio_mime_type[musicMeta.format];
|
||||
const musicData = new Blob([audioData], {
|
||||
type: mime
|
||||
});
|
||||
|
||||
const musicUrl = URL.createObjectURL(musicData);
|
||||
|
||||
const artists = [];
|
||||
musicMeta.artist.forEach(arr => {
|
||||
artists.push(arr[0]);
|
||||
});
|
||||
const filename = artists.join(" & ") + " - " + musicMeta.musicName + "." + musicMeta.format;
|
||||
return {
|
||||
meta: musicMeta,
|
||||
file: musicUrl,
|
||||
picture: musicMeta.albumPic,
|
||||
title: musicMeta.musicName,
|
||||
album: musicMeta.album,
|
||||
artist: artists.join(" & "),
|
||||
filename: filename,
|
||||
mime: mime
|
||||
};
|
||||
}
|
||||
|
@@ -1,125 +0,0 @@
|
||||
const jsmediatags = require("jsmediatags");
|
||||
export {Decrypt}
|
||||
const SEED_MAP = [
|
||||
[0x4a, 0xd6, 0xca, 0x90, 0x67, 0xf7, 0x52],
|
||||
[0x5e, 0x95, 0x23, 0x9f, 0x13, 0x11, 0x7e],
|
||||
[0x47, 0x74, 0x3d, 0x90, 0xaa, 0x3f, 0x51],
|
||||
[0xc6, 0x09, 0xd5, 0x9f, 0xfa, 0x66, 0xf9],
|
||||
[0xf3, 0xd6, 0xa1, 0x90, 0xa0, 0xf7, 0xf0],
|
||||
[0x1d, 0x95, 0xde, 0x9f, 0x84, 0x11, 0xf4],
|
||||
[0x0e, 0x74, 0xbb, 0x90, 0xbc, 0x3f, 0x92],
|
||||
[0x00, 0x09, 0x5b, 0x9f, 0x62, 0x66, 0xa1]];
|
||||
const audio_mime_type = {
|
||||
mp3: "audio/mpeg",
|
||||
flac: "audio/flac"
|
||||
};
|
||||
|
||||
async function Decrypt(file) {
|
||||
// 获取扩展名
|
||||
let filename_ext = file.name.substring(file.name.lastIndexOf(".") + 1, file.name.length).toLowerCase();
|
||||
let new_ext;
|
||||
switch (filename_ext) {
|
||||
case "qmc0":
|
||||
case "qmc3":
|
||||
new_ext = "mp3";
|
||||
break;
|
||||
case "qmcflac":
|
||||
new_ext = "flac";
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
const mime = audio_mime_type[new_ext];
|
||||
// 读取文件
|
||||
const fileBuffer = await new Promise(reslove => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
reslove(e.target.result);
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
});
|
||||
const audioData = new Uint8Array(fileBuffer);
|
||||
const audioDataLen = audioData.length;
|
||||
// 转换数据
|
||||
const seed = new Mask();
|
||||
for (let cur = 0; cur < audioDataLen; ++cur) {
|
||||
audioData[cur] ^= seed.NextMask();
|
||||
}
|
||||
// 导出
|
||||
const musicData = new Blob([audioData], {
|
||||
type: mime
|
||||
});
|
||||
const musicUrl = URL.createObjectURL(musicData);
|
||||
// 读取Meta
|
||||
let tag = await new Promise(resolve => {
|
||||
new jsmediatags.Reader(musicData).read({
|
||||
onSuccess: resolve,
|
||||
onError: (err) => {
|
||||
console.log(err);
|
||||
resolve({tags: {}})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 处理无标题歌手
|
||||
let filename_array = file.name.substring(0, file.name.lastIndexOf(".")).split("-");
|
||||
let title = tag.tags.title;
|
||||
let artist = tag.tags.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 + "." + new_ext;
|
||||
// 处理无封面
|
||||
let pic_url = "";
|
||||
if (tag.tags.picture !== undefined) {
|
||||
let pic = new Blob([new Uint8Array(tag.tags.picture.data)], {type: tag.tags.picture.format});
|
||||
pic_url = URL.createObjectURL(pic);
|
||||
}
|
||||
// 返回
|
||||
return {
|
||||
filename: filename,
|
||||
title: title,
|
||||
artist: artist,
|
||||
album: tag.tags.album,
|
||||
file: musicUrl,
|
||||
picture: pic_url,
|
||||
mime: mime
|
||||
}
|
||||
}
|
||||
|
||||
class Mask {
|
||||
constructor() {
|
||||
this.x = -1;
|
||||
this.y = 8;
|
||||
this.dx = 1;
|
||||
this.index = -1;
|
||||
}
|
||||
|
||||
NextMask() {
|
||||
let ret;
|
||||
this.index++;
|
||||
if (this.x < 0) {
|
||||
this.dx = 1;
|
||||
this.y = (8 - this.y) % 8;
|
||||
ret = 0xc3
|
||||
} else if (this.x > 6) {
|
||||
this.dx = -1;
|
||||
this.y = 7 - this.y;
|
||||
ret = 0xd8
|
||||
} else {
|
||||
ret = SEED_MAP[this.y][this.x]
|
||||
}
|
||||
this.x += this.dx;
|
||||
if (this.index === 0x8000 || (this.index > 0x8000 && (this.index + 1) % 0x8000 === 0)) {
|
||||
return this.NextMask()
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1,51 +0,0 @@
|
||||
const jsmediatags = require("jsmediatags");
|
||||
export {Decrypt}
|
||||
|
||||
const audio_mime_type = {
|
||||
mp3: "audio/mpeg",
|
||||
flac: "audio/flac"
|
||||
};
|
||||
|
||||
async function Decrypt(file) {
|
||||
let tag = await new Promise(resolve => {
|
||||
new jsmediatags.Reader(file).read({
|
||||
onSuccess: resolve,
|
||||
onError: () => {
|
||||
resolve({tags: {}})
|
||||
}
|
||||
});
|
||||
});
|
||||
let pic_url = "";
|
||||
if (tag.tags.picture !== undefined) {
|
||||
let pic = new Blob([new Uint8Array(tag.tags.picture.data)], {type: tag.tags.picture.format});
|
||||
pic_url = URL.createObjectURL(pic);
|
||||
}
|
||||
|
||||
let file_url = URL.createObjectURL(file);
|
||||
|
||||
|
||||
let filename_no_ext = file.name.substring(0, file.name.lastIndexOf("."));
|
||||
let filename_array = filename_no_ext.split("-");
|
||||
let filename_ext = file.name.substring(file.name.lastIndexOf(".") + 1, file.name.length).toLowerCase();
|
||||
const mime = audio_mime_type[filename_ext];
|
||||
let title = tag.tags.title;
|
||||
let artist = tag.tags.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 + "." + filename_ext;
|
||||
return {
|
||||
filename: filename,
|
||||
title: title,
|
||||
artist: artist,
|
||||
album: tag.tags.album,
|
||||
picture: pic_url,
|
||||
file: file_url,
|
||||
mime: mime
|
||||
}
|
||||
}
|
@@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
module.exports = {
|
||||
publicPath: '/music/',
|
||||
productionSourceMap: false
|
||||
publicPath: '',
|
||||
productionSourceMap: true
|
||||
};
|