Ninzore / Wecab

最好的订阅制QQbot
GNU General Public License v3.0
204 stars 18 forks source link

[BUG] B站接口变更 导致直播间订阅功能(checkliveStatus) 失效 #62

Closed hecheng337 closed 2 years ago

hecheng337 commented 2 years ago

描述

B站用于获取用户对应直播间状态的API发生变更。

原接口 返回的整个data字段,现在被收进了 https://api.bilibili.com/x/space/acc/info 里的 data.live_room image

对老接口访问会收到错误码-412,提示“请求被拦截”。 image

有关的issue见此处

经简单测试,直接修改 plugin/bilibili.js 的第123行和132行貌似可以恢复正常。 懒得写pr了,哪位大佬看到就赶紧帮忙改一下吧。

Error Log

image

Ninzore commented 2 years ago

是这样的,现在新的直播检查api是 https://api.live.bilibili.com/room/v1/Room/get_status_info_by_uids

Ninzore commented 2 years ago

贴一个axios

axios({
    method : "GET",
    url : "https://api.live.bilibili.com/room/v1/Room/get_status_info_by_uids",
    headers : {
        "authority": "api.live.bilibili.com",
        "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36",
        "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
    },
    params : params
}).then(response => {
    return response.data.data;
}).catch(err => {
    console.error(err.response.data, "\nBilibili checkliveStatus error");
    return false;
});