[fix] unhandled Exceptions in radio_browser.py

Closes: https://github.com/searxng/searxng/issues/5439
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser
2026-03-03 14:02:19 +01:00
committed by Markus Heiser
parent d1f9409afc
commit a9f3baefe6
+5 -1
View File
@@ -72,7 +72,11 @@ def server_list() -> list[str]:
ips = socket.getaddrinfo("all.api.radio-browser.info", 80, 0, 0, socket.IPPROTO_TCP) ips = socket.getaddrinfo("all.api.radio-browser.info", 80, 0, 0, socket.IPPROTO_TCP)
for ip_tuple in ips: for ip_tuple in ips:
_ip: str = ip_tuple[4][0] # type: ignore _ip: str = ip_tuple[4][0] # type: ignore
url = socket.gethostbyaddr(_ip)[0] try:
url = socket.gethostbyaddr(_ip)[0]
except socket.herror:
# https://github.com/searxng/searxng/issues/5439
continue
srv = "https://" + url srv = "https://" + url
if srv not in servers: if srv not in servers:
servers.append(srv) servers.append(srv)