fix(proxies): match surfshark's current server api

Server names replace numeric server IDs; unknown queries return None so the next proxy provider can answer.
This commit is contained in:
imSp4rky
2026-09-25 17:27:36 -06:00
parent 5838f2aed6
commit 34c04e0587
5 changed files with 198 additions and 93 deletions
+5 -1
View File
@@ -534,9 +534,13 @@ class Gluetun(Proxy):
Server hostname (e.g., "us1239.nordvpn.com")
"""
country_lower = country_code.lower()
if provider_name == "surfshark":
raise ValueError(
"Surfshark has no numbered servers. Map the region to a server name such as "
f"'{country_lower}-dal.prod.surfshark.com' in server_hostnames instead."
)
hostname_formats = {
"nordvpn": f"{country_lower}{server_num}.nordvpn.com",
"surfshark": f"{country_lower}-{server_num}.prod.surfshark.com",
"expressvpn": f"{country_lower}-{server_num}.expressvpn.com",
"cyberghost": f"{country_lower}-s{server_num}.cg-dialup.net",
# Generic fallback for other providers