Compare commits

...

3 Commits

6 changed files with 135 additions and 438 deletions

View File

@ -1,87 +0,0 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Test Build
on:
push:
paths:
- ".github/workflows/*"
- "**/*.js"
- "**/*.ts"
- "**/*.vue"
- "public/**/*"
- "package-lock.json"
- "package.json"
pull_request:
branches: [ master ]
types: [ opened, synchronize, reopened ]
paths:
- "**/*.js"
- "**/*.ts"
- "**/*.vue"
- "public/**/*"
- "package-lock.json"
- "package.json"
jobs:
test-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci
# note: forks can not access to GITHUB_TOKEN for coverage update.
# instead, we just ran the test in this case.
- name: Test only
if: github.event_name != 'push'
run: npm test
- name: Test + Publish Coverage
uses: ArtiomTr/jest-coverage-report-action@v2.0-rc.6
if: github.event_name == 'push'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
annotations: none
build:
runs-on: ubuntu-latest
strategy:
matrix:
build: [ legacy, modern ]
include:
- build: legacy
BUILD_ARGS: ""
BUILD_EXTENSION: true
- build: modern
BUILD_ARGS: "-- --modern"
BUILD_EXTENSION: false
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: "16"
- name: Install Dependencies
run: npm ci
- name: Build Wasm
run: bash build-wasm
- name: Build
run: npm run build ${{ matrix.BUILD_ARGS }}
- name: Publish artifact
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.build }}
path: ./dist
- name: Build Extension
if: ${{ matrix.BUILD_EXTENSION }}
run: npm run make-extension
- name: Publish artifact - Extension
if: ${{ matrix.BUILD_EXTENSION }}
uses: actions/upload-artifact@v2
with:
name: extension
path: ./dist

View File

@ -1,65 +0,0 @@
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

View File

@ -1,129 +0,0 @@
name: Build Release
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: "16"
- name: Install Dependencies
run: npm ci
- name: Build Wasm
run: bash build-wasm
- name: Build Legacy
env:
GZIP: "--best"
run: |
npm run build
tar -czf legacy.tar.gz -C ./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
env:
GZIP: "--best"
run: |
npm run build -- --modern
tar -czf modern.tar.gz -C ./dist .
cd dist
zip -rJ9 ../modern.zip *
cd ..
- name: Checksum
run: sha256sum *.tar.gz *.zip > sha256sum.txt
- name: Get current time
id: date
run: echo "::set-output name=date::$(date +'%Y/%m/%d')"
- name: Create a Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: "Build ${{ steps.date.outputs.date }}"
draft: true
- name: Upload Release Assets - legacy.tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./legacy.tar.gz
asset_name: legacy.tar.gz
asset_content_type: application/gzip
- name: Upload Release Assets - legacy.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./legacy.zip
asset_name: legacy.zip
asset_content_type: application/zip
- name: Upload Release Assets - modern.tar.gz
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./modern.tar.gz
asset_name: modern.tar.gz
asset_content_type: application/gzip
- name: Upload Release Assets - modern.zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./modern.zip
asset_name: modern.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
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./sha256sum.txt
asset_name: sha256sum.txt
asset_content_type: text/plain

View File

@ -1,39 +1,39 @@
--- ---
name: Bug报告 name: Bug报告
about: 报告Bug以帮助改进程序 about: 报告Bug以帮助改进程序
title: '' title: ''
labels: bug labels: bug
assignees: '' assignees: ''
--- ---
* 请按照此模板填写,否则可能立即被关闭 * 请按照此模板填写,否则可能立即被关闭
- [x] 我确认已经搜索过Issue不存并确认相同的Issue - [x] 我确认已经搜索过Issue不存并确认相同的Issue
- [x] 我有证据表明这是程序导致的问题(如不确认,可以在[Discussions](https://github.com/ix64/unlock-music/discussions)内提出) - [x] 我有证据表明这是程序导致的问题(如不确认,可以在[Discussions](https://github.com/ix64/unlock-music/discussions)内提出)
**Bug描述** **Bug描述**
简要地复述你遇到的Bug 简要地复述你遇到的Bug
**复现方法** **复现方法**
描述复现方法,必要时请提供样本文件 描述复现方法,必要时请提供样本文件
**程序截图或者Console报错信息** **程序截图或者Console报错信息**
如果可以请提供二者之一 如果可以请提供二者之一
**环境信息:** **环境信息:**
- 操作系统和浏览器: - 操作系统和浏览器:
- 程序版本: - 程序版本:
- 获取音乐文件所使用的客户端及其版本信息: - 获取音乐文件所使用的客户端及其版本信息:
**附加信息** **附加信息**
其他能够帮助确认问题的信息 其他能够帮助确认问题的信息

View File

@ -1,26 +1,26 @@
--- ---
name: 新功能 name: 新功能
about: 对于程序新的想法或建议 about: 对于程序新的想法或建议
title: '' title: ''
labels: enhancement labels: enhancement
assignees: '' assignees: ''
--- ---
- 请按照此模板填写,否则可能立即被关闭 - 请按照此模板填写,否则可能立即被关闭
**背景和说明** **背景和说明**
简要说明产生此想法的背景和此想法的具体内容 简要说明产生此想法的背景和此想法的具体内容
**实现途径** **实现途径**
- 如果没有设计方案,请简要描述实现思路 - 如果没有设计方案,请简要描述实现思路
- 如果你没有任何的实现思路,请通过[Discussions](https://github.com/ix64/unlock-music/discussions)或者Telegram进行讨论 - 如果你没有任何的实现思路,请通过[Discussions](https://github.com/ix64/unlock-music/discussions)或者Telegram进行讨论
**附加信息** **附加信息**
更多你想要表达的内容 更多你想要表达的内容

162
README.md
View File

@ -1,97 +1,75 @@
# Unlock Music 音乐解锁 # Unlock Music 音乐解锁
- 在浏览器中解锁加密的音乐文件。 Unlock encrypted music file in the browser. - 在浏览器中解锁加密的音乐文件。 Unlock encrypted music file in the browser.
- Unlock Music 项目是以学习和技术研究的初衷创建的,修改、再分发时请遵循 [License][license] - Unlock Music 项目是以学习和技术研究的初衷创建的,修改、再分发时请遵循[授权协议]。
- Unlock Music 的 CLI 版本可以在 [unlock-music/cli][repo_cli] 找到,大批量转换建议使用 CLI 版本。 - Unlock Music 的 CLI 版本可以在 [unlock-music/cli] 找到,大批量转换建议使用 CLI 版本。
- 我们新建了 Telegram 群组 [`@unlock_music_chat`][tg_group] ,欢迎加入! - 我们新建了 Telegram 群组 [`@unlock_music_chat`] ,欢迎加入!
- [相关的其他项目][related_projects]
[授权协议]: https://git.unlock-music.dev/um/web/src/branch/master/LICENSE
![Test Build](https://github.com/unlock-music/unlock-music/workflows/Test%20Build/badge.svg) [unlock-music/cli]: https://git.unlock-music.dev/um/cli
![GitHub releases](https://img.shields.io/github/downloads/unlock-music/unlock-music/total) [`@unlock_music_chat`]: https://t.me/unlock_music_chat
![Docker Pulls](https://img.shields.io/docker/pulls/ix64/unlock-music)
## 特性
[license]: https://github.com/unlock-music/unlock-music/blob/master/LICENSE
### 支持的格式
[repo_cli]: https://github.com/unlock-music/cli
- [x] QQ 音乐 (.qmc0/.qmc2/.qmc3/.qmcflac/.qmcogg/.tkm)
[tg_group]: https://t.me/unlock_music_chat - [x] Moo 音乐格式 (.bkcmp3/.bkcflac/...)
- [x] QQ 音乐 Tm 格式 (.tm0/.tm2/.tm3/.tm6)
[related_projects]: https://github.com/unlock-music/unlock-music/wiki/和UnlockMusic相关的项目 - [x] QQ 音乐新格式 (.mflac/.mgg/.mflac0/.mgg1/.mggl)
- [x] <ruby>QQ 音乐海外版<rt>JOOX Music</rt></ruby> (.ofl_en)
## 特性 - [x] 网易云音乐格式 (.ncm)
- [x] 虾米音乐格式 (.xm)
### 支持的格式 - [x] 酷我音乐格式 (.kwm)
- [x] 酷狗音乐格式 (.kgm/.vpr)
- [x] QQ 音乐 (.qmc0/.qmc2/.qmc3/.qmcflac/.qmcogg/.tkm)
- [x] Moo 音乐格式 (.bkcmp3/.bkcflac/...) ### 其他特性
- [x] QQ 音乐 Tm 格式 (.tm0/.tm2/.tm3/.tm6)
- [x] QQ 音乐新格式 (.mflac/.mgg/.mflac0/.mgg1/.mggl) - [x] 在浏览器中解锁
- [x] <ruby>QQ 音乐海外版<rt>JOOX Music</rt></ruby> (.ofl_en) - [x] 拖放文件
- [x] 网易云音乐格式 (.ncm) - [x] 批量解锁
- [x] 虾米音乐格式 (.xm) - [x] 渐进式 Web 应用 (PWA)
- [x] 酷我音乐格式 (.kwm) - [x] 多线程
- [x] 酷狗音乐格式 (.kgm/.vpr) ([CLI 版本][kgm_cli]) - [x] 写入元信息与专辑封面
[kgm_cli]: https://github.com/unlock-music/unlock-music/wiki/其他音乐格式工具#酷狗音乐-kgmvpr解锁工具 ## 使用方法
[joox_wiki]: https://github.com/unlock-music/joox-crypto/wiki/加密格式 ### 使用预构建版本
### 其他特性 - 从 [Release] 下载预构建的版本
- :warning: 本地使用请下载`legacy版本``modern版本`只能通过 **http(s)协议** 访问)
- [x] 在浏览器中解锁 - 解压缩后即可部署或本地使用(**请勿直接运行源代码**
- [x] 拖放文件
- [x] 批量解锁 [release]: https://git.unlock-music.dev/um/web/releases/latest
- [x] 渐进式 Web 应用 (PWA)
- [x] 多线程 ### 自行构建
- [x] 写入Meta和封面图片
## 使用方法
### 安装浏览器扩展
[![Chrome Web Store](https://storage.googleapis.com/chrome-gcs-uploader.appspot.com/image/WlD8wC6g8khYWPJUsQceQkhXSlv1/UV4C4ybeBTsZt43U4xis.png)](https://chrome.google.com/webstore/detail/gldlhhhmienbhlpkfanjpmffdjblmegd)
[<img src="https://developer.microsoft.com/en-us/store/badges/images/Chinese_Simplified_get-it-from-MS.png" height="60" alt="Microsoft Edge Addons"/>](https://microsoftedge.microsoft.com/addons/detail/ggafoipegcmodfhakdkalpdpcdkiljmd)
[![Firefox Browser Addons](https://ffp4g1ylyit3jdyti1hqcvtb-wpengine.netdna-ssl.com/addons/files/2015/11/get-the-addon.png)](https://addons.mozilla.org/zh-CN/firefox/addon/unlock-music/)
### 使用已构建版本
- 从[GitHub Release](https://github.com/unlock-music/unlock-music/releases/latest)下载已构建的版本
- 本地使用请下载`legacy版本``modern版本`只能通过 **http(s)协议** 访问)
- 解压缩后即可部署或本地使用(**请勿直接运行源代码**
### 使用 Docker 镜像
```shell
docker run --name unlock-music -d -p 8080:80 ix64/unlock-music
```
### 自行构建
#### JS部分 #### JS部分
- 环境要求 - 环境要求
- nodejs (v16.x) - nodejs (v16.x)
- npm - npm
1. 获取项目源代码后安装相关依赖: 1. 获取项目源代码后安装相关依赖:
```sh ```sh
npm ci npm ci
``` ```
2. 然后进行构建。编译后的文件保存到 dist 目录下: 2. 然后进行构建:
```sh ```sh
npm run build npm run build
``` ```
- 如果是用于开发,可以执行 `npm run serve` - 构建后的产物可以在 `dist` 目录找到。
- 如果是用于开发,可以执行 `npm run serve`
3. 如需构建浏览器扩展build 完成后还需要执行:
3. 如需构建浏览器扩展,构建成功后还需要执行:
```sh
npm run make-extension ```sh
``` npm run make-extension
```
#### WASM部分 #### WASM部分