From 5e387a3c843b3db9280c32133d42ef2ddf4bfa58 Mon Sep 17 00:00:00 2001 From: eleflea Date: Mon, 4 Sep 2017 19:58:39 +0800 Subject: [PATCH] Update ZhanQi.py --- danmu/ZhanQi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/danmu/ZhanQi.py b/danmu/ZhanQi.py index 1ac5ceb..94e34a1 100644 --- a/danmu/ZhanQi.py +++ b/danmu/ZhanQi.py @@ -56,7 +56,7 @@ def _create_thread_fn(self, roomInfo): def get_danmu(self): if not select.select([self.danmuSocket], [], [], 1)[0]: return content = self.danmuSocket.recv(999) - for msg in re.findall(b'\x10\x27({[^\x00]*})\x0a', content): + for msg in re.findall(b'\x10\x27({[^\x00]*})[\x0a]?', content): try: msg = json.loads(msg.decode('utf8', 'ignore')) msg['NickName'] = (msg.get('fromname', '') or