commit
37944837ca
@ -16,6 +16,7 @@
|
|||||||
- 修复播放某些在线音频会没有声音的问题
|
- 修复播放某些在线音频会没有声音的问题
|
||||||
- 修复改变播放速率时会导致歌词报错的问题
|
- 修复改变播放速率时会导致歌词报错的问题
|
||||||
- 修复tx热门评论昵称被错误切割的问题 (#1397, By: @helloplhm-qwq, @Folltoshe)
|
- 修复tx热门评论昵称被错误切割的问题 (#1397, By: @helloplhm-qwq, @Folltoshe)
|
||||||
|
- 修复wy源热搜词失效的问题(#1401, @Folltoshe)
|
||||||
- 修复Deepin 20下启用桌面歌词时可能会导致桌面卡死的问题(#1288)
|
- 修复Deepin 20下启用桌面歌词时可能会导致桌面卡死的问题(#1288)
|
||||||
|
|
||||||
### 其他
|
### 其他
|
||||||
|
|||||||
@ -75,7 +75,7 @@ const defaultSetting: LX.AppSetting = {
|
|||||||
'desktopLyric.height': 300,
|
'desktopLyric.height': 300,
|
||||||
'desktopLyric.x': null,
|
'desktopLyric.x': null,
|
||||||
'desktopLyric.y': null,
|
'desktopLyric.y': null,
|
||||||
'desktopLyric.isLockScreen': true,
|
'desktopLyric.isLockScreen': isWin,
|
||||||
'desktopLyric.isDelayScroll': true,
|
'desktopLyric.isDelayScroll': true,
|
||||||
'desktopLyric.scrollAlign': 'center',
|
'desktopLyric.scrollAlign': 'center',
|
||||||
'desktopLyric.isHoverHide': false,
|
'desktopLyric.isHoverHide': false,
|
||||||
|
|||||||
@ -10,7 +10,7 @@ export default {
|
|||||||
|
|
||||||
let timestamp = Date.now()
|
let timestamp = Date.now()
|
||||||
const params = `appid=1005&clienttime=${timestamp}&clienttoken=0&clientver=11409&code=fc4be23b4e972707f36b8a828a93ba8a&dfid=0&extdata=${hash}&kugouid=0&mid=16249512204336365674023395779019&mixsongid=0&p=${page}&pagesize=${limit}&uuid=0&ver=10`
|
const params = `appid=1005&clienttime=${timestamp}&clienttoken=0&clientver=11409&code=fc4be23b4e972707f36b8a828a93ba8a&dfid=0&extdata=${hash}&kugouid=0&mid=16249512204336365674023395779019&mixsongid=0&p=${page}&pagesize=${limit}&uuid=0&ver=10`
|
||||||
const _requestObj = httpFetch(`http://m.comment.service.kugou.com/v1/cmtlist?${params}&signature=${signatureParams(params)}`, {
|
const _requestObj = httpFetch(`http://m.comment.service.kugou.com/r/v1/rank/newest?${params}&signature=${signatureParams(params)}`, {
|
||||||
headers: {
|
headers: {
|
||||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.24',
|
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.24',
|
||||||
},
|
},
|
||||||
|
|||||||
59
src/renderer/utils/musicSdk/kg/singer.js
Normal file
59
src/renderer/utils/musicSdk/kg/singer.js
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
import { httpFetch } from '../../request'
|
||||||
|
// import { decodeName, formatPlayTime, sizeFormate } from '../../index'
|
||||||
|
// import { signatureParams } from './util'
|
||||||
|
import { getMusicInfosByList } from './musicInfo'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
filterAlbum(rawList) {
|
||||||
|
let returnList = []
|
||||||
|
rawList.forEach((albumInfo) => {
|
||||||
|
returnList.push({
|
||||||
|
name: albumInfo.albumname,
|
||||||
|
author: albumInfo.singername,
|
||||||
|
img: albumInfo.replaceAll('{size}', '480'),
|
||||||
|
album_id: albumInfo.albumid,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async getSingerInfo(singerid) {
|
||||||
|
if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0
|
||||||
|
const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/info?singerid=${singerid}`)
|
||||||
|
let { body, statusCode } = await requestObj.promise
|
||||||
|
if (statusCode !== 200) throw new Error('获取歌手信息失败')
|
||||||
|
return {
|
||||||
|
source: 'kg',
|
||||||
|
singerid,
|
||||||
|
info: {
|
||||||
|
name: body.data.singername,
|
||||||
|
desc: body.data.intro,
|
||||||
|
img: body.data.imgurl.replace('{size}', '480')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getSingerSongList(singerid, page, limit) {
|
||||||
|
if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0
|
||||||
|
const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`)
|
||||||
|
let { body, statusCode } = await requestObj.promise
|
||||||
|
if (statusCode !== 200) throw new Error('获取歌手歌曲列表失败')
|
||||||
|
let listData = await getMusicInfosByList(body.data.info)
|
||||||
|
return {
|
||||||
|
source: 'kg',
|
||||||
|
list: listData,
|
||||||
|
id: `kg__singer_${singerid}`,
|
||||||
|
singerid,
|
||||||
|
total: body.data.total,
|
||||||
|
allPage: Math.ceil(body.data.total / limit),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getSingerAlbumList(singerid, page, limit) {
|
||||||
|
if (singerid == 0) throw new Error('歌手不存在') // kg源某些歌曲在歌手没被kg收录时返回的歌手id为0
|
||||||
|
const requestObj = httpFetch(`http://mobiles.kugou.com/api/v5/singer/song?singerid=${singerid}&page=${page}&pagesize=${limit}`)
|
||||||
|
let { body, statusCode } = await requestObj.promise
|
||||||
|
if (statusCode !== 200) throw new Error('获取歌手专辑列表失败')
|
||||||
|
return {
|
||||||
|
source: 'kg',
|
||||||
|
albums: this.filterAlbum(body.data.info),
|
||||||
|
singerid,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,4 @@
|
|||||||
import { httpFetch } from '../../request'
|
import { eapiRequest } from './utils/index'
|
||||||
import { weapi } from './utils/crypto'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
_requestObj: null,
|
_requestObj: null,
|
||||||
@ -7,20 +6,15 @@ export default {
|
|||||||
if (this._requestObj) this._requestObj.cancelHttp()
|
if (this._requestObj) this._requestObj.cancelHttp()
|
||||||
if (retryNum > 2) return Promise.reject(new Error('try max num'))
|
if (retryNum > 2) return Promise.reject(new Error('try max num'))
|
||||||
|
|
||||||
const _requestObj = httpFetch('https://music.163.com/weapi/search/hot', {
|
const _requestObj = eapiRequest('/api/search/chart/detail', {
|
||||||
method: 'post',
|
id: 'HOT_SEARCH_SONG#@#',
|
||||||
headers: {
|
|
||||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36',
|
|
||||||
origin: 'https://music.163.com',
|
|
||||||
},
|
|
||||||
form: weapi({ type: 1111 }),
|
|
||||||
})
|
})
|
||||||
const { body, statusCode } = await _requestObj.promise
|
const { body, statusCode } = await _requestObj.promise
|
||||||
if (statusCode != 200 || body.code !== 200) throw new Error('获取热搜词失败')
|
if (statusCode != 200 || body.code !== 200) throw new Error('获取热搜词失败')
|
||||||
// console.log(body)
|
|
||||||
return { source: 'wy', list: this.filterList(body.result.hots) }
|
return { source: 'wy', list: this.filterList(body.data.itemList) }
|
||||||
},
|
},
|
||||||
filterList(rawList) {
|
filterList(rawList) {
|
||||||
return rawList.map(item => item.first)
|
return rawList.map(item => item.searchWord)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user