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