From 511d58e9c575cc299adc4cee2f277995006b483f Mon Sep 17 00:00:00 2001 From: Dominik Heidler Date: Sat, 4 Nov 2023 00:04:15 +0100 Subject: [PATCH] Use correct ip --- announce.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/announce.py b/announce.py index de77200..faad699 100755 --- a/announce.py +++ b/announce.py @@ -26,11 +26,11 @@ while True: ips = pl.split("\t")[3] for ip in ips.split(","): if ip.endswith("/32"): - print(ip[:-3]) - print(f"{ip}:{UDP_PORT} {MESSAGE=}" % MESSAGE) + UDP_IP = ip[:-3] + print(f"{UDP_IP}:{UDP_PORT} {MESSAGE=}" % MESSAGE) sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) sock.bind(('0.0.0.0', 1900)) # 1900 is SSDP src port - sock.sendto(MESSAGE, (ip, UDP_PORT)) + sock.sendto(MESSAGE, (UDP_IP, UDP_PORT)) sock.close() time.sleep(10)