Nemo2011 / bilibili-api

哔哩哔哩常用API调用。支持视频、番剧、用户、频道、音频等功能。原仓库地址:https://github.com/MoyuScript/bilibili-api
https://nemo2011.github.io/bilibili-api/
GNU General Public License v3.0
2.24k stars 217 forks source link

[漏洞] `video.Video.get_detail` 显示风控校验失败 #713

Open PetterZhukov opened 8 months ago

PetterZhukov commented 8 months ago

Python 版本: 3.11.4

模块版本:16.2.0

运行环境: Linux

模块路径: bilibili_api.user

解释器: cpython

报错信息:

{'code': -352, 'message': '风控校验失败', 'ttl': 1, 'data': {'v_voucher': 'voucher_a63e34a5-ba38-431b-8db0-e591eac19379'}}

报错代码:

import asyncio
from bilibili_api import video,user

async def mvideo_data() -> None:
    # 实例化 Video 类
    v = video.Video(bvid="BV1uv411q7Mv")
    # 获取信息
    info = await v.get_detail()
    # 打印信息
    print(info)

if __name__ == "__main__":
    asyncio.get_event_loop().run_until_complete(mvideo_data())

user的获取video list 逻辑好像失效了,从我从浏览器通过 https://api.bilibili.com/x/web-interface/wbi/view/detail 链接的调用结果来看,可能和登录状态的参数有关?有登陆调用访问url不会触发风控

z0z0r4 commented 8 months ago

未能复现此问题

>>> v = video.Video(bvid="BV1uv411q7Mv")
>>> sync(v.get_detail())

image