Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[错误] B站搜索API返回异常 #1176

Open
1 task done
NB-Group opened this issue Jan 5, 2025 · 5 comments
Open
1 task done

[错误] B站搜索API返回异常 #1176

NB-Group opened this issue Jan 5, 2025 · 5 comments
Labels
主站杂项/Misc 接口:主站其他类型

Comments

@NB-Group
Copy link

NB-Group commented Jan 5, 2025

提交前请确认

  • 我已检索仓库中文档,不包含所提及内容,或所提及内容在本仓库中存在错误,且 Issues、Pull Requests 中无相关提交

API 来源

Web 端(含 h5)

API 类型

REST

API 地址

https://api.bilibili.com/x/web-interface/wbi/search/

详情描述

使用该API获取结果时,返回:

{
    "code": 0,
    "data": {
        "v_voucher": "voucher_8c858952-3d91-41ec-9d17-892e70f25c63"
    },
    "message": "0",
    "ttl": 1
}

通过在相同网络环境下的浏览器(已登录)手动访问返回正常结果:

{
    "code": 0,
    "message": "0",
    "ttl": 1,
    "data": {
        "seid": "9810661526728396966",
        "page": 1,
        "pagesize": 20,
        "numResults": 1000,
        "numPages": 50,
        "suggest_keyword": "",
        "rqt_type": "search",
        "cost_time": {
            "total": "0.311678",
            "fetch_lexicon": "0.004448",
            "params_check": "0.002204",
            "is_risk_query": "0.000156",
            "illegal_handler": "0.000010",
            "main_handler": "0.303395",
            "as_request_format": "0.000360",
            "as_request": "0.300197",
            "deserialize_response": "0.000239",
            "as_response_format": "0.002522"
        },
        "exp_list": {
            "5504": true,
            "6605": true,
            "7701": true,
            "9902": true,
            "9924": true,
            "9931": true,
            "9949": true,
            "9961": true,
            "100010": true,
            "100204": true,
            "100800": true,
            "102409": true,
            "102600": true,
            "102701": true,
            "102801": true,
            "102901": true,
            "103006": true,
            "103104": true,
            "103206": true,
            "103307": true,
            "103400": true,
            "104102": true,
            "104400": true,
            "105101": true,
            "105208": true,
            "105401": true,
            "105600": true,
            "105804": true,
            "106002": true,
            "106205": true,
            "106307": true,
            "106408": true,
            "106506": true,
            "106703": true,
            "106801": true,
            "106902": true,
            。。。
        },
        "egg_hit": 0,
        "result": [
            {
                "type": "video",
                "id": 1255923506,
                "author": "KBShinya",
                "mid": 423442,
                "typeid": "30",
                "typename": "VOCALOID·UTAU",
                "arcurl": "http://www.bilibili.com/video/av1255923506",
                "aid": 1255923506,
                "bvid": "BV1UJ4m1u7gD",
                "title": "《崩坏:星穹铁道》流萤原创同人曲《<em class=\"keyword\">飞萤燃夜</em>》",
                "description": "作曲:KBShinya\n作词:冉语优\n编曲:Fsy小诺/向往\n演唱:星尘infinity\n调教:Creuzer\n吉他:大牛\n混音:圈太Studio\n视频:雾枝今天行不行啊\n啊终于做完了这首qwq 视频有点极限肝,所以用了混剪+轻包装的办法做视频了。算是我做的流萤的第二首歌,主要是想表达流萤义无反顾,脱离人形兵器的定义,找寻本我的一种命定感。",
                "arcrank": "0",
                "pic": "//i0.hdslb.com/bfs/archive/9f6cf7fbfcfce8b69a1f175c8794d99045dbe350.jpg",
                "play": 1327150,
                "video_review": 1205,
                "favorites": 76341,
                "tag": "同人曲,星尘,流萤,米哈游,Synthesizer V,崩坏:星穹铁道,星穹铁道,崩坏:星穹铁道创作者激励计划,崩坏星穹铁道2.3创作者激励计划",
                "review": 1426,
                "pubdate": 1719113378,
                "senddate": 1719120785,
                "duration": "3:20",
                "badgepay": false,
                "hit_columns": [
                    "title"
                ],
                "view_type": "",
                "is_pay": 0,
                "is_union_video": 1,
                "rec_tags": null,
                "new_rec_tags": [],
                "rank_score": 200000000,
                "like": 120076,
                "upic": "https://i1.hdslb.com/bfs/face/e5ea8b564d0e3d3f00b087311bf0ebb2c0f86592.jpg",
                "corner": "",
                "cover": "",
                "desc": "",
                "url": "",
                "rec_reason": "",
                "danmaku": 1205,
                "biz_data": null,
                "is_charge_video": 0,
                "vt": 0,
                "enable_vt": 0,
                "vt_display": "",
                "subtitle": "",
                "episode_count_text": "",
                "release_status": 0,
                "is_intervene": 0,
                "area": 0,
                "style": 0,
                "cate_name": "",
                "is_live_room_inline": 0,
                "live_status": 0,
                "live_time": "",
                "online": 0,
                "rank_index": 1,
                "rank_offset": 1,
                "roomid": 0,
                "short_id": 0,
                "spread_id": 0,
                "tags": "",
                "uface": "",
                "uid": 0,
                "uname": "",
                "user_cover": "",
                "parent_area_id": 0,
                "parent_area_name": "",
                "watched_show": null
            },
。。。

可见其丢失了正常的返回结果,而且最重要的是等待一会又能够正常获取了。
希望各位大佬能够回复,谢谢

@BennettChina
Copy link

触发风控的结果

@NB-Group
Copy link
Author

NB-Group commented Jan 5, 2025

但是在文档里写的校验方法都用上了哇,请求也不频繁,咋就触发了

@stmtc233
Copy link
Contributor

stmtc233 commented Jan 5, 2025

但是在文档里写的校验方法都用上了哇,请求也不频繁,咋就触发了

风水不好

@BennettChina
Copy link

近期风控加强了,你用浏览器无痕模式去调试对比 Cookie 参数。你试试添加 bili_ticketbuvid_fp 等参数加上看看。

@NB-Group
Copy link
Author

NB-Group commented Jan 5, 2025

好的

@z0z0r4 z0z0r4 added the 主站杂项/Misc 接口:主站其他类型 label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
主站杂项/Misc 接口:主站其他类型
Projects
None yet
Development

No branches or pull requests

4 participants