From 49aa61417ab4c3524f931cd1cdce063e1b6673c5 Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Sat, 18 May 2024 22:52:40 -0500 Subject: [PATCH] Multi-line parsing bug fixes --- bot.py | 4 ++-- config.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 3c54180..6ed5c0d 100644 --- a/bot.py +++ b/bot.py @@ -233,9 +233,9 @@ class bot(bare.bot): if self.queue: return bytes(self.queue.pop(0)) data = bytes(self.sock.recv(2048)) - while !data.endswith(b"\r\n") + while not data.endswith(b"\r\n"): data += bytes(self.sock.recv(2048)) - data.rstrip(b"\r\n") + data = bytes(data.strip(b"\r\n")) if b"\r\n" in data: self.queue.extend(data.split(b"\r\n")) return bytes(self.queue.pop(0)) diff --git a/config.py b/config.py index 07c5205..432e23b 100644 --- a/config.py +++ b/config.py @@ -10,7 +10,7 @@ ipbl = DNSBLIpChecker() hsbl = DNSBLDomainChecker() load_dotenv() -__version__ = "v3.0.13" +__version__ = "v3.0.14" npbase: str = ( "\[\x0303last\.fm\x03\] [A-Za-z0-9_[\]{}\\|\-^]{1,$MAX} (is listening|last listened) to: \x02.+ - .*\x02( \([0-9]+ plays\)( \[.*\])?)?" # pyright: ignore [reportInvalidStringEscapeSequence] )