diff --git a/publish/changeLog.md b/publish/changeLog.md index d419b5e4..9bd69f57 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,3 +1,3 @@ -### 修复 +### 优化 -- 修复企鹅音乐搜索歌曲没有结果的问题 +- 优化wy源歌单导入匹配 diff --git a/src/renderer/utils/music/wy/songList.js b/src/renderer/utils/music/wy/songList.js index 18b32626..a0fe5ba0 100644 --- a/src/renderer/utils/music/wy/songList.js +++ b/src/renderer/utils/music/wy/songList.js @@ -29,6 +29,7 @@ export default { ], regExps: { listDetailLink: /^.+(?:\?|&)id=(\d+)(?:&.*$|#.*$|$)/, + listDetailLink2: /^.+\/playlist\/(\d+)\/\d+\/.+$/, }, /** * 格式化播放数量 @@ -63,9 +64,14 @@ export default { if (tryNum > 2) return Promise.reject(new Error('try max num')) if ((/[?&:/]/.test(id))) { - if (!this.regExps.listDetailLink.test(id)) id = await this.handleParseId(id) + if (this.regExps.listDetailLink.test(id)) { + id = id.replace(this.regExps.listDetailLink, '$1') + } else if (this.regExps.listDetailLink2.test(id)) { + id = id.replace(this.regExps.listDetailLink2, '$1') + } else { + id = await this.handleParseId(id) + } // console.log(id) - id = id.replace(this.regExps.listDetailLink, '$1') } this._requestObj_listDetail = httpFetch('https://music.163.com/api/linux/forward', {