修复wy源热搜词 (#1403)
* 修复wy源热搜词失效 * 添加更新日志 --------- Co-authored-by: lyswhut <lyswhut@qq.com>pull/1405/head
parent
fd2dca0769
commit
d93fbd699d
|
@ -16,6 +16,7 @@
|
|||
- 修复播放某些在线音频会没有声音的问题
|
||||
- 修复改变播放速率时会导致歌词报错的问题
|
||||
- 修复tx热门评论昵称被错误切割的问题 (#1397, By: @helloplhm-qwq, @Folltoshe)
|
||||
- 修复wy源热搜词失效的问题(#1401, @Folltoshe)
|
||||
- 修复Deepin 20下启用桌面歌词时可能会导致桌面卡死的问题(#1288)
|
||||
|
||||
### 其他
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { httpFetch } from '../../request'
|
||||
import { weapi } from './utils/crypto'
|
||||
import { eapiRequest } from './utils/index'
|
||||
|
||||
export default {
|
||||
_requestObj: null,
|
||||
|
@ -7,20 +6,15 @@ export default {
|
|||
if (this._requestObj) this._requestObj.cancelHttp()
|
||||
if (retryNum > 2) return Promise.reject(new Error('try max num'))
|
||||
|
||||
const _requestObj = httpFetch('https://music.163.com/weapi/search/hot', {
|
||||
method: 'post',
|
||||
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 _requestObj = eapiRequest('/api/search/chart/detail', {
|
||||
id: 'HOT_SEARCH_SONG#@#',
|
||||
})
|
||||
const { body, statusCode } = await _requestObj.promise
|
||||
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) {
|
||||
return rawList.map(item => item.first)
|
||||
return rawList.map(item => item.searchWord)
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue