新增各平台通过输入歌单链接或歌单ID打开歌单详情列表
parent
6ea0837cce
commit
c7e95c5166
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
- 新增网易云源歌曲搜索
|
- 新增网易云源歌曲搜索
|
||||||
- 新增网易云源歌单
|
- 新增网易云源歌单
|
||||||
|
- 新增各平台通过输入歌单链接或歌单ID打开歌单详情列表
|
||||||
|
|
||||||
#### 优化
|
#### 优化
|
||||||
|
|
||||||
|
|
|
@ -197,6 +197,13 @@ export default {
|
||||||
limit: this.limit_song,
|
limit: this.limit_song,
|
||||||
total: body.result.song_num,
|
total: body.result.song_num,
|
||||||
source: 'bd',
|
source: 'bd',
|
||||||
|
info: {
|
||||||
|
name: body.result.info.list_title,
|
||||||
|
img: body.result.info.list_pic,
|
||||||
|
desc: body.result.info.list_desc,
|
||||||
|
author: body.result.info.userinfo.username,
|
||||||
|
play_count: this.formatPlayCount(body.result.listen_num),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
@ -35,6 +35,7 @@ export default {
|
||||||
],
|
],
|
||||||
regExps: {
|
regExps: {
|
||||||
listData: /global\.data = (\[.+\]);/,
|
listData: /global\.data = (\[.+\]);/,
|
||||||
|
listInfo: /global = {[\s\S]+?name: "(.+)"[\s\S]+?pic: "(.+)"[\s\S]+?};/,
|
||||||
},
|
},
|
||||||
getInfoUrl(tagId) {
|
getInfoUrl(tagId) {
|
||||||
return tagId
|
return tagId
|
||||||
|
@ -143,13 +144,27 @@ export default {
|
||||||
this._requestObj_listDetail = httpFetch(this.getSongListDetailUrl(id))
|
this._requestObj_listDetail = httpFetch(this.getSongListDetailUrl(id))
|
||||||
return this._requestObj_listDetail.promise.then(({ body }) => {
|
return this._requestObj_listDetail.promise.then(({ body }) => {
|
||||||
let listData = body.match(this.regExps.listData)
|
let listData = body.match(this.regExps.listData)
|
||||||
if (listData) listData = this.filterData(JSON.parse(RegExp.$1))
|
let listInfo = body.match(this.regExps.listInfo)
|
||||||
|
if (listData) listData = this.filterData(JSON.parse(listData[1]))
|
||||||
|
let name
|
||||||
|
let pic
|
||||||
|
if (listInfo) {
|
||||||
|
name = listInfo[1]
|
||||||
|
pic = listInfo[2]
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
list: listData,
|
list: listData,
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 10000,
|
limit: 10000,
|
||||||
total: listData.length,
|
total: listData.length,
|
||||||
source: 'kg',
|
source: 'kg',
|
||||||
|
info: {
|
||||||
|
name,
|
||||||
|
img: pic,
|
||||||
|
// desc: body.result.info.list_desc,
|
||||||
|
// author: body.result.info.userinfo.username,
|
||||||
|
// play_count: this.formatPlayCount(body.result.listen_num),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
@ -166,6 +166,13 @@ export default {
|
||||||
limit: body.rn,
|
limit: body.rn,
|
||||||
total: body.total,
|
total: body.total,
|
||||||
source: 'kw',
|
source: 'kw',
|
||||||
|
info: {
|
||||||
|
name: body.title,
|
||||||
|
img: body.pic,
|
||||||
|
desc: body.info,
|
||||||
|
author: body.uname,
|
||||||
|
play_count: this.formatPlayCount(body.playnum),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
@ -60,12 +60,20 @@ export default {
|
||||||
this._requestObj_listDetail = httpFetch(this.getSongListDetailUrl(id, page), { headers: this.defaultHeaders })
|
this._requestObj_listDetail = httpFetch(this.getSongListDetailUrl(id, page), { headers: this.defaultHeaders })
|
||||||
return this._requestObj_listDetail.promise.then(({ body }) => {
|
return this._requestObj_listDetail.promise.then(({ body }) => {
|
||||||
if (body.code !== this.successCode) return this.getListDetail(id, page)
|
if (body.code !== this.successCode) return this.getListDetail(id, page)
|
||||||
|
// console.log(JSON.stringify(body))
|
||||||
return {
|
return {
|
||||||
list: this.filterListDetail(body.list),
|
list: this.filterListDetail(body.list),
|
||||||
page,
|
page,
|
||||||
limit: this.limit_song,
|
limit: this.limit_song,
|
||||||
total: body.totalCount,
|
total: body.totalCount,
|
||||||
source: 'mg',
|
source: 'mg',
|
||||||
|
info: {
|
||||||
|
// name: body.result.info.list_title,
|
||||||
|
// img: body.result.info.list_pic,
|
||||||
|
// desc: body.result.info.list_desc,
|
||||||
|
// author: body.result.info.userinfo.username,
|
||||||
|
// play_count: this.formatPlayCount(body.result.listen_num),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
@ -75,7 +75,11 @@ export default {
|
||||||
list = this.source ? [...this.sourceInfo.sortList[this.source]] : []
|
list = this.source ? [...this.sourceInfo.sortList[this.source]] : []
|
||||||
switch (this.source) {
|
switch (this.source) {
|
||||||
case 'wy':
|
case 'wy':
|
||||||
|
case 'kw':
|
||||||
|
case 'bd':
|
||||||
case 'tx':
|
case 'tx':
|
||||||
|
case 'mg':
|
||||||
|
case 'kg':
|
||||||
list.push({
|
list.push({
|
||||||
name: `打开${this.sourceInfo.sources.find(s => s.id == this.source).name}歌单`,
|
name: `打开${this.sourceInfo.sources.find(s => s.id == this.source).name}歌单`,
|
||||||
id: 'importSongList',
|
id: 'importSongList',
|
||||||
|
@ -303,19 +307,34 @@ export default {
|
||||||
},
|
},
|
||||||
handleParseImportSongListInputText() {
|
handleParseImportSongListInputText() {
|
||||||
if (!/[?&:/]/.test(this.importSongListText)) return
|
if (!/[?&:/]/.test(this.importSongListText)) return
|
||||||
let id
|
let regx
|
||||||
switch (this.source) {
|
switch (this.source) {
|
||||||
case 'wy':
|
case 'wy':
|
||||||
id = this.importSongListText.replace(/^.+(?:\?|&)id=(\d+)(?:&.*$|#.*$|$)/, '$1')
|
regx = /^.+(?:\?|&)id=(\d+)(?:&.*$|#.*$|$)/
|
||||||
break
|
break
|
||||||
case 'tx':
|
case 'tx':
|
||||||
// https://y.qq.com/n/yqq/playsquare/4385581243.html#stat=y_new.index.playlist.pic
|
regx = /^.+\/(\d+)\.html(?:\?.*|&.*$|#.*$|$)/
|
||||||
id = this.importSongListText.replace(/^.+\/(\d+)\.html(?:&.*$|#.*$|$)/, '$1')
|
break
|
||||||
|
case 'kw':
|
||||||
|
// http://www.kuwo.cn/playlist_detail/2886046289
|
||||||
|
regx = /^.+\/playlist_detail\/(\d+)(?:\?.*|&.*$|#.*$|$)/
|
||||||
|
break
|
||||||
|
case 'bd':
|
||||||
|
// http://music.taihe.com/songlist/566347741
|
||||||
|
regx = /^.+\/songlist\/(\d+)(?:\?.*|&.*$|#.*$|$)/
|
||||||
|
break
|
||||||
|
case 'mg':
|
||||||
|
// http://music.migu.cn/v3/music/playlist/161044573?page=1
|
||||||
|
regx = /^.+\/playlist\/(\d+)(?:\?.*|&.*$|#.*$|$)/
|
||||||
|
break
|
||||||
|
case 'kg':
|
||||||
|
// https://www.kugou.com/yy/special/single/1067062.html
|
||||||
|
regx = /^.+\/(\d+)\.html(?:\?.*|&.*$|#.*$|$)/
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.importSongListText = id
|
this.importSongListText = this.importSongListText.replace(regx, '$1')
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue