Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
提交代码
  • Loading branch information
dfvips committed May 28, 2023
1 parent 986081c commit f95a18d
Show file tree
Hide file tree
Showing 139 changed files with 45,854 additions and 124 deletions.
2 changes: 2 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
> 1%
last 2 versions
30 changes: 30 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
kind: pipeline
type: docker
name: default

steps:
- name: build-wasm
image: emscripten/emsdk:3.0.0
commands:
- ./scripts/build-wasm.sh

- name: build
image: node:16.18-bullseye
commands:
- apt-get update
- apt-get install -y jq zip
- npm ci
- npm run test
- ./scripts/build-and-package.sh legacy
- ./scripts/build-and-package.sh extension
- ./scripts/build-and-package.sh modern

- name: upload artifact
image: node:16.18-bullseye
environment:
DRONE_GITEA_SERVER: https://git.unlock-music.dev
GITEA_API_KEY:
from_secret: GITEA_API_KEY
commands:
- ./scripts/upload-packages.sh
355 changes: 232 additions & 123 deletions .gitignore

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
image: node:16
cache:
paths:
- node_modules/

stages:
- build


build-job:
stage: build
script: |
sed -i 's/deb.debian.org/mirrors.cloud.tencent.com/g' /etc/apt/sources.list
apt-get update
apt-get -y install zip
npm config set registry http://mirrors.cloud.tencent.com/npm/
npm ci
npm run build
tar -czf legacy.tar.gz -C ./dist .
cd dist
zip -rJ9 ../legacy.zip *
cd ..
npm run make-extension
cd dist
zip -rJ9 ../extension.zip *
cd ..
npm run build -- --modern
tar -czf modern.tar.gz -C ./dist .
cd dist
zip -rJ9 ../modern.zip *
cd ..
sha256sum *.tar.gz *.zip > sha256sum.txt
artifacts:
name: "$CI_JOB_NAME"
paths:
- legacy.zip
- legacy.tar.gz
- extension.zip
- modern.zip
- modern.tar.gz
- sha256sum.txt
39 changes: 39 additions & 0 deletions .gitlab/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug报告
about: 报告Bug以帮助改进程序
title: ''
labels: bug
assignees: ''

---

* 请按照此模板填写,否则可能立即被关闭

- [x] 我确认已经搜索过Issue不存并确认相同的Issue
- [x] 我有证据表明这是程序导致的问题(如不确认,可以在[Discussions](https://github.com/ix64/unlock-music/discussions)内提出)


**Bug描述**

简要地复述你遇到的Bug

**复现方法**

描述复现方法,必要时请提供样本文件

**程序截图或者Console报错信息**

如果可以请提供二者之一


**环境信息:**

- 操作系统和浏览器:
- 程序版本:
- 获取音乐文件所使用的客户端及其版本信息:


**附加信息**

其他能够帮助确认问题的信息

26 changes: 26 additions & 0 deletions .gitlab/ISSUE_TEMPLATE/new-feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: 新功能
about: 对于程序新的想法或建议
title: ''
labels: enhancement
assignees: ''

---

- 请按照此模板填写,否则可能立即被关闭

**背景和说明**

简要说明产生此想法的背景和此想法的具体内容


**实现途径**

- 如果没有设计方案,请简要描述实现思路
- 如果你没有任何的实现思路,请通过[Discussions](https://github.com/ix64/unlock-music/discussions)或者Telegram进行讨论


**附加信息**

更多你想要表达的内容

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.18.1
42 changes: 42 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// .prettierrc.js
module.exports = {
// 一行最多 120 字符
printWidth: 120,
// 使用 2 个空格缩进
tabWidth: 2,
// 不使用缩进符,而使用空格
useTabs: false,
// 行尾需要有分号
semi: true,
// 使用单引号
singleQuote: true,
// 对象的 key 仅在必要时用引号
quoteProps: 'as-needed',
// jsx 不使用单引号,而使用双引号
jsxSingleQuote: false,
// 末尾需要有逗号
trailingComma: 'all',
// 大括号内的首尾需要空格
bracketSpacing: true,
// jsx 标签的反尖括号需要换行
bracketSameLine: false,
// 箭头函数,只有一个参数的时候,也需要括号
arrowParens: 'always',
// 每个文件格式化的范围是文件的全部内容
rangeStart: 0,
rangeEnd: Infinity,
// 不需要写文件开头的 @prettier
requirePragma: false,
// 不需要自动在文件开头插入 @prettier
insertPragma: false,
// 使用默认的折行标准
proseWrap: 'preserve',
// 根据显示样式决定 html 要不要折行
htmlWhitespaceSensitivity: 'css',
// vue 文件中的 script 和 style 内不用缩进
vueIndentScriptAndStyle: false,
// 换行符使用 lf
endOfLine: 'lf',
// 格式化嵌入的内容
embeddedLanguageFormatting: 'auto',
};
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 梦丶随心飞
Copyright (c) 2019-2023 MengYX

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
129 changes: 129 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# 关于仓库官方

本仓库原始地址(已 DMCA):https://github.com/unlock-music/unlock-music

本仓库目前官方地址:https://git.unlock-music.dev/um/web

你所看到的这个仓库是依照 MIT 协议授权的,除electron部分(不限于electron构建、批量下载改zip压缩后输出)外,代码与[本人](https://github.com/dfvips)无关。

# Unlock Music 音乐解锁 Electron 应用程序
[![Build Status](https://ci.unlock-music.dev/api/badges/um/web/status.svg)](https://github.com/dfvips/unlock-music-electron)
- 在Electron应用程序中解锁加密的音乐文件。 Unlock encrypted music file in the Electron App.
- 无需依赖浏览器,开箱即可使用。

## 自行构建Electron应用程序
- 环境要求
- Linux、MacOs
- python3

1. 运行此目录下的build-wasm

```sh
./scripts/build-wasm.sh
```
2. 然后进行构建:

```sh
npm install
npm run build
npm run package
```
- 前端静态页面构建后的产物可以在 `dist` 目录找到。
- Electron构建后的产物可以在 `build-dist` 目录找到。
- 如果是用于开发,可以执行 `npm run build & npm start`

## 开箱即用版本

https://github.com/dfvips/unlock-music-electron/releases


# Unlock Music 音乐解锁

[![Build Status](https://ci.unlock-music.dev/api/badges/um/web/status.svg)](https://ci.unlock-music.dev/um/web)

- 在浏览器中解锁加密的音乐文件。 Unlock encrypted music file in the browser.
- Unlock Music 项目是以学习和技术研究的初衷创建的,修改、再分发时请遵循[授权协议]。
- Unlock Music 的 CLI 版本可以在 [unlock-music/cli] 找到,大批量转换建议使用 CLI 版本。
- 我们新建了 Telegram 群组 [`@unlock_music_chat`] ,欢迎加入!
- CI 自动构建已经部署,可以在 [UM-Packages] 下载

[授权协议]: https://git.unlock-music.dev/um/web/src/branch/master/LICENSE
[unlock-music/cli]: https://git.unlock-music.dev/um/cli
[`@unlock_music_chat`]: https://t.me/unlock_music_chat
[UM-Packages]: https://git.unlock-music.dev/um/-/packages/generic/web-build/

## 特性

### 支持的格式

- [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] <ruby>QQ 音乐海外版<rt>JOOX Music</rt></ruby> (.ofl_en)
- [x] 网易云音乐格式 (.ncm)
- [x] 虾米音乐格式 (.xm)
- [x] 酷我音乐格式 (.kwm)
- [x] 酷狗音乐格式 (.kgm/.vpr)
- [x] Android版喜马拉雅文件格式 (.x2m/.x3m)
- [x] 咪咕音乐格式 (.mg3d)

### 其他特性

- [x] 在浏览器中解锁
- [x] 拖放文件
- [x] 批量解锁
- [x] 渐进式 Web 应用 (PWA)
- [x] 多线程
- [x] 写入和编辑元信息与专辑封面

## 使用方法

### 使用预构建版本

- 从 [Release] 或 [CI 构建][UM-Packages] 下载预构建的版本
- :warning: 本地使用请下载`legacy版本``modern版本`只能通过 **http(s)协议** 访问)
- 解压缩后即可部署或本地使用(**请勿直接运行源代码**

[release]: https://git.unlock-music.dev/um/web/releases/latest

### 自行构建

#### JS部分

- 环境要求
- nodejs (v16.x)
- npm

1. 获取项目源代码后安装相关依赖:

```sh
npm ci
```

2. 然后进行构建:

```sh
npm run build
```

- 构建后的产物可以在 `dist` 目录找到。
- 如果是用于开发,可以执行 `npm run serve`

3. 如需构建浏览器扩展,构建成功后还需要执行:

```sh
npm run make-extension
```

#### WASM部分

- 环境要求
- Linux
- python3

- 运行此目录下的build-wasm

```sh
./scripts/build-wasm.sh
```
12 changes: 12 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
presets: [
'@vue/app',
'@babel/preset-typescript'
],
plugins: [
["component", {
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}]
]
};
16 changes: 16 additions & 0 deletions extension-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"manifest_version": 2,
"name": "音乐解锁",
"short_name": "音乐解锁",
"icons": {
"128": "./img/icons/msapplication-icon-144x144.png"
},
"description": "在任何设备上解锁已购的加密音乐!",
"permissions": ["storage"],
"offline_enabled": true,
"options_page": "./index.html",
"homepage_url": "https://github.com/ix64/unlock-music",
"browser_action": {
"default_popup": "./popup.html"
}
}
Binary file added icons/icn.ico
Binary file not shown.
Binary file added icons/icn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
testPathIgnorePatterns: ['/build/', '/dist/', '/node_modules/'],
setupFilesAfterEnv: ['./src/__test__/setup_jest.js'],
moduleNameMapper: {
'@/(.*)': '<rootDir>/src/$1',
},
};
Loading

0 comments on commit f95a18d

Please sign in to comment.