From 14525ee76e0cd8f2d4b9cf8d262f7b9eba70b06c Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 28 Jan 2019 20:26:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=90=9C=E7=B4=A2=E5=8A=9F?= =?UTF-8?q?=E8=83=BD[Beta]=20Update=20ReadMe.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jerry Yan <792602257@qq.com> --- README.md | 11 +++++++---- api.py | 21 +++++++++++++++------ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 20e2a39..154dab4 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,15 @@ # XiguaLiveDanmakuHelper -### 西瓜直播弹幕助手 +### 西瓜直播弹幕助手--控制台版 -因个人能力有限,不懂C#,无法做出界面版,只好用控制台版先顶着 +界面版:[q792602257/XiguaDanmakuHelperGUI](https://github.com/q792602257/XiguaDanmakuHelperGUI "C# ver") ### 计划更新: -+ √ 使用android app协议 ++ √ ~~使用android app协议~~ + 已使用 除从用户ID获取roomID及判断是否在播外,其他均改为Android Api -- √ 闲的无聊的时候看一看有没有好用的GUI轮子可以用用 ++ √ ~~闲的无聊的时候看一看有没有好用的GUI轮子可以用用~~ + + 已完成 已基于BiliLive_dm制作出初代西瓜直播弹幕姬,api未跟进 diff --git a/api.py b/api.py index 66da073..f237a34 100644 --- a/api.py +++ b/api.py @@ -83,6 +83,19 @@ class XiGuaLiveApi: if DEBUG: print(p.text) + def searchLive(self, keyword): + ret = [] + p = s.get("https://security.snssdk.com/video/app/search/live/?version_code=730&device_platform=android" + "&format=json&keyword={}".format(keyword)) + d = p.json() + if "data" not in d: + for i in d["data"]: + if i["block_type"] != 2: + continue + for _i in i["cells"]: + ret.append(_i["room"]) + return ret + def updRoomInfo(self): p = s.get("https://live.ixigua.com/api/room?anchorId={room}".format(room=self.room)) if DEBUG: @@ -105,8 +118,8 @@ class XiGuaLiveApi: def getDanmaku(self): if not self.isValidRoom: return - p = s.get("https://i.snssdk.com/videolive/im/get_msg?cursor={cursor}&room_id={roomID}&version_code=730" - "&device_platform=android".format( + p = s.get("https://i.snssdk.com/videolive/im/get_msg?cursor={cursor}&room_id={roomID}" + "&version_code=730&device_platform=android".format( roomID=self.roomID, cursor=self._cursor )) @@ -155,10 +168,6 @@ if __name__ == "__main__": room = 97621754276 # 永恒 # room = 75366565294 # room = 83940182312 #Dae -<<<<<<< HEAD - # room = 58649240617 #ll -======= ->>>>>>> f7727a3c3962342c753890954a25cbe05c113cf9 if len(sys.argv) > 1: if sys.argv[-1] == "d": DEBUG = True