forked from kenzuya/unshackle
fix(windscribevpn): add error handling for unsupported regions in get_proxy method
This commit is contained in:
@@ -44,9 +44,17 @@ class WindscribeVPN(Proxy):
|
|||||||
def get_proxy(self, query: str) -> Optional[str]:
|
def get_proxy(self, query: str) -> Optional[str]:
|
||||||
"""
|
"""
|
||||||
Get an HTTPS proxy URI for a WindscribeVPN server.
|
Get an HTTPS proxy URI for a WindscribeVPN server.
|
||||||
|
|
||||||
|
Note: Windscribe's static OpenVPN credentials only work on US servers.
|
||||||
"""
|
"""
|
||||||
query = query.lower()
|
query = query.lower()
|
||||||
|
|
||||||
|
if query != "us" and query not in self.server_map:
|
||||||
|
raise ValueError(
|
||||||
|
f"Windscribe proxy does not currently support the '{query.upper()}' region. "
|
||||||
|
"Only US servers are supported with static OpenVPN credentials. "
|
||||||
|
)
|
||||||
|
|
||||||
if query in self.server_map:
|
if query in self.server_map:
|
||||||
hostname = self.server_map[query]
|
hostname = self.server_map[query]
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user