From 20d9e21a000784696e43a81b6d3f73d1679f592a Mon Sep 17 00:00:00 2001 From: Droid-MAX Date: Mon, 27 Oct 2025 18:58:09 +0800 Subject: [PATCH 1/2] fix: Fixed the bug that prevented the correct identification of upnp devices --- natter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/natter.py b/natter.py index e04901f..166b29f 100755 --- a/natter.py +++ b/natter.py @@ -1328,7 +1328,7 @@ def _discover(self): while True: try: buff, addr = sock.recvfrom(4096) - m = re.search(r"LOCATION: *(http://[^\[]\S+)\s+", + m = re.search(r"(?:LOCATION|Location): *(http://[^\[]\S+)\s+", buff.decode("utf-8")) if not m: continue From e7bbaf70ab9f5a8575d6bd870a43c10182bd767e Mon Sep 17 00:00:00 2001 From: Droid-MAX Date: Mon, 27 Oct 2025 21:14:23 +0800 Subject: [PATCH 2/2] Update natter.py Co-authored-by: Mike Wang --- natter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/natter.py b/natter.py index 166b29f..ffc6196 100755 --- a/natter.py +++ b/natter.py @@ -1328,7 +1328,8 @@ def _discover(self): while True: try: buff, addr = sock.recvfrom(4096) - m = re.search(r"(?:LOCATION|Location): *(http://[^\[]\S+)\s+", + m = re.search(r"[Ll][Oo][Cc][Aa][Tt][Ii][Oo][Nn]: " + r"*([Hh][Tt][Tt][Pp]://[^\[]\S+)\s+", buff.decode("utf-8")) if not m: continue