Skip to content

Commit

Permalink
merge: Update codebase (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
pan93412 authored Nov 17, 2022
2 parents c4fa1a7 + b7dcb4c commit 178a290
Show file tree
Hide file tree
Showing 29 changed files with 239 additions and 180 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/napi-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ jobs:
- uses: actions/checkout@v3
- name: Build
id: build
uses: vmactions/freebsd-vm@v0.2.9
uses: vmactions/freebsd-vm@v0.3.0
env:
DEBUG: napi:*
RUSTUP_HOME: /usr/local/rustup
Expand Down
86 changes: 44 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,14 @@ N-API 和 RESTful API 支援的引擎(以下簡稱「預設引擎集」)與
| Bilbili Music | `bilibili` | ||
| 酷狗音乐 | `kugou` | ||
| 酷我音乐 | `kuwo` | 目前僅支援 320kbps MP3 ||
| 咪咕音乐 | `migu` | | |
| 咪咕音乐 | `migu` | | |
| JOOX | `joox` | 需要設定 `joox:cookie`,見引擎文件。 ||
| YtDl | `ytdl` | 預設使用的 `youtube-dl` 後端是 `yt-dlp`,可設定 `ytdl:exe` 調整 ||
| 第三方網易雲 API | `pyncm` | ||
| QQ音乐 | `qq` | 需要設定 `qq:cookie`,見引擎文件。 ||

- `migu` 的 API 壞掉了。等到有更好的 API 會再更新。

#### 引擎文件

- JOOX 引擎:<https://docs.rs/unm_engine_joox>
Expand Down
1 change: 0 additions & 1 deletion api-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ unm_engine_bilibili = { version = "0.3.0", path = "../engines/bilibili" }
unm_engine_joox = { version = "0.3.0", path = "../engines/joox" }
unm_engine_kugou = { version = "0.3.0", path = "../engines/kugou" }
unm_engine_kuwo = { version = "0.3.0", path = "../engines/kuwo" }
unm_engine_migu = { version = "0.3.0", path = "../engines/migu" }
unm_engine_pyncm = { version = "0.3.0", path = "../engines/pyncm" }
unm_engine_qq = { version = "0.3.0", path = "../engines/qq" }
unm_engine_ytdl = { version = "0.3.0", path = "../engines/ytdl" }
3 changes: 1 addition & 2 deletions api-utils/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use unm_engine::executor::Executor;

/// Build an [`Executor`] with all the official engines registered.
///
/// Currently, it includes `bilibili`, `kugou`, `migu`, `pyncm`,
/// Currently, it includes `bilibili`, `kugou`, `pyncm`,
/// `ytdl`, `kuwo`, and `joox`.
///
/// # Example
Expand All @@ -36,7 +36,6 @@ pub fn build_full_executor() -> Executor {

push_engine!(bilibili: BilibiliEngine);
push_engine!(kugou: KugouEngine);
push_engine!(migu: MiguEngine);
push_engine!(pyncm: PyNCMEngine);
push_engine!(ytdl: YtDlEngine);
push_engine!(kuwo: KuwoEngine);
Expand Down
2 changes: 1 addition & 1 deletion crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ md5 = "0.7.0"
once_cell = "1.16.0"
openssl = { version = "0.10.42", features = ["vendored"] }

regex = "1.6.0"
regex = "1.7.0"

serde = { version = "1.0.147", features = ["derive"] }
serde_json = "1.0.87"
Expand Down
2 changes: 1 addition & 1 deletion crypto/src/base64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ pub fn encode_crypto_base64(src: &[u8]) -> String {

pub fn decode_crypto_base64(src: &str) -> CryptoResult<Vec<u8>> {
let src = src.replace('+', "-").replace('/', "_");
Ok(decode(&src)?)
Ok(decode(src)?)
}
2 changes: 1 addition & 1 deletion crypto/src/weapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ mod tests {
let encrypted_bytes = encrypt_with_weapi_rsa(b"a1b2c3d4", &mut buf).unwrap();
assert_eq!(encrypted_bytes, 128);

let encrypted_base64 = base64::encode(&buf);
let encrypted_base64 = base64::encode(buf);
assert_eq!(
encrypted_base64,
r#"nknIprgQgDE2Ana3dka2qYhwE4ch/My68kTk0pGZmtkeWCTslpn9Co32as7sd5fyitf5lyXwMff/g/kDzaz6IVA/tMAtbbzkgWPDMivRy5b8z1Ypd7UV7r6aM6OgNT1bFjPo4jEAkmUl6UxCBAsrsMaaYqmW6rZl0BdJdb0/Tq0="#
Expand Down
2 changes: 1 addition & 1 deletion engine-demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ publish = false

[dependencies]
futures = "0.3.25"
mimalloc = "0.1.30"
mimalloc = "0.1.32"
tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread"] }
unm_api_utils = { version = "0.3.0", path = "../api-utils" }
unm_test_utils = { version = "0.1.0", path = "../test-utils" }
Expand Down
4 changes: 2 additions & 2 deletions engines/joox/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ base64 = "0.13.1"
http = "0.2.8"
log = "0.4.17"
once_cell = "1.16.0"
regex = "1.6.0"
reqwest = { version = "0.11.12", features = ["native-tls-vendored"] }
regex = "1.7.0"
reqwest = { version = "0.11.13", features = ["native-tls-vendored"] }
serde_json = "1.0.87"
unm_engine = { version = "0.3.0", path = "../../engine-base" }
unm_request = { version = "0.3.0", path = "../../request" }
Expand Down
2 changes: 1 addition & 1 deletion engines/kugou/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concat-string = "1.0.1"
futures = "0.3.25"
http = "0.2.8"
log = "0.4.17"
reqwest = { version = "0.11.12", features = ["native-tls-vendored"] }
reqwest = { version = "0.11.13", features = ["native-tls-vendored"] }
serde = { version = "1.0.147", features = ["derive"] }
serde_json = "1.0.87"
unm_engine = { version = "0.3.0", path = "../../engine-base" }
Expand Down
2 changes: 1 addition & 1 deletion engines/kuwo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concat-string = "1.0.1"
http = "0.2.8"
log = "0.4.17"
random-string = "1.0.0"
reqwest = { version = "0.11.12", features = ["native-tls-vendored"] }
reqwest = { version = "0.11.13", features = ["native-tls-vendored"] }
serde = { version = "1.0.147", features = ["derive"] }
unm_engine = { version = "0.3.0", path = "../../engine-base" }
unm_request = { version = "0.3.0", path = "../../request" }
Expand Down
2 changes: 1 addition & 1 deletion engines/migu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ unm_types = { version = "0.3.0", path = "../../types" }
url = "2.3.1"

[dev-dependencies]
reqwest = { version = "0.11.12", features = ["native-tls-vendored"] }
reqwest = { version = "0.11.13", features = ["native-tls-vendored"] }
tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread"] }
unm_test_utils = { path = "../../test-utils" }
4 changes: 4 additions & 0 deletions engines/pyncm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ unm_engine = { version = "0.3.0", path = "../../engine-base" }
unm_request = { version = "0.3.0", path = "../../request" }
unm_types = { version = "0.3.0", path = "../../types" }
url = "2.3.1"

[dev-dependencies]
tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread"] }
unm_test_utils = { path = "../../test-utils" }
Loading

0 comments on commit 178a290

Please sign in to comment.