修复企鹅音乐搜索失效的问题
parent
85c5595f43
commit
251450fd50
|
@ -8,7 +8,10 @@
|
||||||
"@lyric/*": ["src/renderer-lyric/*"],
|
"@lyric/*": ["src/renderer-lyric/*"],
|
||||||
"@static/*": ["src/static/*"],
|
"@static/*": ["src/static/*"],
|
||||||
"@common/*": ["src/common/*"],
|
"@common/*": ["src/common/*"],
|
||||||
}
|
},
|
||||||
|
},
|
||||||
|
"vueCompilerOptions": {
|
||||||
|
"experimentalDisableTemplateSupport": true
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules", "build", "dist"]
|
"exclude": ["node_modules", "build", "dist"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
- 修复无法批量排序歌曲的问题
|
- 修复无法批量排序歌曲的问题
|
||||||
- 修复某些缺失的繁体中文翻译
|
- 修复某些缺失的繁体中文翻译
|
||||||
|
- 修复企鹅音乐搜索失效的问题
|
||||||
|
|
||||||
### 其他
|
### 其他
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,12 @@ export default {
|
||||||
size: null,
|
size: null,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (formats.includes('HIRFLAC')) {
|
||||||
|
types.push({ type: 'flac32bit', size: null })
|
||||||
|
_types.flac32bit = {
|
||||||
|
size: null,
|
||||||
|
}
|
||||||
|
}
|
||||||
// types.reverse()
|
// types.reverse()
|
||||||
return {
|
return {
|
||||||
singer: formatSinger(decodeName(item.artist)),
|
singer: formatSinger(decodeName(item.artist)),
|
||||||
|
|
|
@ -115,6 +115,12 @@ export default {
|
||||||
size: null,
|
size: null,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (formats.includes('HIRFLAC')) {
|
||||||
|
types.push({ type: 'flac32bit', size: null })
|
||||||
|
_types.flac32bit = {
|
||||||
|
size: null,
|
||||||
|
}
|
||||||
|
}
|
||||||
// types.reverse()
|
// types.reverse()
|
||||||
return {
|
return {
|
||||||
singer: formatSinger(decodeName(item.artist)),
|
singer: formatSinger(decodeName(item.artist)),
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { formatSinger } from './util'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
regExps: {
|
regExps: {
|
||||||
mInfo: /bitrate:(\d+),format:(\w+),size:([\w.]+)/,
|
mInfo: /level:(\w+),bitrate:(\d+),format:(\w+),size:([\w.]+)/,
|
||||||
},
|
},
|
||||||
limit: 30,
|
limit: 30,
|
||||||
total: 0,
|
total: 0,
|
||||||
|
@ -27,61 +27,53 @@ export default {
|
||||||
handleResult(rawData) {
|
handleResult(rawData) {
|
||||||
const result = []
|
const result = []
|
||||||
if (!rawData) return result
|
if (!rawData) return result
|
||||||
|
// 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.replace('MUSIC_', '')
|
||||||
// const format = (info.FORMATS || info.formats).split('|')
|
// const format = (info.FORMATS || info.formats).split('|')
|
||||||
|
|
||||||
if (!info.MINFO) {
|
if (!info.N_MINFO) {
|
||||||
console.log('mInfo is undefined')
|
console.log('N_MINFO is undefined')
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
const types = []
|
const types = []
|
||||||
const _types = {}
|
const _types = {}
|
||||||
|
|
||||||
let infoArr = info.MINFO.split(';')
|
let infoArr = info.N_MINFO.split(';')
|
||||||
infoArr.forEach(info => {
|
for (let info of infoArr) {
|
||||||
info = info.match(this.regExps.mInfo)
|
info = info.match(this.regExps.mInfo)
|
||||||
if (info) {
|
if (info) {
|
||||||
switch (info[2]) {
|
switch (info[2]) {
|
||||||
case 'flac':
|
case '4000':
|
||||||
types.push({ type: 'flac', size: info[3] })
|
types.push({ type: 'flac32bit', size: info[4] })
|
||||||
_types.flac = {
|
_types.flac32bit = {
|
||||||
size: info[3].toLocaleUpperCase(),
|
size: info[4].toLocaleUpperCase(),
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
// case 'ape':
|
case '2000':
|
||||||
// types.push({ type: 'ape', size: info[3] })
|
types.push({ type: 'flac', size: info[4] })
|
||||||
// _types.ape = {
|
_types.flac = {
|
||||||
// size: info[3].toLocaleUpperCase(),
|
size: info[4].toLocaleUpperCase(),
|
||||||
// }
|
}
|
||||||
// break
|
break
|
||||||
case 'mp3':
|
case '320':
|
||||||
switch (info[1]) {
|
types.push({ type: '320k', size: info[4] })
|
||||||
case '320':
|
_types['320k'] = {
|
||||||
types.push({ type: '320k', size: info[3] })
|
size: info[4].toLocaleUpperCase(),
|
||||||
_types['320k'] = {
|
}
|
||||||
size: info[3].toLocaleUpperCase(),
|
break
|
||||||
}
|
case '192':
|
||||||
break
|
case '128':
|
||||||
case '192':
|
types.push({ type: '128k', size: info[4] })
|
||||||
// types.push({ type: '192k', size: info[3] })
|
_types['128k'] = {
|
||||||
// _types['192k'] = {
|
size: info[4].toLocaleUpperCase(),
|
||||||
// size: info[3].toLocaleUpperCase(),
|
|
||||||
// }
|
|
||||||
// break
|
|
||||||
case '128':
|
|
||||||
types.push({ type: '128k', size: info[3] })
|
|
||||||
_types['128k'] = {
|
|
||||||
size: info[3].toLocaleUpperCase(),
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
types.reverse()
|
types.reverse()
|
||||||
|
|
||||||
let interval = parseInt(info.DURATION)
|
let interval = parseInt(info.DURATION)
|
||||||
|
@ -105,6 +97,7 @@ export default {
|
||||||
typeUrl: {},
|
typeUrl: {},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// console.log(result)
|
||||||
return result
|
return result
|
||||||
},
|
},
|
||||||
search(str, page = 1, { limit } = {}, retryNum = 0) {
|
search(str, page = 1, { limit } = {}, retryNum = 0) {
|
||||||
|
|
|
@ -21,7 +21,7 @@ export default {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
regExps: {
|
regExps: {
|
||||||
mInfo: /bitrate:(\d+),format:(\w+),size:([\w.]+)/,
|
mInfo: /level:(\w+),bitrate:(\d+),format:(\w+),size:([\w.]+)/,
|
||||||
// http://www.kuwo.cn/playlist_detail/2886046289
|
// http://www.kuwo.cn/playlist_detail/2886046289
|
||||||
// https://m.kuwo.cn/h5app/playlist/2736267853?t=qqfriend
|
// https://m.kuwo.cn/h5app/playlist/2736267853?t=qqfriend
|
||||||
listDetailLink: /^.+\/playlist(?:_detail)?\/(\d+)(?:\?.*|&.*$|#.*$|$)/,
|
listDetailLink: /^.+\/playlist(?:_detail)?\/(\d+)(?:\?.*|&.*$|#.*$|$)/,
|
||||||
|
@ -244,34 +244,36 @@ export default {
|
||||||
filterListDetail(rawData) {
|
filterListDetail(rawData) {
|
||||||
// console.log(rawData)
|
// console.log(rawData)
|
||||||
return rawData.map(item => {
|
return rawData.map(item => {
|
||||||
let infoArr = item.MINFO.split(';')
|
let infoArr = item.N_MINFO.split(';')
|
||||||
let types = []
|
let types = []
|
||||||
let _types = {}
|
let _types = {}
|
||||||
for (let info of infoArr) {
|
for (let info of infoArr) {
|
||||||
info = info.match(this.regExps.mInfo)
|
info = info.match(this.regExps.mInfo)
|
||||||
if (info) {
|
if (info) {
|
||||||
switch (info[2]) {
|
switch (info[2]) {
|
||||||
case 'flac':
|
case '4000':
|
||||||
types.push({ type: 'flac', size: info[3] })
|
types.push({ type: 'flac32bit', size: info[4] })
|
||||||
_types.flac = {
|
_types.flac32bit = {
|
||||||
size: info[3].toLocaleUpperCase(),
|
size: info[4].toLocaleUpperCase(),
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'mp3':
|
case '2000':
|
||||||
switch (info[1]) {
|
types.push({ type: 'flac', size: info[4] })
|
||||||
case '320':
|
_types.flac = {
|
||||||
types.push({ type: '320k', size: info[3] })
|
size: info[4].toLocaleUpperCase(),
|
||||||
_types['320k'] = {
|
}
|
||||||
size: info[3].toLocaleUpperCase(),
|
break
|
||||||
}
|
case '320':
|
||||||
break
|
types.push({ type: '320k', size: info[4] })
|
||||||
case '192':
|
_types['320k'] = {
|
||||||
case '128':
|
size: info[4].toLocaleUpperCase(),
|
||||||
types.push({ type: '128k', size: info[3] })
|
}
|
||||||
_types['128k'] = {
|
break
|
||||||
size: info[3].toLocaleUpperCase(),
|
case '192':
|
||||||
}
|
case '128':
|
||||||
break
|
types.push({ type: '128k', size: info[4] })
|
||||||
|
_types['128k'] = {
|
||||||
|
size: info[4].toLocaleUpperCase(),
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,22 +62,31 @@ export default {
|
||||||
bangid: 128,
|
bangid: 128,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
getUrl(id, period, limit) {
|
listDetailRequest(id, period, limit) {
|
||||||
return `https://u.y.qq.com/cgi-bin/musicu.fcg?format=json&inCharset=utf8&outCharset=utf-8&platform=yqq.json&needNewCode=0&data=${encodeURIComponent(JSON.stringify({
|
// console.log(id, period, limit)
|
||||||
comm: {
|
return httpFetch('https://u.y.qq.com/cgi-bin/musicu.fcg', {
|
||||||
cv: 1602,
|
method: 'post',
|
||||||
ct: 20,
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)',
|
||||||
},
|
},
|
||||||
toplist: {
|
body: {
|
||||||
module: 'musicToplist.ToplistInfoServer',
|
toplist: {
|
||||||
method: 'GetDetail',
|
module: 'musicToplist.ToplistInfoServer',
|
||||||
param: {
|
method: 'GetDetail',
|
||||||
topid: id,
|
param: {
|
||||||
num: limit,
|
topid: id,
|
||||||
period,
|
num: limit,
|
||||||
|
period,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
comm: {
|
||||||
|
uin: 0,
|
||||||
|
format: 'json',
|
||||||
|
ct: 20,
|
||||||
|
cv: 1859,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}))}`
|
}).promise
|
||||||
},
|
},
|
||||||
regExps: {
|
regExps: {
|
||||||
periodList: /<i class="play_cover__btn c_tx_link js_icon_play" data-listkey=".+?" data-listname=".+?" data-tid=".+?" data-date=".+?" .+?<\/i>/g,
|
periodList: /<i class="play_cover__btn c_tx_link js_icon_play" data-listkey=".+?" data-listname=".+?" data-tid=".+?" data-date=".+?" .+?<\/i>/g,
|
||||||
|
@ -121,13 +130,6 @@ export default {
|
||||||
size,
|
size,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item.file.size_ape !== 0) {
|
|
||||||
let size = sizeFormate(item.file.size_ape)
|
|
||||||
types.push({ type: 'ape', size })
|
|
||||||
_types.ape = {
|
|
||||||
size,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (item.file.size_flac !== 0) {
|
if (item.file.size_flac !== 0) {
|
||||||
let size = sizeFormate(item.file.size_flac)
|
let size = sizeFormate(item.file.size_flac)
|
||||||
types.push({ type: 'flac', size })
|
types.push({ type: 'flac', size })
|
||||||
|
@ -135,6 +137,13 @@ export default {
|
||||||
size,
|
size,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (item.file.size_hires !== 0) {
|
||||||
|
let size = sizeFormate(item.file.size_hires)
|
||||||
|
types.push({ type: 'flac32bit', size })
|
||||||
|
_types.flac32bit = {
|
||||||
|
size,
|
||||||
|
}
|
||||||
|
}
|
||||||
// types.reverse()
|
// types.reverse()
|
||||||
return {
|
return {
|
||||||
singer: this.getSinger(item.singer),
|
singer: this.getSinger(item.singer),
|
||||||
|
@ -223,7 +232,7 @@ export default {
|
||||||
let info = this.periods[bangid]
|
let info = this.periods[bangid]
|
||||||
let p = info ? Promise.resolve(info.period) : this.getPeriods(bangid)
|
let p = info ? Promise.resolve(info.period) : this.getPeriods(bangid)
|
||||||
return p.then(period => {
|
return p.then(period => {
|
||||||
return this.getData(this.getUrl(bangid, period, this.limit)).then(resp => {
|
return this.listDetailRequest(bangid, period, this.limit).then(resp => {
|
||||||
if (resp.body.code !== 0) return this.getList(bangid, page, retryNum)
|
if (resp.body.code !== 0) return this.getList(bangid, page, retryNum)
|
||||||
return {
|
return {
|
||||||
total: resp.body.toplist.data.songInfoList.length,
|
total: resp.body.toplist.data.songInfoList.length,
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { formatPlayTime, sizeFormate } from '../../index'
|
||||||
// import { formatSinger } from './util'
|
// import { formatSinger } from './util'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
limit: 30,
|
limit: 50,
|
||||||
total: 0,
|
total: 0,
|
||||||
page: 0,
|
page: 0,
|
||||||
allPage: 1,
|
allPage: 1,
|
||||||
|
@ -14,11 +14,35 @@ export default {
|
||||||
musicSearch(str, page, limit, retryNum = 0) {
|
musicSearch(str, page, limit, retryNum = 0) {
|
||||||
if (retryNum > 5) return Promise.reject(new Error('搜索失败'))
|
if (retryNum > 5) return Promise.reject(new Error('搜索失败'))
|
||||||
// searchRequest = httpFetch(`https://c.y.qq.com/soso/fcgi-bin/client_search_cp?ct=24&qqmusic_ver=1298&new_json=1&remoteplace=sizer.yqq.song_next&searchid=49252838123499591&t=0&aggr=1&cr=1&catZhida=1&lossless=0&flag_qc=0&p=${page}&n=${limit}&w=${encodeURIComponent(str)}&loginUin=0&hostUin=0&format=json&inCharset=utf8&outCharset=utf-8¬ice=0&platform=yqq&needNewCode=0`)
|
// searchRequest = httpFetch(`https://c.y.qq.com/soso/fcgi-bin/client_search_cp?ct=24&qqmusic_ver=1298&new_json=1&remoteplace=sizer.yqq.song_next&searchid=49252838123499591&t=0&aggr=1&cr=1&catZhida=1&lossless=0&flag_qc=0&p=${page}&n=${limit}&w=${encodeURIComponent(str)}&loginUin=0&hostUin=0&format=json&inCharset=utf8&outCharset=utf-8¬ice=0&platform=yqq&needNewCode=0`)
|
||||||
const searchRequest = httpFetch(`https://shc.y.qq.com/soso/fcgi-bin/client_search_cp?ct=24&qqmusic_ver=1298&remoteplace=txt.yqq.top&aggr=1&cr=1&catZhida=1&lossless=0&flag_qc=0&p=${page}&n=${limit}&w=${encodeURIComponent(str)}&cv=4747474&ct=24&format=json&inCharset=utf-8&outCharset=utf-8¬ice=0&platform=yqq.json&needNewCode=0&uin=0&hostUin=0&loginUin=0`)
|
// const searchRequest = httpFetch(`https://shc.y.qq.com/soso/fcgi-bin/client_search_cp?ct=24&qqmusic_ver=1298&remoteplace=txt.yqq.top&aggr=1&cr=1&catZhida=1&lossless=0&flag_qc=0&p=${page}&n=${limit}&w=${encodeURIComponent(str)}&cv=4747474&ct=24&format=json&inCharset=utf-8&outCharset=utf-8¬ice=0&platform=yqq.json&needNewCode=0&uin=0&hostUin=0&loginUin=0`)
|
||||||
|
const searchRequest = httpFetch('https://u.y.qq.com/cgi-bin/musicu.fcg', {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)',
|
||||||
|
},
|
||||||
|
body: {
|
||||||
|
comm: {
|
||||||
|
ct: '19',
|
||||||
|
cv: '1859',
|
||||||
|
uin: '0',
|
||||||
|
},
|
||||||
|
req: {
|
||||||
|
method: 'DoSearchForQQMusicDesktop',
|
||||||
|
module: 'music.search.SearchCgiService',
|
||||||
|
param: {
|
||||||
|
grp: 1,
|
||||||
|
num_per_page: limit,
|
||||||
|
page_num: page,
|
||||||
|
query: str,
|
||||||
|
search_type: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
// searchRequest = httpFetch(`http://ioscdn.kugou.com/api/v3/search/song?keyword=${encodeURIComponent(str)}&page=${page}&pagesize=${this.limit}&showtype=10&plat=2&version=7910&tag=1&correct=1&privilege=1&sver=5`)
|
// searchRequest = httpFetch(`http://ioscdn.kugou.com/api/v3/search/song?keyword=${encodeURIComponent(str)}&page=${page}&pagesize=${this.limit}&showtype=10&plat=2&version=7910&tag=1&correct=1&privilege=1&sver=5`)
|
||||||
return searchRequest.promise.then(({ body }) => {
|
return searchRequest.promise.then(({ body }) => {
|
||||||
if (body.code !== this.successCode) return this.musicSearch(str, page, limit, ++retryNum)
|
if (body.code != this.successCode || body.req.code != this.successCode) return this.musicSearch(str, page, limit, ++retryNum)
|
||||||
return body.data
|
return body.req.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getSinger(singers) {
|
getSinger(singers) {
|
||||||
|
@ -32,69 +56,75 @@ export default {
|
||||||
// console.log(rawList)
|
// console.log(rawList)
|
||||||
const list = []
|
const list = []
|
||||||
rawList.forEach(item => {
|
rawList.forEach(item => {
|
||||||
if (!item.strMediaMid) return
|
if (!item.file?.media_mid) return
|
||||||
|
|
||||||
let types = []
|
let types = []
|
||||||
let _types = {}
|
let _types = {}
|
||||||
if (item.size128 !== 0) {
|
const file = item.file
|
||||||
let size = sizeFormate(item.size128)
|
if (file.size_128mp3 != 0) {
|
||||||
|
let size = sizeFormate(file.size_128mp3)
|
||||||
types.push({ type: '128k', size })
|
types.push({ type: '128k', size })
|
||||||
_types['128k'] = {
|
_types['128k'] = {
|
||||||
size,
|
size,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item.size320 !== 0) {
|
if (file.size_320mp3 !== 0) {
|
||||||
let size = sizeFormate(item.size320)
|
let size = sizeFormate(file.size_320mp3)
|
||||||
types.push({ type: '320k', size })
|
types.push({ type: '320k', size })
|
||||||
_types['320k'] = {
|
_types['320k'] = {
|
||||||
size,
|
size,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item.sizeape !== 0) {
|
if (file.size_flac !== 0) {
|
||||||
let size = sizeFormate(item.sizeape)
|
let size = sizeFormate(file.size_flac)
|
||||||
types.push({ type: 'ape', size })
|
|
||||||
_types.ape = {
|
|
||||||
size,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (item.sizeflac !== 0) {
|
|
||||||
let size = sizeFormate(item.sizeflac)
|
|
||||||
types.push({ type: 'flac', size })
|
types.push({ type: 'flac', size })
|
||||||
_types.flac = {
|
_types.flac = {
|
||||||
size,
|
size,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (file.size_hires !== 0) {
|
||||||
|
let size = sizeFormate(file.size_hires)
|
||||||
|
types.push({ type: 'flac32bit', size })
|
||||||
|
_types.flac32bit = {
|
||||||
|
size,
|
||||||
|
}
|
||||||
|
}
|
||||||
// types.reverse()
|
// types.reverse()
|
||||||
|
let albumId = ''
|
||||||
|
let albumName = ''
|
||||||
|
if (item.album) {
|
||||||
|
albumName = item.album.title
|
||||||
|
albumId = item.album.mid
|
||||||
|
}
|
||||||
list.push({
|
list.push({
|
||||||
singer: this.getSinger(item.singer),
|
singer: this.getSinger(item.singer),
|
||||||
name: item.songname,
|
name: item.title,
|
||||||
albumName: item.albumname,
|
albumName,
|
||||||
albumId: item.albummid,
|
albumId,
|
||||||
source: 'tx',
|
source: 'tx',
|
||||||
interval: formatPlayTime(item.interval),
|
interval: formatPlayTime(item.interval),
|
||||||
songId: item.songid,
|
songId: item.id,
|
||||||
albumMid: item.albummid,
|
albumMid: item.album?.mid ?? '',
|
||||||
strMediaMid: item.strMediaMid,
|
strMediaMid: item.file.media_mid,
|
||||||
songmid: item.songmid,
|
songmid: item.mid,
|
||||||
img: (item.albummid === '' || item.albummid === '空')
|
img: (albumId === '' || albumId === '空')
|
||||||
? `https://y.gtimg.cn/music/photo_new/T001R500x500M000${item.singer[0]?.mid}.jpg`
|
? `https://y.gtimg.cn/music/photo_new/T001R500x500M000${item.singer[0]?.mid}.jpg`
|
||||||
: `https://y.gtimg.cn/music/photo_new/T002R500x500M000${item.albummid}.jpg`,
|
: `https://y.gtimg.cn/music/photo_new/T002R500x500M000${albumId}.jpg`,
|
||||||
lrc: null,
|
|
||||||
otherSource: null,
|
|
||||||
types,
|
types,
|
||||||
_types,
|
_types,
|
||||||
typeUrl: {},
|
typeUrl: {},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
// console.log(list)
|
||||||
return list
|
return list
|
||||||
},
|
},
|
||||||
search(str, page = 1, { limit } = {}) {
|
search(str, page = 1, { limit } = {}) {
|
||||||
if (limit == null) limit = this.limit
|
if (limit == null) limit = this.limit
|
||||||
// http://newlyric.kuwo.cn/newlyric.lrc?62355680
|
// http://newlyric.kuwo.cn/newlyric.lrc?62355680
|
||||||
return this.musicSearch(str, page, limit).then(({ song }) => {
|
return this.musicSearch(str, page, limit).then(({ body, meta }) => {
|
||||||
let list = this.handleResult(song.list)
|
let list = this.handleResult(body.song.list)
|
||||||
|
|
||||||
this.total = song.totalnum
|
this.total = meta.sum
|
||||||
this.page = page
|
this.page = page
|
||||||
this.allPage = Math.ceil(this.total / limit)
|
this.allPage = Math.ceil(this.total / limit)
|
||||||
|
|
||||||
|
|
|
@ -253,13 +253,6 @@ export default {
|
||||||
size,
|
size,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item.file.size_ape !== 0) {
|
|
||||||
let size = sizeFormate(item.file.size_ape)
|
|
||||||
types.push({ type: 'ape', size })
|
|
||||||
_types.ape = {
|
|
||||||
size,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (item.file.size_flac !== 0) {
|
if (item.file.size_flac !== 0) {
|
||||||
let size = sizeFormate(item.file.size_flac)
|
let size = sizeFormate(item.file.size_flac)
|
||||||
types.push({ type: 'flac', size })
|
types.push({ type: 'flac', size })
|
||||||
|
@ -267,6 +260,13 @@ export default {
|
||||||
size,
|
size,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (item.file.size_hires !== 0) {
|
||||||
|
let size = sizeFormate(item.file.size_hires)
|
||||||
|
types.push({ type: 'flac32bit', size })
|
||||||
|
_types.flac32bit = {
|
||||||
|
size,
|
||||||
|
}
|
||||||
|
}
|
||||||
// types.reverse()
|
// types.reverse()
|
||||||
return {
|
return {
|
||||||
singer: this.getSinger(item.singer),
|
singer: this.getSinger(item.singer),
|
||||||
|
|
|
@ -24,7 +24,7 @@ export default {
|
||||||
|
|
||||||
switch (privilege.maxbr) {
|
switch (privilege.maxbr) {
|
||||||
case 999000:
|
case 999000:
|
||||||
size = null
|
size = item.sq ? sizeFormate(item.sq.size) : null
|
||||||
types.push({ type: 'flac', size })
|
types.push({ type: 'flac', size })
|
||||||
_types.flac = {
|
_types.flac = {
|
||||||
size,
|
size,
|
||||||
|
@ -62,6 +62,7 @@ export default {
|
||||||
typeUrl: {},
|
typeUrl: {},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
// console.log(list)
|
||||||
return list
|
return list
|
||||||
},
|
},
|
||||||
async getList(ids = [], retryNum = 0) {
|
async getList(ids = [], retryNum = 0) {
|
||||||
|
|
|
@ -35,7 +35,7 @@ export default {
|
||||||
let size
|
let size
|
||||||
switch (item.privilege.maxbr) {
|
switch (item.privilege.maxbr) {
|
||||||
case 999000:
|
case 999000:
|
||||||
size = null
|
size = item.sq ? sizeFormate(item.sq.size) : null
|
||||||
types.push({ type: 'flac', size })
|
types.push({ type: 'flac', size })
|
||||||
_types.flac = {
|
_types.flac = {
|
||||||
size,
|
size,
|
||||||
|
@ -80,6 +80,7 @@ export default {
|
||||||
// console.log(result)
|
// console.log(result)
|
||||||
if (!result || result.code !== 200) return this.search(str, page, { limit }, retryNum)
|
if (!result || result.code !== 200) return this.search(str, page, { limit }, retryNum)
|
||||||
let list = this.handleResult(result.result.songs || [])
|
let list = this.handleResult(result.result.songs || [])
|
||||||
|
// console.log(list)
|
||||||
|
|
||||||
if (list == null) return this.search(str, page, { limit }, retryNum)
|
if (list == null) return this.search(str, page, { limit }, retryNum)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue