Skip to content

Commit

Permalink
Merge pull request #785 from whille/main
Browse files Browse the repository at this point in the history
debug startLive; send_damaku performance(without get roomid)
  • Loading branch information
z0z0r4 authored Jul 27, 2024
2 parents 48e6350 + b7ba551 commit e8c2ba5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bilibili_api/data/api/live.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"stop": {
"url": "https://api.live.bilibili.com/room/v1/Room/stopLive",
"method": "POST",
"verify": false,
"verify": true,
"params": {
"room_id": "int: 房间号",
"platform": "pc/web/...",
Expand Down
7 changes: 5 additions & 2 deletions bilibili_api/live.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ async def start(self, area_id: int) -> dict:
"area_v2": area_id,
"room_id": self.room_display_id,
"platform": "pc",
"csrf": self.credential.bili_jct,
"csrf_token": self.credential.bili_jct
}
resp = (
await Api(**api, credential=self.credential).update_params(**params).result
Expand Down Expand Up @@ -495,7 +497,7 @@ async def unban_user(self, uid: int) -> dict:
}
return await Api(**api, credential=self.credential).update_data(**data).result

async def send_danmaku(self, danmaku: Danmaku, reply_mid: int = None) -> dict:
async def send_danmaku(self, danmaku: Danmaku, room_id: int = None, reply_mid: int = None) -> dict:
"""
直播间发送弹幕
Expand All @@ -510,7 +512,8 @@ async def send_danmaku(self, danmaku: Danmaku, reply_mid: int = None) -> dict:
self.credential.raise_for_no_sessdata()

api = API["operate"]["send_danmaku"]
room_id = (await self.get_room_play_info())["room_id"]
if not room_id:
room_id = (await self.get_room_play_info())["room_id"]

data = {
"mode": danmaku.mode,
Expand Down

0 comments on commit e8c2ba5

Please sign in to comment.