Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7716c356ed | ||
![]() |
701f750476 | ||
![]() |
d73493a624 | ||
![]() |
85fdbff00d | ||
![]() |
3a5afeb8a6 | ||
![]() |
8dc1a66d69 | ||
![]() |
7733fa6ad1 | ||
![]() |
6a2dd672f3 | ||
![]() |
ca82842b04 | ||
![]() |
137df9c4c2 | ||
![]() |
b17bb37c38 | ||
![]() |
9607580e8b | ||
![]() |
5956412d7e | ||
![]() |
22312959f3 | ||
![]() |
549983a928 | ||
![]() |
ce2642ad1f | ||
![]() |
c6ea98333e | ||
![]() |
042b1ca0dd | ||
![]() |
e089fe1268 | ||
![]() |
67966d4b54 | ||
![]() |
ca462f94fa | ||
![]() |
297c7c9252 |
65
.drone.yml
65
.drone.yml
@@ -1,65 +0,0 @@
|
|||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: default
|
|
||||||
|
|
||||||
clone:
|
|
||||||
depth: 1
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: installDependencies
|
|
||||||
image: node:lts
|
|
||||||
commands:
|
|
||||||
- npm ci --registry=https://registry.npm.taobao.org
|
|
||||||
|
|
||||||
- name: build
|
|
||||||
image: node:lts
|
|
||||||
commands:
|
|
||||||
- npm run fix-compatibility
|
|
||||||
- npm run build
|
|
||||||
- tar -czf legacy.tar.gz -C ./dist .
|
|
||||||
- npm run build -- --modern
|
|
||||||
- tar -czf modern.tar.gz -C ./dist .
|
|
||||||
|
|
||||||
|
|
||||||
- name: release
|
|
||||||
image: plugins/gitea-release
|
|
||||||
settings:
|
|
||||||
base_url: https://git.ixarea.com
|
|
||||||
files:
|
|
||||||
- modern.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/**/*
|
|
||||||
strip_prefix: dist/
|
|
||||||
target: /public
|
|
||||||
path_style: true
|
|
||||||
endpoint: https://fs.sz2.ixarea.com
|
|
||||||
|
|
||||||
|
|
||||||
- name: upload
|
|
||||||
image: plugins/s3
|
|
||||||
settings:
|
|
||||||
bucket: unlock-music
|
|
||||||
access_key:
|
|
||||||
from_secret: aws_access_key_id
|
|
||||||
secret_key:
|
|
||||||
from_secret: aws_secret_access_key
|
|
||||||
source: ./*.tar.gz
|
|
||||||
target: /build/${DRONE_BUILD_NUMBER}
|
|
||||||
path_style: true
|
|
||||||
endpoint: https://fs.sz2.ixarea.com
|
|
34
.github/workflows/build.yml
vendored
34
.github/workflows/build.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Build
|
name: Test Build
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
@@ -27,25 +27,18 @@ jobs:
|
|||||||
build: [ legacy, modern ]
|
build: [ legacy, modern ]
|
||||||
include:
|
include:
|
||||||
- build: legacy
|
- build: legacy
|
||||||
BUILD_ARGS:
|
BUILD_ARGS: ""
|
||||||
|
BUILD_EXTENSION: true
|
||||||
- build: modern
|
- build: modern
|
||||||
BUILD_ARGS: "-- --modern"
|
BUILD_ARGS: "-- --modern"
|
||||||
|
BUILD_EXTENSION: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Use Node.js 14.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 14.x
|
node-version: "14"
|
||||||
|
|
||||||
- name: Get npm cache directory
|
|
||||||
id: npm-cache
|
|
||||||
run: echo "::set-output name=dir::$(npm config get cache)"
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ${{ steps.npm-cache.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
||||||
restore-keys: ${{ runner.os }}-node-
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -59,8 +52,23 @@ jobs:
|
|||||||
npm run build ${{ matrix.BUILD_ARGS }}
|
npm run build ${{ matrix.BUILD_ARGS }}
|
||||||
tar -czvf dist.tar.gz -C ./dist .
|
tar -czvf dist.tar.gz -C ./dist .
|
||||||
|
|
||||||
|
- name: Build Extension
|
||||||
|
if: ${{ matrix.BUILD_EXTENSION }}
|
||||||
|
run: |
|
||||||
|
npm run make-extension
|
||||||
|
cd dist
|
||||||
|
zip -rJ9 ../extension.zip *
|
||||||
|
cd ..
|
||||||
|
|
||||||
- name: Publish artifact
|
- name: Publish artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: unlock-music-${{ matrix.build }}.tar.gz
|
name: unlock-music-${{ matrix.build }}.tar.gz
|
||||||
path: ./dist.tar.gz
|
path: ./dist.tar.gz
|
||||||
|
|
||||||
|
- name: Publish artifact - Extension
|
||||||
|
if: ${{ matrix.BUILD_EXTENSION }}
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: extension.zip
|
||||||
|
path: ./extension.zip
|
||||||
|
65
.github/workflows/post-release.yml
vendored
Normal file
65
.github/workflows/post-release.yml
vendored
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
name: Post Release
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [ published ]
|
||||||
|
jobs:
|
||||||
|
release-docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup vars
|
||||||
|
id: vars
|
||||||
|
env:
|
||||||
|
RELEASE_REF: ${{ github.ref }}
|
||||||
|
run: echo "::set-output name=tag::${RELEASE_REF#refs/tags/}"
|
||||||
|
|
||||||
|
- name: Download release content
|
||||||
|
run: |
|
||||||
|
echo "https://github.com/${{ github.repository }}/releases/download/${{ steps.vars.outputs.tag }}/modern.tar.gz"
|
||||||
|
wget -O modern.tar.gz "https://github.com/${{ github.repository }}/releases/download/${{ steps.vars.outputs.tag }}/modern.tar.gz"
|
||||||
|
mkdir ./dist
|
||||||
|
tar zxf modern.tar.gz -C ./dist
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build docker and push (on modern)
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/386
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
ix64/unlock-music:latest
|
||||||
|
ix64/unlock-music:${{ steps.vars.outputs.tag }}
|
||||||
|
|
||||||
|
gh-pages:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Setup vars
|
||||||
|
id: vars
|
||||||
|
env:
|
||||||
|
RELEASE_REF: ${{ github.ref }}
|
||||||
|
run: echo "::set-output name=tag::${RELEASE_REF#refs/tags/}"
|
||||||
|
|
||||||
|
- name: Download release content
|
||||||
|
run: |
|
||||||
|
echo "https://github.com/${{ github.repository }}/releases/download/${{ steps.vars.outputs.tag }}/modern.tar.gz"
|
||||||
|
wget -O modern.tar.gz "https://github.com/${{ github.repository }}/releases/download/${{ steps.vars.outputs.tag }}/modern.tar.gz"
|
||||||
|
mkdir ./dist
|
||||||
|
tar zxf modern.tar.gz -C ./dist
|
||||||
|
|
||||||
|
- name: Deploy
|
||||||
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
publish_dir: ./dist
|
||||||
|
|
@@ -1,4 +1,4 @@
|
|||||||
name: Release and GitHub Pages
|
name: Build Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -12,18 +12,9 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Use Node.js 14.x
|
- name: Use Node.js 14.x
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 14.x
|
node-version: "14"
|
||||||
|
|
||||||
- name: Get npm cache directory
|
|
||||||
id: npm-cache
|
|
||||||
run: echo "::set-output name=dir::$(npm config get cache)"
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ${{ steps.npm-cache.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
||||||
restore-keys: ${{ runner.os }}-node-
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -36,7 +27,18 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
npm run build
|
npm run build
|
||||||
tar -czf legacy.tar.gz -C ./dist .
|
tar -czf legacy.tar.gz -C ./dist .
|
||||||
zip -rJ9 legacy.zip ./dist
|
cd dist
|
||||||
|
zip -rJ9 ../legacy.zip *
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
- name: Build Extension (on legacy)
|
||||||
|
env:
|
||||||
|
GZIP: "--best"
|
||||||
|
run: |
|
||||||
|
npm run make-extension
|
||||||
|
cd dist
|
||||||
|
zip -rJ9 ../extension.zip *
|
||||||
|
cd ..
|
||||||
|
|
||||||
- name: Build Modern
|
- name: Build Modern
|
||||||
env:
|
env:
|
||||||
@@ -44,17 +46,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
npm run build -- --modern
|
npm run build -- --modern
|
||||||
tar -czf modern.tar.gz -C ./dist .
|
tar -czf modern.tar.gz -C ./dist .
|
||||||
zip -rJ9 modern.zip ./dist
|
cd dist
|
||||||
|
zip -rJ9 ../modern.zip *
|
||||||
|
cd ..
|
||||||
|
|
||||||
- name: Checksum
|
- name: Checksum
|
||||||
run: sha256sum *.tar.gz *.zip > sha256sum.txt
|
run: sha256sum *.tar.gz *.zip > sha256sum.txt
|
||||||
|
|
||||||
- name: Deploy
|
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
publish_dir: ./dist
|
|
||||||
|
|
||||||
- name: Get current time
|
- name: Get current time
|
||||||
id: date
|
id: date
|
||||||
run: echo "::set-output name=date::$(date +'%Y/%m/%d')"
|
run: echo "::set-output name=date::$(date +'%Y/%m/%d')"
|
||||||
@@ -70,7 +68,7 @@ jobs:
|
|||||||
draft: true
|
draft: true
|
||||||
|
|
||||||
- name: Upload Release Assets - legacy.tar.gz
|
- name: Upload Release Assets - legacy.tar.gz
|
||||||
uses: actions/upload-release-asset@v1.0.2
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
@@ -80,7 +78,7 @@ jobs:
|
|||||||
asset_content_type: application/gzip
|
asset_content_type: application/gzip
|
||||||
|
|
||||||
- name: Upload Release Assets - legacy.zip
|
- name: Upload Release Assets - legacy.zip
|
||||||
uses: actions/upload-release-asset@v1.0.2
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
@@ -90,7 +88,7 @@ jobs:
|
|||||||
asset_content_type: application/zip
|
asset_content_type: application/zip
|
||||||
|
|
||||||
- name: Upload Release Assets - modern.tar.gz
|
- name: Upload Release Assets - modern.tar.gz
|
||||||
uses: actions/upload-release-asset@v1.0.2
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
@@ -100,7 +98,7 @@ jobs:
|
|||||||
asset_content_type: application/gzip
|
asset_content_type: application/gzip
|
||||||
|
|
||||||
- name: Upload Release Assets - modern.zip
|
- name: Upload Release Assets - modern.zip
|
||||||
uses: actions/upload-release-asset@v1.0.2
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
@@ -109,8 +107,18 @@ jobs:
|
|||||||
asset_name: modern.zip
|
asset_name: modern.zip
|
||||||
asset_content_type: application/zip
|
asset_content_type: application/zip
|
||||||
|
|
||||||
|
- name: Upload Release Assets - extension.zip
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
asset_path: ./extension.zip
|
||||||
|
asset_name: extension.zip
|
||||||
|
asset_content_type: application/zip
|
||||||
|
|
||||||
- name: Upload Release Assets - sha256sum.txt
|
- name: Upload Release Assets - sha256sum.txt
|
||||||
uses: actions/upload-release-asset@v1.0.2
|
uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
@@ -118,4 +126,3 @@ jobs:
|
|||||||
asset_path: ./sha256sum.txt
|
asset_path: ./sha256sum.txt
|
||||||
asset_name: sha256sum.txt
|
asset_name: sha256sum.txt
|
||||||
asset_content_type: text/plain
|
asset_content_type: text/plain
|
||||||
|
|
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
FROM --platform=$TARGETPLATFORM nginx:stable-alpine
|
||||||
|
|
||||||
|
LABEL org.opencontainers.image.title="Unlock Music"
|
||||||
|
LABEL org.opencontainers.image.description="Unlock encrypted music file in browser"
|
||||||
|
LABEL org.opencontainers.image.authors="MengYX"
|
||||||
|
LABEL org.opencontainers.image.source="https://github.com/ix64/unlock-music"
|
||||||
|
LABEL org.opencontainers.image.licenses="MIT"
|
||||||
|
LABEL maintainer="MengYX"
|
||||||
|
|
||||||
|
COPY ./dist /usr/share/nginx/html
|
49
README.md
49
README.md
@@ -1,46 +1,55 @@
|
|||||||
# Unlock Music 音乐解锁
|
# Unlock Music 音乐解锁
|
||||||
- 在浏览器中解锁加密的音乐文件。 Unlock encrypted music file in the browser.
|
|
||||||
|
- 在浏览器中解锁加密的音乐文件。 Unlock encrypted music file in the browser.
|
||||||
- unlock-music项目是以学习和技术研究的初衷创建的,修改、再分发时请遵循[License](https://github.com/ix64/unlock-music/blob/master/LICENSE)
|
- unlock-music项目是以学习和技术研究的初衷创建的,修改、再分发时请遵循[License](https://github.com/ix64/unlock-music/blob/master/LICENSE)
|
||||||
- Unlock Music的CLI版本正在开发中。
|
- Unlock Music的CLI版本正在开发中。
|
||||||
- 我们新建了Telegram群组,欢迎加入
|
- 我们新建了Telegram群组,欢迎加入
|
||||||
- [其他测试版工具](https://github.com/ix64/unlock-music/wiki/%E5%85%B6%E4%BB%96%E9%9F%B3%E4%B9%90%E6%A0%BC%E5%BC%8F%E5%B7%A5%E5%85%B7)
|
- [CLI版本 Alpha](https://github.com/unlock-music/cli) 大批量转换建议使用CLI版本
|
||||||
- [相关的其他项目](https://github.com/ix64/unlock-music/wiki/%E5%92%8CUnlockMusic%E7%9B%B8%E5%85%B3%E7%9A%84%E9%A1%B9%E7%9B%AE)
|
- [相关的其他项目](https://github.com/ix64/unlock-music/wiki/%E5%92%8CUnlockMusic%E7%9B%B8%E5%85%B3%E7%9A%84%E9%A1%B9%E7%9B%AE)
|
||||||
- 
|
- 
|
||||||
|
|
||||||
# 特性
|
## 特性
|
||||||
## 支持的格式
|
|
||||||
|
### 支持的格式
|
||||||
|
|
||||||
- [x] QQ音乐 (.qmc0/.qmc2/.qmc3/.qmcflac/.qmcogg/[.tkm](https://github.com/ix64/unlock-music/issues/9))
|
- [x] QQ音乐 (.qmc0/.qmc2/.qmc3/.qmcflac/.qmcogg/[.tkm](https://github.com/ix64/unlock-music/issues/9))
|
||||||
- [x] 写入封面图片
|
- [x] 写入封面图片
|
||||||
- [x] Moo音乐格式 ([.bkcmp3/.bkcflac](https://github.com/ix64/unlock-music/issues/11))
|
- [x] Moo音乐格式 ([.bkcmp3/.bkcflac](https://github.com/ix64/unlock-music/issues/11))
|
||||||
- [x] QQ音乐Tm格式 (.tm0/.tm2/.tm3/.tm6)
|
- [x] QQ音乐Tm格式 (.tm0/.tm2/.tm3/.tm6)
|
||||||
- [x] QQ音乐新格式 (实验性支持)
|
- [x] QQ音乐新格式 (实验性支持)
|
||||||
- [x] .mflac
|
- [x] .mflac
|
||||||
- [x] [.mgg](https://github.com/ix64/unlock-music/issues/3)
|
- [x] [.mgg](https://github.com/ix64/unlock-music/issues/3)
|
||||||
- [x] 网易云音乐格式 (.ncm)
|
- [x] 网易云音乐格式 (.ncm)
|
||||||
- [x] 补全ncm的ID3/FlacMeta信息
|
- [x] 补全ncm的ID3/FlacMeta信息
|
||||||
- [x] 虾米音乐格式 (.xm) (测试阶段)
|
- [x] 虾米音乐格式 (.xm) (测试阶段)
|
||||||
- [x] 酷我音乐格式 (.kwm) (测试阶段)
|
- [x] 酷我音乐格式 (.kwm) (测试阶段)
|
||||||
- [x] 酷狗音乐格式 (.kgm) ([CLI版本](https://github.com/ix64/unlock-music/wiki/%E5%85%B6%E4%BB%96%E9%9F%B3%E4%B9%90%E6%A0%BC%E5%BC%8F%E5%B7%A5%E5%85%B7#%E9%85%B7%E7%8B%97%E9%9F%B3%E4%B9%90-kgmvpr%E8%A7%A3%E9%94%81%E5%B7%A5%E5%85%B7))
|
- [x] 酷狗音乐格式 (
|
||||||
|
.kgm) ([CLI版本](https://github.com/ix64/unlock-music/wiki/%E5%85%B6%E4%BB%96%E9%9F%B3%E4%B9%90%E6%A0%BC%E5%BC%8F%E5%B7%A5%E5%85%B7#%E9%85%B7%E7%8B%97%E9%9F%B3%E4%B9%90-kgmvpr%E8%A7%A3%E9%94%81%E5%B7%A5%E5%85%B7))
|
||||||
|
|
||||||
|
### 其他特性
|
||||||
|
|
||||||
## 其他特性
|
|
||||||
- [x] 在浏览器中解锁
|
- [x] 在浏览器中解锁
|
||||||
- [x] 拖放文件
|
- [x] 拖放文件
|
||||||
- [x] 在线播放
|
- [x] 在线播放
|
||||||
- [x] 批量解锁
|
- [x] 批量解锁
|
||||||
- [x] 渐进式Web应用
|
- [x] 渐进式Web应用
|
||||||
- [x] 多线程
|
- [x] 多线程
|
||||||
|
|
||||||
|
## 使用方法
|
||||||
|
|
||||||
|
### 使用已构建版本
|
||||||
|
|
||||||
# 使用方法
|
|
||||||
## 使用已构建版本
|
|
||||||
- 从[GitHub Release](https://github.com/ix64/unlock-music/releases/latest)下载已构建的版本
|
- 从[GitHub Release](https://github.com/ix64/unlock-music/releases/latest)下载已构建的版本
|
||||||
- 本地使用请下载`legacy版本`(`modern版本`只能通过**http/https协议**访问)
|
- 本地使用请下载`legacy版本`(`modern版本`只能通过**http/https协议**访问)
|
||||||
- 解压缩后即可部署或本地使用(**请勿直接运行源代码**)
|
- 解压缩后即可部署或本地使用(**请勿直接运行源代码**)
|
||||||
|
|
||||||
## 自行构建
|
### 自行构建
|
||||||
- 环境要求
|
|
||||||
- nodejs
|
- 环境要求
|
||||||
- npm
|
- nodejs
|
||||||
|
- npm
|
||||||
|
|
||||||
1. 获取项目源代码后执行 `npm install` 安装相关依赖
|
1. 获取项目源代码后执行 `npm install` 安装相关依赖
|
||||||
2. 执行 `npm run build` 即可进行构建,构建输出为 dist 目录
|
2. 执行 `npm run build` 即可进行构建,构建输出为 dist 目录
|
||||||
- `npm run serve` 可用于开发
|
- `npm run serve` 可用于开发
|
||||||
|
3. 如需构建浏览器扩展,build完成后还需要执行`npm run make-extension`
|
||||||
|
16
extension-manifest.json
Normal file
16
extension-manifest.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"manifest_version": 2,
|
||||||
|
"name": "音乐解锁",
|
||||||
|
"short_name": "音乐解锁",
|
||||||
|
"icons": {
|
||||||
|
"128": "./img/icons/msapplication-icon-144x144.png"
|
||||||
|
},
|
||||||
|
"description": "在任何设备上解锁已购的加密音乐!",
|
||||||
|
"offline_enabled": true,
|
||||||
|
"options_page": "./index.html",
|
||||||
|
"homepage_url": "https://github.com/ix64/unlock-music",
|
||||||
|
"browser_action": {
|
||||||
|
"default_popup": "./popup.html"
|
||||||
|
},
|
||||||
|
"content_security_policy": "script-src 'self' https://stats.ixarea.com; object-src 'self'"
|
||||||
|
}
|
20
make-extension.js
Normal file
20
make-extension.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
|
const src = "./src/extension/"
|
||||||
|
const dst = "./dist"
|
||||||
|
fs.readdirSync(src).forEach(file => {
|
||||||
|
let srcPath = path.join(src, file)
|
||||||
|
let dstPath = path.join(dst, file)
|
||||||
|
fs.copyFileSync(srcPath, dstPath)
|
||||||
|
console.log(`Copy: ${srcPath} => ${dstPath}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
const manifestRaw = fs.readFileSync("./extension-manifest.json", "utf-8")
|
||||||
|
const manifest = JSON.parse(manifestRaw)
|
||||||
|
|
||||||
|
const pkgRaw = fs.readFileSync("./package.json", "utf-8")
|
||||||
|
const pkg = JSON.parse(pkgRaw)
|
||||||
|
|
||||||
|
manifest["version"] = pkg["version"]
|
||||||
|
fs.writeFileSync("./dist/manifest.json", JSON.stringify(manifest), "utf-8")
|
||||||
|
console.log("Write: manifest.json")
|
6085
package-lock.json
generated
6085
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
29
package.json
29
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "unlock-music",
|
"name": "unlock-music",
|
||||||
"version": "1.7.2",
|
"version": "1.8.1",
|
||||||
"updateInfo": "修复.qmc解锁的一些问题",
|
"updateInfo": "添加构建为Docker镜像",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"description": "Unlock encrypted music file in browser.",
|
"description": "Unlock encrypted music file in browser.",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -12,30 +12,31 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
"build": "vue-cli-service build",
|
"build": "vue-cli-service build",
|
||||||
"fix-compatibility": "node ./src/fix-compatibility.js"
|
"fix-compatibility": "node ./src/fix-compatibility.js",
|
||||||
|
"make-extension": "node ./make-extension.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"base64-js": "^1.5.1",
|
"base64-js": "^1.5.1",
|
||||||
"browser-id3-writer": "^4.4.0",
|
"browser-id3-writer": "^4.4.0",
|
||||||
"core-js": "^3.8.1",
|
"core-js": "^3.8.3",
|
||||||
"crypto-js": "^4.0.0",
|
"crypto-js": "^4.0.0",
|
||||||
"element-ui": "^2.14.1",
|
"element-ui": "^2.15.0",
|
||||||
"iconv-lite": "^0.5.1",
|
"iconv-lite": "^0.6.2",
|
||||||
"jimp": "^0.14.0",
|
"jimp": "^0.16.1",
|
||||||
"metaflac-js": "^1.0.5",
|
"metaflac-js": "^1.0.5",
|
||||||
"music-metadata-browser": "^2.1.7",
|
"music-metadata-browser": "^2.2.4",
|
||||||
"node-sass": "^4.14.1",
|
|
||||||
"register-service-worker": "^1.7.2",
|
"register-service-worker": "^1.7.2",
|
||||||
"sass-loader": "^10.0.2",
|
|
||||||
"vue": "^2.6.12"
|
"vue": "^2.6.12"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vue/cli-plugin-babel": "^4.5.9",
|
"@vue/cli-plugin-babel": "^4.5.11",
|
||||||
"@vue/cli-plugin-pwa": "^4.5.9",
|
"@vue/cli-plugin-pwa": "^4.5.11",
|
||||||
"@vue/cli-service": "^4.5.9",
|
"@vue/cli-service": "^4.5.11",
|
||||||
"babel-plugin-component": "^1.1.1",
|
"babel-plugin-component": "^1.1.1",
|
||||||
"vue-cli-plugin-element": "^1.0.1",
|
"vue-cli-plugin-element": "^1.0.1",
|
||||||
"vue-template-compiler": "^2.6.12",
|
"vue-template-compiler": "^2.6.12",
|
||||||
"workerize-loader": "^1.3.0"
|
"workerize-loader": "^1.3.0",
|
||||||
|
"sass-loader": "^10.1.1",
|
||||||
|
"node-sass": "^5.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -5,13 +5,10 @@
|
|||||||
<meta content="webkit" name="renderer">
|
<meta content="webkit" name="renderer">
|
||||||
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
|
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
|
||||||
<meta content="width=device-width,initial-scale=1.0" name="viewport">
|
<meta content="width=device-width,initial-scale=1.0" name="viewport">
|
||||||
<!--@formatter:off-->
|
<title>音乐解锁</title>
|
||||||
<script>var _paq=window._paq||[];_paq.push(["setRequestMethod","POST"],["trackPageView"],["enableLinkTracking"],["setSiteId","2"],["setTrackerUrl","https://stats.ixarea.com/ixarea-stats/report"]);</script>
|
|
||||||
<!--@formatter:on-->
|
|
||||||
<script async src="https://stats.ixarea.com/ixarea-stats.js"></script>
|
|
||||||
<title>音乐解锁 - By IXarea</title>
|
|
||||||
<meta content="音乐,解锁,ncm,qmc,mgg,mflac,qq音乐,网易云音乐,加密" name="keywords"/>
|
<meta content="音乐,解锁,ncm,qmc,mgg,mflac,qq音乐,网易云音乐,加密" name="keywords"/>
|
||||||
<meta content="音乐解锁 - 在任何设备上解锁已购的加密音乐!" name="description"/>
|
<meta content="音乐解锁 - 在任何设备上解锁已购的加密音乐!" name="description"/>
|
||||||
|
<script src="./ixarea-stats.js"></script>
|
||||||
<!--@formatter:off-->
|
<!--@formatter:off-->
|
||||||
<style>#loader{position:absolute;left:50%;top:50%;z-index:1010;margin:-75px 0 0 -75px;border:16px solid #f3f3f3;border-radius:50%;border-top:16px solid #1db1ff;width:120px;height:120px;animation:spin 2s linear infinite}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}#loader-mask{text-align:center;position:absolute;width:100%;height:100%;bottom:0;left:0;right:0;top:0;z-index:1009;background-color:rgba(242,246,252,.88)}@media (prefers-color-scheme:dark){#loader-mask{color:#fff;background-color:rgba(0,0,0,.85)}#loader-mask a{color:#ddd}#loader-mask a:hover{color:#1db1ff}}#loader-source{font-size:1.5rem}#loader-tips-timeout{font-size:1.2rem}</style>
|
<style>#loader{position:absolute;left:50%;top:50%;z-index:1010;margin:-75px 0 0 -75px;border:16px solid #f3f3f3;border-radius:50%;border-top:16px solid #1db1ff;width:120px;height:120px;animation:spin 2s linear infinite}@keyframes spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}#loader-mask{text-align:center;position:absolute;width:100%;height:100%;bottom:0;left:0;right:0;top:0;z-index:1009;background-color:rgba(242,246,252,.88)}@media (prefers-color-scheme:dark){#loader-mask{color:#fff;background-color:rgba(0,0,0,.85)}#loader-mask a{color:#ddd}#loader-mask a:hover{color:#1db1ff}}#loader-source{font-size:1.5rem}#loader-tips-timeout{font-size:1.2rem}</style>
|
||||||
<!--@formatter:on-->
|
<!--@formatter:on-->
|
||||||
@@ -27,12 +24,12 @@
|
|||||||
style="border:0"/>
|
style="border:0"/>
|
||||||
</noscript>
|
</noscript>
|
||||||
<h3 id="loader-source"> 请勿直接运行源代码! </h3>
|
<h3 id="loader-source"> 请勿直接运行源代码! </h3>
|
||||||
<div hidden id="loader-tips-outdated">
|
<div id="loader-tips-outdated" hidden>
|
||||||
<h2>您可能在使用不受支持的<span style="color:#f00;">过时</span>浏览器,这可能导致此应用无法正常工作。</h2>
|
<h2>您可能在使用不受支持的<span style="color:#f00;">过时</span>浏览器,这可能导致此应用无法正常工作。</h2>
|
||||||
<h3>如果您使用双核浏览器,您可以尝试切换到 <span style="color:#f00;">“极速模式”</span> 解决此问题。</h3>
|
<h3>如果您使用双核浏览器,您可以尝试切换到 <span style="color:#f00;">“极速模式”</span> 解决此问题。</h3>
|
||||||
<h3>或者,您可以尝试更换下方的几个浏览器之一。</h3>
|
<h3>或者,您可以尝试更换下方的几个浏览器之一。</h3>
|
||||||
</div>
|
</div>
|
||||||
<h3 hidden id="loader-tips-timeout">
|
<h3 id="loader-tips-timeout" hidden>
|
||||||
音乐解锁采用了一些新特性!建议使用
|
音乐解锁采用了一些新特性!建议使用
|
||||||
<a href="https://www.microsoft.com/zh-cn/edge" target="_blank">Microsoft Edge Chromium</a>
|
<a href="https://www.microsoft.com/zh-cn/edge" target="_blank">Microsoft Edge Chromium</a>
|
||||||
<a href="https://www.google.cn/chrome/" target="_blank">Google Chrome</a>
|
<a href="https://www.google.cn/chrome/" target="_blank">Google Chrome</a>
|
||||||
@@ -41,32 +38,6 @@
|
|||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<script>
|
<script src="./loader.js"></script>
|
||||||
(function () {
|
|
||||||
setTimeout(function () {
|
|
||||||
var ele = document.getElementById("loader-tips-timeout");
|
|
||||||
if (ele != null) {
|
|
||||||
ele.hidden = false;
|
|
||||||
}
|
|
||||||
}, 2000);
|
|
||||||
|
|
||||||
var ua = navigator && navigator.userAgent;
|
|
||||||
var detected = (function () {
|
|
||||||
var m;
|
|
||||||
if (!ua) return true;
|
|
||||||
if (/MSIE |Trident\//.exec(ua)) return true; // no IE
|
|
||||||
m = /Edge\/([\d.]+)/.exec(ua); // Edge >= 17
|
|
||||||
if (m && Number(m[1]) < 17) return true;
|
|
||||||
m = /Chrome\/([\d.]+)/.exec(ua); // Chrome >= 58
|
|
||||||
if (m && Number(m[1]) < 58) return true;
|
|
||||||
m = /Firefox\/([\d.]+)/.exec(ua); // Firefox >= 45
|
|
||||||
return m && Number(m[1]) < 45;
|
|
||||||
})();
|
|
||||||
if (detected) {
|
|
||||||
document.getElementById('loader-tips-outdated').hidden = false;
|
|
||||||
document.getElementById("loader-tips-timeout").hidden = false;
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
10
public/ixarea-stats.js
Normal file
10
public/ixarea-stats.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
var _paq = window._paq || [];
|
||||||
|
_paq.push(["setRequestMethod", "POST"], ["trackPageView"], ["enableLinkTracking"],
|
||||||
|
["setSiteId", "2"], ["setTrackerUrl", "https://stats.ixarea.com/ixarea-stats/report"]);
|
||||||
|
|
||||||
|
var tag = document.createElement('script');
|
||||||
|
tag.type = 'text/javascript';
|
||||||
|
tag.async = true;
|
||||||
|
tag.src = 'https://stats.ixarea.com/ixarea-stats.js';
|
||||||
|
var s = document.getElementsByTagName('script')[0];
|
||||||
|
s.parentNode.insertBefore(tag, s);
|
25
public/loader.js
Normal file
25
public/loader.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
(function () {
|
||||||
|
setTimeout(function () {
|
||||||
|
var ele = document.getElementById("loader-tips-timeout");
|
||||||
|
if (ele != null) {
|
||||||
|
ele.hidden = false;
|
||||||
|
}
|
||||||
|
}, 2000);
|
||||||
|
|
||||||
|
var ua = navigator && navigator.userAgent;
|
||||||
|
var detected = (function () {
|
||||||
|
var m;
|
||||||
|
if (!ua) return true;
|
||||||
|
if (/MSIE |Trident\//.exec(ua)) return true; // no IE
|
||||||
|
m = /Edge\/([\d.]+)/.exec(ua); // Edge >= 17
|
||||||
|
if (m && Number(m[1]) < 17) return true;
|
||||||
|
m = /Chrome\/([\d.]+)/.exec(ua); // Chrome >= 58
|
||||||
|
if (m && Number(m[1]) < 58) return true;
|
||||||
|
m = /Firefox\/([\d.]+)/.exec(ua); // Firefox >= 45
|
||||||
|
return m && Number(m[1]) < 45;
|
||||||
|
})();
|
||||||
|
if (detected) {
|
||||||
|
document.getElementById('loader-tips-outdated').hidden = false;
|
||||||
|
document.getElementById("loader-tips-timeout").hidden = false;
|
||||||
|
}
|
||||||
|
})();
|
@@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "音乐解锁 - By IXarea",
|
|
||||||
"short_name": "音乐解锁",
|
|
||||||
"description": "在任何设备上解锁已购的加密音乐!支持QQ音乐与网易云音乐!",
|
|
||||||
"icons": [
|
|
||||||
{
|
|
||||||
"src": "./img/icons/android-chrome-192x192.png",
|
|
||||||
"sizes": "192x192",
|
|
||||||
"type": "image/png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "./img/icons/android-chrome-512x512.png",
|
|
||||||
"sizes": "512x512",
|
|
||||||
"type": "image/png"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"start_url": "./index.html",
|
|
||||||
"display": "standalone",
|
|
||||||
"background_color": "#000000",
|
|
||||||
"theme_color": "#4DBA87"
|
|
||||||
}
|
|
13
src/extension/popup.html
Normal file
13
src/extension/popup.html
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script src="./popup.js"></script>
|
||||||
|
<a href="./index.html" target="_blank">
|
||||||
|
<button>立即使用</button>
|
||||||
|
</a>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
5
src/extension/popup.js
Normal file
5
src/extension/popup.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
const bs = chrome || browser
|
||||||
|
bs.tabs.create({
|
||||||
|
url: bs.runtime.getURL('./index.html')
|
||||||
|
}, tab => console.log(tab))
|
||||||
|
|
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
import {register} from 'register-service-worker'
|
import {register} from 'register-service-worker'
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production' && window.location.protocol === "https:") {
|
||||||
|
|
||||||
register(`${process.env.BASE_URL}service-worker.js`, {
|
register(`${process.env.BASE_URL}service-worker.js`, {
|
||||||
ready() {
|
ready() {
|
||||||
console.log('App is being served from cache by a service worker.')
|
console.log('App is being served from cache by a service worker.')
|
||||||
|
@@ -2,6 +2,36 @@ module.exports = {
|
|||||||
publicPath: '',
|
publicPath: '',
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
pwa: {
|
pwa: {
|
||||||
|
manifestPath: "web-manifest.json",
|
||||||
|
name: "音乐解锁",
|
||||||
|
themeColor: "#4DBA87",
|
||||||
|
msTileColor: "#000000",
|
||||||
|
manifestOptions: {
|
||||||
|
start_url: "./index.html",
|
||||||
|
description: "在任何设备上解锁已购的加密音乐!",
|
||||||
|
icons: [
|
||||||
|
{
|
||||||
|
'src': './img/icons/android-chrome-192x192.png',
|
||||||
|
'sizes': '192x192',
|
||||||
|
'type': 'image/png'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'src': './img/icons/android-chrome-512x512.png',
|
||||||
|
'sizes': '512x512',
|
||||||
|
'type': 'image/png'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
appleMobileWebAppCapable: 'yes',
|
||||||
|
iconPaths: {
|
||||||
|
faviconSVG: './img/icons/safari-pinned-tab.svg',
|
||||||
|
favicon32: './img/icons/favicon-32x32.png',
|
||||||
|
favicon16: './img/icons/favicon-16x16.png',
|
||||||
|
appleTouchIcon: './img/icons/apple-touch-icon-152x152.png',
|
||||||
|
maskIcon: './img/icons/safari-pinned-tab.svg',
|
||||||
|
msTileImage: './img/icons/msapplication-icon-144x144.png'
|
||||||
|
},
|
||||||
|
workboxPluginMode: "GenerateSW",
|
||||||
workboxOptions: {
|
workboxOptions: {
|
||||||
skipWaiting: true
|
skipWaiting: true
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user