feat: migrate ChKSz API and support API key authentication

This commit is contained in:
Jocay
2026-10-10 20:22:49 +08:00
parent 480233f01b
commit 5bd62645ab
13 changed files with 82 additions and 49 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
const fs = require('fs');
const path = require('path');
const { API, DOWNLOAD_DIR } = require('./config');
const { API, DOWNLOAD_DIR, buildApiUrl } = require('./config');
const { fetchJSON } = require('./network');
const { formatPersonNames } = require('./utils');
async function fetchLyric(songId) {
try {
const res = await fetchJSON(`${API.lyric}?id=${songId}`);
const res = await fetchJSON(buildApiUrl(API.lyric, { id: songId }));
if (res.code !== 200) return null;
return res.data;
} catch {