diff --git a/CHANGELOG.md b/CHANGELOG.md index b4f4b193..96b65068 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,21 @@ Project versioning adheres to [Semantic Versioning](http://semver.org/). Commit convention is based on [Conventional Commits](http://conventionalcommits.org). Change log format is based on [Keep a Changelog](http://keepachangelog.com/). +## [0.3.5](https://github.com/lyswhut/lx-music-desktop/compare/v0.3.4...v0.3.5) - 2019-08-30 + +### 新增 + +- 新增**测试接口**,该接口同样速度较慢,但软件的大部分功能可用,**请自行切换到该接口**,找接口辛苦,且用且珍惜! + +### 优化 + +- 取消需要刷新URL时windows任务栏进度显示错误状态(现显示为暂停状态) + +### 修复 + +- 修复使用临时接口时在试听列表双击灰色歌曲仍然会进行播放的Bug +- 修复歌词加载Bug + ## [0.3.4](https://github.com/lyswhut/lx-music-desktop/compare/v0.3.3...v0.3.4) - 2019-08-29 ### 优化 diff --git a/README.md b/README.md index ecc429fe..ed5a3e3e 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ npm run pack ### 致谢 -感谢 [@messoer](https://github.com/messoer) 提供的部分音乐API! +感谢 [@messoer](https://github.com/messoer) 曾经提供的部分音乐API! ### 免责声明 diff --git a/package.json b/package.json index 61a58596..ee5b5817 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lx-music-desktop", - "version": "0.3.4", + "version": "0.3.5", "description": "一个免费的音乐下载助手", "main": "./dist/electron/main.js", "productName": "lx-music-desktop", diff --git a/publish/changeLog.md b/publish/changeLog.md index 74853617..21bb85bb 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,7 +1,12 @@ +### 新增 + +- 新增**测试接口**,该接口同样速度较慢,但软件的大部分功能可用,**请自行切换到该接口**,找接口辛苦,且用且珍惜! + ### 优化 -- 减少接口不稳定带来的影响,适当增加请求等待时间 +- 取消需要刷新URL时windows任务栏进度显示错误状态(现显示为暂停状态) ### 修复 -- 修复播放过程中URL过期不会刷新URL的问题 +- 修复使用临时接口时在试听列表双击灰色歌曲仍然会进行播放的Bug +- 修复歌词加载Bug diff --git a/publish/version.json b/publish/version.json index e9986d98..72da7f87 100644 --- a/publish/version.json +++ b/publish/version.json @@ -1,7 +1,11 @@ { - "version": "0.3.4", - "desc": "

优化

\n\n

修复

\n\n", + "version": "0.3.5", + "desc": "

新增

\n\n

优化

\n\n

修复

\n\n", "history": [ + { + "version": "0.3.4", + "desc": "

优化

\n\n

修复

\n\n" + }, { "version": "0.3.3", "desc": "

修复

\n\n" diff --git a/src/renderer/components/core/Player.vue b/src/renderer/components/core/Player.vue index 447297b4..300d3ff9 100644 --- a/src/renderer/components/core/Player.vue +++ b/src/renderer/components/core/Player.vue @@ -195,7 +195,6 @@ export default { if (!this.musicInfo.songmid) return console.log('出错') this.stopPlay() - this.sendProgressEvent(this.progress, 'error') if (this.audio.error.code !== 1 && this.retryNum < 3) { // 若音频URL无效则尝试刷新3次URL // console.log(this.retryNum) this.audioErrorTime = this.audio.currentTime // 记录出错的播放时间 @@ -205,21 +204,7 @@ export default { return } - // let urls = this.player_info.targetSong.urls - // if (urls && urls.some((url, index) => { - // if (this.musicInfo.musicUrl.includes(url)) { - // let newUrl = urls[index + 1] - // if (!newUrl) return false - // this.musicInfo.musicUrl = this.musicInfo.musicUrl.replace(url, newUrl) - // // this.musicInfo.musicUrl = newUrl ? this.musicInfo.musicUrl.replace(url, newUrl) : this.setFormTag(this.musicInfo.musicUrl.replace(url, urls[0])) - // return true - // } - // })) { - // this.audio.src = this.musicInfo.musicUrl - // // console.log(this.musicInfo.musicUrl) - // } else { - // this.handleNext() - // } + this.sendProgressEvent(this.progress, 'error') this.status = '音频加载出错,5 秒后切换下一首' this.addDelayNextTimeout() }) @@ -416,12 +401,12 @@ export default { } }, setLrc(targetSong) { - this.musicInfo.lrc = targetSong.lyric + this.musicInfo.lrc = targetSong.lrc let lrcP = this.musicInfo.lrc ? Promise.resolve() : this.getLrc(targetSong).then(() => { - this.musicInfo.lrc = targetSong.lyric + this.musicInfo.lrc = targetSong.lrc }) lrcP diff --git a/src/renderer/store/modules/player.js b/src/renderer/store/modules/player.js index 258c85a6..994a931c 100644 --- a/src/renderer/store/modules/player.js +++ b/src/renderer/store/modules/player.js @@ -62,7 +62,7 @@ const mutations = { datas.musicInfo.img = datas.url }, setLrc(state, datas) { - datas.musicInfo.lyric = datas.lrc + datas.musicInfo.lrc = datas.lrc }, setList(state, { list, listId, index }) { state.list = list diff --git a/src/renderer/utils/index.js b/src/renderer/utils/index.js index f9e0daa8..d91e2d83 100644 --- a/src/renderer/utils/index.js +++ b/src/renderer/utils/index.js @@ -185,7 +185,7 @@ export const updateSetting = setting => { }, themeId: 0, sourceId: 'kw', - apiSource: 'temp', + apiSource: 'test', randomAnimate: true, ignoreVersion: null, } @@ -202,7 +202,7 @@ export const updateSetting = setting => { objectDeepMerge(defaultSetting, overwriteSetting) setting = defaultSetting } - if (setting.apiSource == 'messoer') setting.apiSource = 'temp' // 强制设置回 temp 接口源 + if (setting.apiSource != 'test') setting.apiSource = 'test' // 强制设置回 test 接口源 return setting } diff --git a/src/renderer/utils/music/api-source.js b/src/renderer/utils/music/api-source.js index 0a41cdcd..3b323b9a 100644 --- a/src/renderer/utils/music/api-source.js +++ b/src/renderer/utils/music/api-source.js @@ -1,26 +1,26 @@ import kw_api_temp from './kw/api-temp' -// import kw_api_messoer from './kw/api-messoer' +import kw_api_test from './kw/api-test' // import tx_api_messoer from './tx/api-messoer' -// import kg_api_messoer from './kg/api-messoer' -// import wy_api_messoer from './wy/api-messoer' -// import bd_api_messoer from './bd/api-messoer' -import kw_api_internal from './kw/api-internal' -import tx_api_internal from './tx/api-internal' -import kg_api_internal from './kg/api-internal' -import wy_api_internal from './wy/api-internal' -import bd_api_internal from './bd/api-internal' +import kg_api_test from './kg/api-test' +import wy_api_test from './wy/api-test' +import bd_api_test from './bd/api-test' +// import kw_api_internal from './kw/api-internal' +// import tx_api_internal from './tx/api-internal' +// import kg_api_internal from './kg/api-internal' +// import wy_api_internal from './wy/api-internal' +// import bd_api_internal from './bd/api-internal' const apis = { - // kw_api_messoer, + kw_api_test, // tx_api_messoer, - // kg_api_messoer, - // wy_api_messoer, - // bd_api_messoer, - kw_api_internal, - tx_api_internal, - kg_api_internal, - wy_api_internal, - bd_api_internal, + kg_api_test, + wy_api_test, + bd_api_test, + // kw_api_internal, + // tx_api_internal, + // kg_api_internal, + // wy_api_internal, + // bd_api_internal, kw_api_temp, } @@ -29,8 +29,8 @@ const getAPI = source => { switch (window.globalObj.apiSource) { // case 'messoer': // return apis[`${source}_api_messoer`] - case 'internal': - return apis[`${source}_api_internal`] + case 'test': + return apis[`${source}_api_test`] case 'temp': return apis[`${source}_api_temp`] } diff --git a/src/renderer/utils/music/bd/api-messoer.js b/src/renderer/utils/music/bd/api-test.js similarity index 67% rename from src/renderer/utils/music/bd/api-messoer.js rename to src/renderer/utils/music/bd/api-test.js index 80609c8b..c9c1be9d 100644 --- a/src/renderer/utils/music/bd/api-messoer.js +++ b/src/renderer/utils/music/bd/api-test.js @@ -1,10 +1,10 @@ import { httpFatch } from '../../request' import { requestMsg } from '../../message' -import { headers, timeout } from '../messoer' +import { headers, timeout } from '../options' -const api_messoer = { +const api_test = { getMusicUrl(songInfo, type) { - const requestObj = httpFatch(`https://v1.itooi.cn/baidu/url?id=${songInfo.songmid}&quality=${type.replace(/k$/, '')}&isRedirect=0`, { + const requestObj = httpFatch(`http://45.32.53.128:3000/baidu/url?id=${songInfo.songmid}&quality=${type.replace(/k$/, '')}`, { method: 'get', timeout, headers, @@ -15,7 +15,7 @@ const api_messoer = { return requestObj }, getPic(songInfo, size = '500') { - const requestObj = httpFatch(`https://v1.itooi.cn/baidu/pic?id=${songInfo.songmid}&imageSize=${size}&isRedirect=0`, { + const requestObj = httpFatch(`http://45.32.53.128:3000/baidu/pic?id=${songInfo.songmid}&imageSize=${size}`, { method: 'get', timeout, headers, @@ -26,7 +26,7 @@ const api_messoer = { return requestObj }, getLyric(songInfo) { - const requestObj = httpFatch(`https://v1.itooi.cn/baidu/lrc?id=${songInfo.songmid}&isRedirect=0`, { + const requestObj = httpFatch(`http://45.32.53.128:3000/baidu/lrc?id=${songInfo.songmid}`, { method: 'get', timeout, headers, @@ -38,4 +38,4 @@ const api_messoer = { }, } -export default api_messoer +export default api_test diff --git a/src/renderer/utils/music/kg/api-messoer.js b/src/renderer/utils/music/kg/api-test.js similarity index 68% rename from src/renderer/utils/music/kg/api-messoer.js rename to src/renderer/utils/music/kg/api-test.js index 2fe074c7..d4b6e55c 100644 --- a/src/renderer/utils/music/kg/api-messoer.js +++ b/src/renderer/utils/music/kg/api-test.js @@ -1,10 +1,10 @@ import { httpFatch } from '../../request' import { requestMsg } from '../../message' -import { headers, timeout } from '../messoer' +import { headers, timeout } from '../options' -const api_messoer = { +const api_test = { getMusicUrl(songInfo, type) { - const requestObj = httpFatch(`https://v1.itooi.cn/kugou/url?id=${songInfo._types[type].hash}&quality=${type.replace(/k$/, '')}&isRedirect=0`, { + const requestObj = httpFatch(`http://45.32.53.128:3000/kugou/url?id=${songInfo._types[type].hash}&quality=${type.replace(/k$/, '')}`, { method: 'get', timeout, headers, @@ -15,7 +15,7 @@ const api_messoer = { return requestObj }, getPic(songInfo) { - const requestObj = httpFatch(`https://v1.itooi.cn/kugou/pic?id=${songInfo.hash}&isRedirect=0`, { + const requestObj = httpFatch(`http://45.32.53.128:3000/kugou/pic?id=${songInfo.hash}`, { method: 'get', timeout, headers, @@ -26,7 +26,7 @@ const api_messoer = { return requestObj }, getLyric(songInfo) { - const requestObj = httpFatch(`https://v1.itooi.cn/kugou/lrc?id=${songInfo.hash}&isRedirect=0`, { + const requestObj = httpFatch(`http://45.32.53.128:3000/kugou/lrc?id=${songInfo.hash}`, { method: 'get', timeout, headers, @@ -38,4 +38,4 @@ const api_messoer = { }, } -export default api_messoer +export default api_test diff --git a/src/renderer/utils/music/kw/api-messoer.js b/src/renderer/utils/music/kw/api-messoer.js deleted file mode 100644 index 6b22eb59..00000000 --- a/src/renderer/utils/music/kw/api-messoer.js +++ /dev/null @@ -1,30 +0,0 @@ -import { httpFatch } from '../../request' -import { requestMsg } from '../../message' -import { headers, timeout } from '../messoer' - -const api_messoer = { - getMusicUrl(songInfo, type) { - const requestObj = httpFatch(`https://v1.itooi.cn/kuwo/url?id=${songInfo.songmid}&quality=${type.replace(/k$/, '')}&isRedirect=0`, { - method: 'get', - timeout, - headers, - }) - requestObj.promise = requestObj.promise.then(({ body }) => { - return body.code === 200 ? Promise.resolve({ type, url: body.data }) : Promise.reject(new Error(requestMsg.fail)) - }) - return requestObj - }, - getPic(songInfo) { - const requestObj = httpFatch(`https://v1.itooi.cn/kuwo/pic?id=${songInfo.songmid}&isRedirect=0`, { - method: 'get', - timeout, - headers, - }) - requestObj.promise = requestObj.promise.then(({ body }) => { - return body.code === 200 ? Promise.resolve(body.data) : Promise.reject(new Error(requestMsg.fail)) - }) - return requestObj - }, -} - -export default api_messoer diff --git a/src/renderer/utils/music/kw/api-test.js b/src/renderer/utils/music/kw/api-test.js new file mode 100644 index 00000000..a49ec881 --- /dev/null +++ b/src/renderer/utils/music/kw/api-test.js @@ -0,0 +1,30 @@ +import { httpFatch } from '../../request' +import { requestMsg } from '../../message' +import { headers, timeout } from '../options' + +const api_test = { + // getMusicUrl(songInfo, type) { + // const requestObj = httpFatch(`http://45.32.53.128:3002/m/kw/u/${songInfo.songmid}/${type}`, { + // method: 'get', + // headers, + // timeout, + // }) + // requestObj.promise = requestObj.promise.then(({ body }) => { + // return body.code === 0 ? Promise.resolve({ type, url: body.data }) : Promise.reject(new Error(body.msg)) + // }) + // return requestObj + // }, + getMusicUrl(songInfo, type) { + const requestObj = httpFatch(`http://45.32.53.128:3000/kuwo/url?id=${songInfo.songmid}&quality=${type.replace(/k$/, '')}`, { + method: 'get', + timeout, + headers, + }) + requestObj.promise = requestObj.promise.then(({ body }) => { + return body.code === 200 ? Promise.resolve({ type, url: body.data }) : Promise.reject(new Error(requestMsg.fail)) + }) + return requestObj + }, +} + +export default api_test diff --git a/src/renderer/utils/music/tx/api-messoer.js b/src/renderer/utils/music/tx/api-test.js similarity index 89% rename from src/renderer/utils/music/tx/api-messoer.js rename to src/renderer/utils/music/tx/api-test.js index 06c7536f..0e9203d4 100644 --- a/src/renderer/utils/music/tx/api-messoer.js +++ b/src/renderer/utils/music/tx/api-test.js @@ -4,7 +4,7 @@ import { headers, timeout } from '../messoer' const api_messoer = { getMusicUrl(songInfo, type) { - const requestObj = httpFatch(`https://v1.itooi.cn/tencent/url?id=${songInfo.strMediaMid}&quality=${type.replace(/k$/, '')}&isRedirect=0`, { + const requestObj = httpFatch(`https://v1.itooi.cn/tencent/url?id=${songInfo.strMediaMid}&quality=${type.replace(/k$/, '')}`, { method: 'get', timeout, headers, diff --git a/src/renderer/utils/music/wy/api-messoer.js b/src/renderer/utils/music/wy/api-test.js similarity index 67% rename from src/renderer/utils/music/wy/api-messoer.js rename to src/renderer/utils/music/wy/api-test.js index 272cc26d..967f895a 100644 --- a/src/renderer/utils/music/wy/api-messoer.js +++ b/src/renderer/utils/music/wy/api-test.js @@ -1,10 +1,10 @@ import { httpFatch } from '../../request' import { requestMsg } from '../../message' -import { headers, timeout } from '../messoer' +import { headers, timeout } from '../options' -const api_messoer = { +const api_test = { getMusicUrl(songInfo, type) { - const requestObj = httpFatch(`https://v1.itooi.cn/netease/url?id=${songInfo.songmid}&quality=${type.replace(/k$/, '')}&isRedirect=0`, { + const requestObj = httpFatch(`http://45.32.53.128:3000/netease/url?id=${songInfo.songmid}&quality=${type.replace(/k$/, '')}`, { method: 'get', timeout, headers, @@ -15,7 +15,7 @@ const api_messoer = { return requestObj }, getPic(songInfo) { - const requestObj = httpFatch(`https://v1.itooi.cn/netease/pic?id=${songInfo.songmid}&isRedirect=0`, { + const requestObj = httpFatch(`http://45.32.53.128:3000/netease/pic?id=${songInfo.songmid}`, { method: 'get', timeout, headers, @@ -26,7 +26,7 @@ const api_messoer = { return requestObj }, getLyric(songInfo) { - const requestObj = httpFatch(`https://v1.itooi.cn/netease/lrc?id=${songInfo.songmid}&isRedirect=0`, { + const requestObj = httpFatch(`http://45.32.53.128:3000/netease/lrc?id=${songInfo.songmid}`, { method: 'get', timeout, headers, @@ -38,4 +38,4 @@ const api_messoer = { }, } -export default api_messoer +export default api_test diff --git a/src/renderer/views/Leaderboard.vue b/src/renderer/views/Leaderboard.vue index ded4d72f..52bce7cb 100644 --- a/src/renderer/views/Leaderboard.vue +++ b/src/renderer/views/Leaderboard.vue @@ -30,7 +30,7 @@ td.break(style="width: 20%;") {{item.singer}} td.break(style="width: 22%;") {{item.albumName}} td(style="width: 18%;") - material-list-buttons(:index="index" :search-btn="true" :play-btn="item.source == 'kw' || !isAPITemp" :download-btn="item.source == 'kw' || !isAPITemp" :remove-btn="false" @btn-click="handleListBtnClick") + material-list-buttons(:index="index" :search-btn="true" :play-btn="item.source == 'kw' || (!isAPITemp && item.source != 'tx')" :download-btn="item.source == 'kw' || (!isAPITemp && item.source != 'tx')" :remove-btn="false" @btn-click="handleListBtnClick") //- button.btn-info(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k'] || item._types.flac" @click.stop='openDownloadModal(index)') 下载 //- button.btn-secondary(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k']" @click.stop='testPlay(index)') 试听 //- button.btn-success(type='button' v-if="(item._types['128k'] || item._types['192k'] || item._types['320k']) && userInfo" @click.stop='showListModal(index)') + @@ -123,7 +123,7 @@ export default { this.clickIndex = index return } - (this.source == 'kw' || !this.isAPITemp) ? this.testPlay(index) : this.handleSearch(index) + (this.source == 'kw' || (!this.isAPITemp && this.list[index].source != 'tx')) ? this.testPlay(index) : this.handleSearch(index) this.clickTime = 0 this.clickIndex = -1 }, diff --git a/src/renderer/views/List.vue b/src/renderer/views/List.vue index 2bba042c..eecb93ed 100644 --- a/src/renderer/views/List.vue +++ b/src/renderer/views/List.vue @@ -18,7 +18,7 @@ table tbody tr(v-for='(item, index) in list' :key='item.songmid' - @click="handleDoubleClick(index)" :class="[isPlayList && playIndex === index ? $style.active : '', isAPITemp && item.source != 'kw' ? $style.disabled : '']") + @click="handleDoubleClick(index)" :class="[isPlayList && playIndex === index ? $style.active : '', (isAPITemp && item.source != 'kw') || item.source == 'tx' ? $style.disabled : '']") td.nobreak.center(style="width: 37px;" @click.stop) material-checkbox(:id="index.toString()" v-model="selectdData" :value="item") td.break(style="width: 25%;") {{item.name}} @@ -137,6 +137,7 @@ export default { this.clickIndex = -1 }, testPlay(index) { + if ((this.isAPITemp && this.list[index].source != 'kw') || this.list[index].source == 'tx') return this.setList({ list: this.list, listId: 'test', index }) }, handleRemove(index) { @@ -146,14 +147,13 @@ export default { switch (info.action) { case 'download': const minfo = this.list[info.index] - if (this.isAPITemp && minfo.source != 'kw') return + if ((this.isAPITemp && minfo.source != 'kw') || minfo.source == 'tx') return this.musicInfo = minfo this.$nextTick(() => { this.isShowDownload = true }) break case 'play': - if (this.isAPITemp && this.list[info.index].source != 'kw') return this.testPlay(info.index) break case 'remove': @@ -173,7 +173,7 @@ export default { this.selectdData = [] }, handleAddDownloadMultiple(type) { - const list = this.setting.apiSource == 'temp' ? this.selectdData.filter(s => s.source == 'kw') : [...this.selectdData] + const list = this.setting.apiSource == 'temp' ? this.selectdData.filter(s => s.source == 'kw') : this.selectdData.filter(s => s.source != 'tx') this.createDownloadMultiple({ list, type }) this.resetSelect() this.isShowDownloadMultiple = false diff --git a/src/renderer/views/Setting.vue b/src/renderer/views/Setting.vue index cb95dca1..1af3dc93 100644 --- a/src/renderer/views/Setting.vue +++ b/src/renderer/views/Setting.vue @@ -93,9 +93,9 @@ div.scroll(:class="$style.setting") strong 使用者 | 承担! p.small - | 本软件的部分接口使用自 https://github.com/messoer ,非常感谢 + | 怀念曾经的 strong @messoer - | ! + | ,非常感谢曾经为本软件提供数据源! p.small 若有问题可 mail to:lyswhut@qq.com 或到 GitHub 提交 issue p.small | 若觉得好用的话可以去 GitHub 点个 @@ -162,17 +162,22 @@ export default { }, ], apiSources: [ - { - id: 'messoer', - // label: '由 messoer 提供的接口(推荐,软件的所有功能都可用)', - label: '由 messoer 提供的接口(该接口已关闭)', - disabled: true, - }, + // { + // id: 'messoer', + // // label: '由 messoer 提供的接口(推荐,软件的所有功能都可用)', + // label: '由 messoer 提供的接口(该接口已关闭)', + // disabled: true, + // }, // { // id: 'internal', // label: '内置接口(只能试听或下载128k音质,该接口支持软件的所有功能)', // disabled: false, // }, + { + id: 'test', + label: '测试接口(软件的大部分功能可用,该接口访问速度较慢,请耐心等待)', + disabled: false, + }, { id: 'temp', label: '临时接口(软件的某些功能不可用,该接口访问速度较慢,请耐心等待)',