diff --git a/src/renderer/utils/musicSdk/kw/api-temp.js b/src/renderer/utils/musicSdk/kw/api-temp.js index 4343941f..7a988976 100644 --- a/src/renderer/utils/musicSdk/kw/api-temp.js +++ b/src/renderer/utils/musicSdk/kw/api-temp.js @@ -5,7 +5,7 @@ import { dnsLookup } from '../utils' const api_temp = { getMusicUrl(songInfo, type) { - const requestObj = httpFetch(`http://tm.tempmusics.tk/url/kw/${songInfo.songmid}/${type}`, { + const requestObj = httpFetch(`http://tm.tempmusics.tk/url/kw/${songInfo.songmid.match(/\d+/g)[0]}/${type}`, { method: 'get', headers, timeout, diff --git a/src/renderer/utils/musicSdk/kw/api-test.js b/src/renderer/utils/musicSdk/kw/api-test.js index 2b65a1f2..8db285e7 100644 --- a/src/renderer/utils/musicSdk/kw/api-test.js +++ b/src/renderer/utils/musicSdk/kw/api-test.js @@ -16,7 +16,7 @@ const api_test = { // return requestObj // }, getMusicUrl(songInfo, type) { - const requestObj = httpFetch(`http://ts.tempmusics.tk/url/kw/${songInfo.songmid}/${type}`, { + const requestObj = httpFetch(`http://ts.tempmusics.tk/url/kw/${songInfo.songmid}.match(/\d+/g)[0]/${type}`, { method: 'get', timeout, headers, diff --git a/src/renderer/utils/musicSdk/kw/comment.js b/src/renderer/utils/musicSdk/kw/comment.js index de821ccf..227f43eb 100644 --- a/src/renderer/utils/musicSdk/kw/comment.js +++ b/src/renderer/utils/musicSdk/kw/comment.js @@ -7,7 +7,7 @@ export default { async getComment({ songmid }, page = 1, limit = 20) { if (this._requestObj) this._requestObj.cancelHttp() - const _requestObj = httpFetch(`http://ncomment.kuwo.cn/com.s?f=web&type=get_comment&aapiver=1&prod=kwplayer_ar_10.5.2.0&digest=15&sid=${songmid}&start=${limit * (page - 1)}&msgflag=1&count=${limit}&newver=3&uid=0`, { + const _requestObj = httpFetch(`http://ncomment.kuwo.cn/com.s?f=web&type=get_comment&aapiver=1&prod=kwplayer_ar_10.5.2.0&digest=15&sid=${songmid.match(/\d+/g)[0]}&start=${limit * (page - 1)}&msgflag=1&count=${limit}&newver=3&uid=0`, { headers: { 'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 9;)', }, @@ -29,7 +29,7 @@ export default { async getHotComment({ songmid }, page = 1, limit = 100) { if (this._requestObj2) this._requestObj2.cancelHttp() - const _requestObj2 = httpFetch(`http://ncomment.kuwo.cn/com.s?f=web&type=get_rec_comment&aapiver=1&prod=kwplayer_ar_10.5.2.0&digest=15&sid=${songmid}&start=${limit * (page - 1)}&msgflag=1&count=${limit}&newver=3&uid=0`, { + const _requestObj2 = httpFetch(`http://ncomment.kuwo.cn/com.s?f=web&type=get_rec_comment&aapiver=1&prod=kwplayer_ar_10.5.2.0&digest=15&sid=${songmid.match(/\d+/g)[0]}&start=${limit * (page - 1)}&msgflag=1&count=${limit}&newver=3&uid=0`, { headers: { 'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 9;)', }, diff --git a/src/renderer/utils/musicSdk/kw/index.js b/src/renderer/utils/musicSdk/kw/index.js index bdc5e796..e33ed068 100644 --- a/src/renderer/utils/musicSdk/kw/index.js +++ b/src/renderer/utils/musicSdk/kw/index.js @@ -65,7 +65,7 @@ const kw = { getMusicInfo(songInfo) { if (this._musicInfoRequestObj) this._musicInfoRequestObj.cancelHttp() - this._musicInfoRequestObj = httpFetch(`http://www.kuwo.cn/api/www/music/musicInfo?mid=${songInfo.songmid}`) + this._musicInfoRequestObj = httpFetch(`http://www.kuwo.cn/api/www/music/musicInfo?mid=${songInfo.songmid.match(/\d+/g)[0]}`) return this._musicInfoRequestObj.promise.then(({ body }) => { return body.code === 200 ? body.data : Promise.reject(new Error(body.msg)) }) @@ -91,7 +91,7 @@ const kw = { }, getMusicDetailPageUrl(songInfo) { - return `http://www.kuwo.cn/play_detail/${songInfo.songmid}` + return `http://www.kuwo.cn/play_detail/${songInfo.songmid.match(/\d+/g)[0]}` }, // init() { diff --git a/src/renderer/utils/musicSdk/kw/lyric.js b/src/renderer/utils/musicSdk/kw/lyric.js index 6e94db26..48c3a599 100644 --- a/src/renderer/utils/musicSdk/kw/lyric.js +++ b/src/renderer/utils/musicSdk/kw/lyric.js @@ -232,7 +232,7 @@ export default { // }, getLyric(musicInfo, isGetLyricx = true) { // this.getLyric2(musicInfo) - const requestObj = httpFetch(`http://newlyric.kuwo.cn/newlyric.lrc?${buildParams(musicInfo.songmid, isGetLyricx)}`) + const requestObj = httpFetch(`http://newlyric.kuwo.cn/newlyric.lrc?${buildParams(musicInfo.songmid.match(/\d+/g)[0], isGetLyricx)}`) requestObj.promise = requestObj.promise.then(({ statusCode, body, raw }) => { if (statusCode != 200) return Promise.reject(new Error(JSON.stringify(body))) return decodeLyric({ lrcBase64: raw.toString('base64'), isGetLyricx }).then(base64Data => { diff --git a/src/renderer/utils/musicSdk/kw/pic.js b/src/renderer/utils/musicSdk/kw/pic.js index 9f1ea7a1..06a90e6e 100644 --- a/src/renderer/utils/musicSdk/kw/pic.js +++ b/src/renderer/utils/musicSdk/kw/pic.js @@ -2,7 +2,7 @@ import { httpFetch } from '../../request' export default { getPic({ songmid }) { - const requestObj = httpFetch(`http://artistpicserver.kuwo.cn/pic.web?corp=kuwo&type=rid_pic&pictype=500&size=500&rid=${songmid}`) + const requestObj = httpFetch(`http://artistpicserver.kuwo.cn/pic.web?corp=kuwo&type=rid_pic&pictype=500&size=500&rid=${songmid.match(/\d+/g)[0]}`) requestObj.promise = requestObj.promise.then(({ body }) => /^http/.test(body) ? body : null) return requestObj.promise },