Skip to content

Commit

Permalink
Merge pull request #247 from liuhuancom/v9
Browse files Browse the repository at this point in the history
增加获取高能榜接口
  • Loading branch information
MoyuScript authored Nov 7, 2021
2 parents 4381a4a + c6c8977 commit 186a18f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bilibili_api/data/api/live.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@
},
"comment": "获取大航海列表"
},
"gaonengbang": {
"url": "https://api.live.bilibili.com/xlive/general-interface/v1/rank/getOnlineGoldRank",
"method": "GET",
"verify": false,
"params": {
"roomId": "int: 真实房间号",
"page": "int: 页码",
"ruid": "int: 全称 room_uid,从 room_play_info 里头的 uid 可以找到",
"pageSize": 50
},
"comment": "获取高能榜"
},
"live_info": {
"url": "https://api.live.bilibili.com/xlive/web-ucenter/user/live_info",
"method": "GET",
Expand Down
16 changes: 16 additions & 0 deletions bilibili_api/live.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,22 @@ async def get_dahanghai(self, page: int = 1):
}
return await request(api['method'], api["url"], params, credential=self.credential)

async def get_gaonengbang(self, page: int = 1):
"""
获取高能榜列表
Args:
page (int, optional): 页码. Defaults to 1
"""
api = API["info"]["gaonengbang"]
params = {
"roomId": self.room_display_id,
"ruid": await self.__get_ruid(),
"pageSize": 50,
"page": page
}
return await request(api['method'], api["url"], params, credential=self.credential)

async def get_seven_rank(self):
"""
获取七日榜
Expand Down
4 changes: 4 additions & 0 deletions tests/test_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,7 @@ async def test_za_send_gift_silver():

async def test_zb_get_area_info():
return await live.get_area_info()

async def test_zc_get_gaonengbang():
return await l.get_gaonengbang()

0 comments on commit 186a18f

Please sign in to comment.