From ef732aa965b518d035f34b2a61f785d580d9ea08 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Tue, 22 Jan 2019 00:28:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0DEBUG=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api.py b/api.py index c133ce2..01c1c54 100644 --- a/api.py +++ b/api.py @@ -9,6 +9,7 @@ import time s = requests.Session() +DEBUG:bool = False class XiGuaLiveApi: isLive: bool = False @@ -121,7 +122,8 @@ class XiGuaLiveApi: if "LiveMsgs" not in d["data"]: return for i in d['data']['LiveMsgs']: - print(i) + if DEBUG: + print(i) if i['Method'] == "VideoLivePresentMessage": self.onPresent(Gift(i)) elif i['Method'] == "VideoLivePresentEndTipMessage": @@ -149,6 +151,11 @@ if __name__ == "__main__": room = 97621754276 # 永恒 # room = 75366565294 # room = 83940182312 #Dae + if len(sys.argv) > 1: + if sys.argv[-1] == "d": + DEBUG = True + room = int(sys.argv[1]) + print("西瓜直播弹幕助手 by JerryYan") api = XiGuaLiveApi(room) print("进入", api.roomLiver, "的直播间")