Merge 370e9458b2 into 15c9207542
This commit is contained in:
commit
b820e24ff3
@ -5,7 +5,7 @@ import { dnsLookup } from '../utils'
|
|||||||
|
|
||||||
const api_temp = {
|
const api_temp = {
|
||||||
getMusicUrl(songInfo, type) {
|
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',
|
method: 'get',
|
||||||
headers,
|
headers,
|
||||||
timeout,
|
timeout,
|
||||||
|
|||||||
@ -16,7 +16,7 @@ const api_test = {
|
|||||||
// return requestObj
|
// return requestObj
|
||||||
// },
|
// },
|
||||||
getMusicUrl(songInfo, type) {
|
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',
|
method: 'get',
|
||||||
timeout,
|
timeout,
|
||||||
headers,
|
headers,
|
||||||
|
|||||||
@ -7,7 +7,7 @@ export default {
|
|||||||
async getComment({ songmid }, page = 1, limit = 20) {
|
async getComment({ songmid }, page = 1, limit = 20) {
|
||||||
if (this._requestObj) this._requestObj.cancelHttp()
|
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: {
|
headers: {
|
||||||
'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 9;)',
|
'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 9;)',
|
||||||
},
|
},
|
||||||
@ -29,7 +29,7 @@ export default {
|
|||||||
async getHotComment({ songmid }, page = 1, limit = 100) {
|
async getHotComment({ songmid }, page = 1, limit = 100) {
|
||||||
if (this._requestObj2) this._requestObj2.cancelHttp()
|
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: {
|
headers: {
|
||||||
'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 9;)',
|
'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 9;)',
|
||||||
},
|
},
|
||||||
|
|||||||
@ -65,7 +65,7 @@ const kw = {
|
|||||||
|
|
||||||
getMusicInfo(songInfo) {
|
getMusicInfo(songInfo) {
|
||||||
if (this._musicInfoRequestObj) this._musicInfoRequestObj.cancelHttp()
|
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 this._musicInfoRequestObj.promise.then(({ body }) => {
|
||||||
return body.code === 200 ? body.data : Promise.reject(new Error(body.msg))
|
return body.code === 200 ? body.data : Promise.reject(new Error(body.msg))
|
||||||
})
|
})
|
||||||
@ -91,7 +91,7 @@ const kw = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getMusicDetailPageUrl(songInfo) {
|
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() {
|
// init() {
|
||||||
|
|||||||
@ -235,7 +235,7 @@ export default {
|
|||||||
// },
|
// },
|
||||||
getLyric(musicInfo, isGetLyricx = true) {
|
getLyric(musicInfo, isGetLyricx = true) {
|
||||||
// this.getLyric2(musicInfo)
|
// 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 }) => {
|
requestObj.promise = requestObj.promise.then(({ statusCode, body, raw }) => {
|
||||||
if (statusCode != 200) return Promise.reject(new Error(JSON.stringify(body)))
|
if (statusCode != 200) return Promise.reject(new Error(JSON.stringify(body)))
|
||||||
return decodeLyric({ lrcBase64: raw.toString('base64'), isGetLyricx }).then(base64Data => {
|
return decodeLyric({ lrcBase64: raw.toString('base64'), isGetLyricx }).then(base64Data => {
|
||||||
|
|||||||
@ -30,7 +30,7 @@ export default {
|
|||||||
// console.log(rawData)
|
// console.log(rawData)
|
||||||
for (let i = 0; i < rawData.length; i++) {
|
for (let i = 0; i < rawData.length; i++) {
|
||||||
const info = rawData[i]
|
const info = rawData[i]
|
||||||
let songId = info.MUSICRID.replace('MUSIC_', '')
|
let songId = info.MUSICRID.match(/\d+/g)[0]
|
||||||
// const format = (info.FORMATS || info.formats).split('|')
|
// const format = (info.FORMATS || info.formats).split('|')
|
||||||
|
|
||||||
if (!info.N_MINFO) {
|
if (!info.N_MINFO) {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { httpFetch } from '../../request'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
getPic({ songmid }) {
|
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)
|
requestObj.promise = requestObj.promise.then(({ body }) => /^http/.test(body) ? body : null)
|
||||||
return requestObj.promise
|
return requestObj.promise
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user