Small fix
This commit is contained in:
parent
e4a0e7aab6
commit
bbdcbb64b6
@ -289,27 +289,16 @@ class BaseService(ABC):
|
|||||||
proxy += hostname
|
proxy += hostname
|
||||||
return proxy + ":89" # https: 89, http: 80
|
return proxy + ":89" # https: 89, http: 80
|
||||||
|
|
||||||
|
|
||||||
def get_nordvpn_server(self, country):
|
def get_nordvpn_server(self, country):
|
||||||
"""
|
|
||||||
Get the recommended NordVPN server hostname for a specified Country.
|
# Get the Country's NordVPN ID
|
||||||
:param country: Country (in alpha 2 format, e.g. 'US' for United States)
|
countries = self.session.get("https://api.nordvpn.com/v1/servers/countries").json()
|
||||||
:returns: Recommended NordVPN server hostname, e.g. `us123.nordvpn.com`
|
|
||||||
"""
|
|
||||||
# Get the Country's NordVPN ID
|
|
||||||
countries = self.session.get(
|
|
||||||
url="https://nordvpn.com/wp-admin/admin-ajax.php",
|
|
||||||
params={"action": "servers_countries"}
|
|
||||||
).json()
|
|
||||||
country_id = [x["id"] for x in countries if x["code"].lower() == country.lower()]
|
country_id = [x["id"] for x in countries if x["code"].lower() == country.lower()]
|
||||||
if not country_id:
|
if not country_id:
|
||||||
return None
|
return None
|
||||||
country_id = country_id[0]
|
country_id = country_id[0]
|
||||||
# Get the most recommended server for the country and return it
|
|
||||||
recommendations = self.session.get(
|
# Get the most recommended server for the country and return it
|
||||||
url="https://nordvpn.com/wp-admin/admin-ajax.php",
|
recommendations = self.session.get(f"https://api.nordvpn.com/v1/servers/recommendations?filters[country_id]={country_id}").json()
|
||||||
params={
|
|
||||||
"action": "servers_recommendations",
|
|
||||||
"filters": json.dumps({"country_id": country_id})
|
|
||||||
}
|
|
||||||
).json()
|
|
||||||
return recommendations[0]["hostname"]
|
return recommendations[0]["hostname"]
|
||||||
|
|||||||
@ -23,7 +23,7 @@ cdm_api:
|
|||||||
credentials:
|
credentials:
|
||||||
iTunes: 'username:password'
|
iTunes: 'username:password'
|
||||||
Hotstar: 'username:password'
|
Hotstar: 'username:password'
|
||||||
DisneyPlus: 'tjp4252@gmail.com:Tjcooke@121382'
|
DisneyPlus: 'username:password'
|
||||||
|
|
||||||
directories:
|
directories:
|
||||||
temp: ''
|
temp: ''
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user