fix: map search result fields songmid->id, singer->artists for QZv2 Music model
This commit is contained in:
@@ -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.artist || '',
|
||||
artists: item.artist || '',
|
||||
name: item.name || '',
|
||||
albumName: item.album || '',
|
||||
albumId: item.albumid || '',
|
||||
source: 'kw',
|
||||
interval: item.duration ? formatPlayTime(item.duration) : '',
|
||||
songmid: item.id || item.rid || '',
|
||||
id: item.id || item.rid || '',
|
||||
songId: item.id || item.rid || '',
|
||||
img: item.pic || '',
|
||||
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 rid = songInfo.songmid || '';
|
||||
var rid = songInfo.id || '';
|
||||
if (!rid) return Promise.resolve('');
|
||||
return requestUrl('https://kuwo-api.vercel.app/api/lyric?id=' + encodeURIComponent(rid), 'GET', {
|
||||
'User-Agent': 'Mozilla/5.0 (Linux; Android 10)'
|
||||
@@ -187,7 +187,7 @@ module.exports = {
|
||||
hotSearch: { getList: hotSearch },
|
||||
leaderboard: { getBoards: leaderboard },
|
||||
songList: songList,
|
||||
singer: singer,
|
||||
artists: singer,
|
||||
album: album,
|
||||
getLyric: getLyric,
|
||||
getPic: getPic,
|
||||
|
||||
Reference in New Issue
Block a user