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.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,
|
||||
|
||||
Reference in New Issue
Block a user