fix: map search result fields songmid->id, singer->artists for QZv2 Music model

This commit is contained in:
TRAE Bot
2026-07-05 11:35:16 +00:00
parent ed7d4b356b
commit df3c6aee0e
6 changed files with 36 additions and 36 deletions

View File

@@ -78,13 +78,13 @@ function handleSearchResult(rawList) {
types.push({ type: '128k', size: '' }); _types['128k'] = { size: '' };
types.push({ type: '320k', size: '' }); _types['320k'] = { size: '' };
list.push({
singer: item.singername || '',
artists: item.singername || '',
name: item.songname || '',
albumName: item.album_name || '',
albumId: item.album_id || '',
source: 'kg',
interval: item.duration ? formatPlayTime(item.duration) : '',
songmid: item.hash || item.audio_id || '',
id: item.hash || item.audio_id || '',
songId: item.hash || item.audio_id || '',
img: item.img || '',
lrc: null,
@@ -107,7 +107,7 @@ function search(str, page, limit, retryNum) {
// ===== 播放链接 =====
function getUrl(songInfo, type) {
var q = type || '128k';
var songId = songInfo.songmid || songInfo.id || '';
var songId = songInfo.id || '';
var ceruKey = process.env.ceru_key || '';
var headers = { 'User-Agent': 'QZMusic/2.0' };
if (ceruKey) headers['X-API-Key'] = ceruKey;
@@ -128,7 +128,7 @@ function getPic(songInfo) {
// ===== 歌词 =====
function getLyric(songInfo) {
var hash = songInfo.songmid || '';
var hash = songInfo.id || '';
if (!hash) return Promise.resolve('');
return requestUrl('https://krcs.kugou.com/search?ver=1&man=yes&client=mobi&keyword=&duration=&hash=' + encodeURIComponent(hash) + '&album_audio_id=', 'GET', {
'User-Agent': 'Mozilla/5.0 (Linux; Android 10)'
@@ -198,7 +198,7 @@ module.exports = {
hotSearch: { getList: hotSearch },
leaderboard: { getBoards: leaderboard },
songList: songList,
singer: singer,
artists: singer,
album: album,
getLyric: getLyric,
getPic: getPic,