SocialSisterYi / bilibili-API-collect

哔哩哔哩-API收集整理【不断更新中....】
https://socialsisteryi.github.io/bilibili-API-collect/
Other
15.27k stars 1.73k forks source link

[新增/更新请求] 获取分区视频排行榜列表 #1134

Open chanyu-vv opened 2 weeks ago

chanyu-vv commented 2 weeks ago

提交前请确认

API 来源

Web 端(含 h5)

API 类型

REST

API 地址

https://api.bilibili.com/x/web-interface/ranking/v2

详情描述

获取分区视频排行榜列表的 api 的 url参数中的目标分区的参数名 tid 现在是 rid,如果使用 tid 相当于没有分区参数,只能获取到全区排行榜

官网的请求:

image

通过构造 url 请求,指定 tid=3: https://api.bilibili.com/x/web-interface/ranking/v2?tid=3&type=all&wts=1730887656&w_rid=8408fa27f812da0fb7bc015e3e9cfe43

下面是响应的内容,可以看到有其它分区的视频内容(内容太长,已省略):


{
    "code": 0,
    "message": "0",
    "ttl": 1,
    "data": {
        "note": "根据稿件内容质量、近期的数据综合展示,动态更新",
        "list": [
            {
                "aid": 113411497398320,
                "videos": 1,
                "tid": 238,
                "tname": "运动综合",
                "copyright": 1,
                "pic": "http://i0.hdslb.com/bfs/archive/5fd93561b60bed70207dd2cad424df459594f967.jpg",
                "title": "铸造一万把剑,实拍万剑归宗!剑全送你们,愿大家都能找回那个仗剑走天涯的少年!",
                "pubdate": 1730538781,
                "ctime": 1730524377,
                "desc": "-",
                "state": 0,
                "duration": 327,
                "mission_id": 4023691,
                "rights": {
                    "bp": 0,
                    "elec": 0,
                    "download": 0,
                    "movie": 0,
                    "pay": 0,
                    "hd5": 0,
                    "no_reprint": 1,
                    "autoplay": 1,
                    "ugc_pay": 0,
                    "is_cooperation": 0,
                    "ugc_pay_preview": 0,
                    "no_background": 0,
                    "arc_pay": 0,
                    "pay_free_watch": 0
                },
                "owner": {
                    "mid": 1455861172,
                    "name": "剑客范十三",
                    "face": "https://i1.hdslb.com/bfs/face/22bbff153cd72367ba69d553ee5853f321529324.jpg"
                },
                "stat": {
                    "aid": 113411497398320,
                    "view": 5083473,
                    "danmaku": 17989,
                    "reply": 45668,
                    "favorite": 146525,
                    "coin": 575194,
                    "share": 31743,
                    "now_rank": 0,
                    "his_rank": 1,
                    "like": 732793,
                    "dislike": 0,
                    "vt": 0,
                    "vv": 5083473
                },
                "dynamic": "",
                "cid": 26575111041,
                "dimension": {
                    "width": 3840,
                    "height": 2160,
                    "rotate": 0
                },
                "short_link_v2": "https://b23.tv/BV1JLDwYTEzt",
                "first_frame": "http://i1.hdslb.com/bfs/storyff/n241102sa2shzc959pcapo2cssyqbo8f_firsti.jpg",
                "pub_location": "四川",
                "cover43": "",
                "bvid": "BV1JLDwYTEzt",
                "score": 0,
                "enable_vt": 0
            },
            ...
         ]
     }
 }
hyoban commented 1 week ago

I organized this part of the API on the RSSHub side

https://github.com/DIYgod/RSSHub/pull/17544