add PH proxy option (#4395)
This commit is contained in:
@@ -52,6 +52,7 @@ export const ProxyLocation = {
|
||||
ResidentialMX: "RESIDENTIAL_MX",
|
||||
ResidentialIT: "RESIDENTIAL_IT",
|
||||
ResidentialNL: "RESIDENTIAL_NL",
|
||||
ResidentialPH: "RESIDENTIAL_PH",
|
||||
ResidentialISP: "RESIDENTIAL_ISP",
|
||||
None: "NONE",
|
||||
} as const;
|
||||
|
||||
@@ -17,6 +17,7 @@ export const SUPPORTED_COUNTRY_CODES = [
|
||||
"MX",
|
||||
"NL",
|
||||
"NZ",
|
||||
"PH",
|
||||
"TR",
|
||||
"ZA",
|
||||
] as const;
|
||||
@@ -40,6 +41,7 @@ export const COUNTRY_NAMES: Record<SupportedCountryCode, string> = {
|
||||
MX: "Mexico",
|
||||
NL: "Netherlands",
|
||||
NZ: "New Zealand",
|
||||
PH: "Philippines",
|
||||
TR: "Turkey",
|
||||
ZA: "South Africa",
|
||||
};
|
||||
@@ -61,6 +63,7 @@ export const COUNTRY_FLAGS: Record<SupportedCountryCode, string> = {
|
||||
MX: "🇲🇽",
|
||||
NL: "🇳🇱",
|
||||
NZ: "🇳🇿",
|
||||
PH: "🇵🇭",
|
||||
TR: "🇹🇷",
|
||||
ZA: "🇿🇦",
|
||||
};
|
||||
@@ -84,6 +87,7 @@ const PROXY_LOCATION_TO_COUNTRY: Record<string, string> = {
|
||||
[ProxyLocation.ResidentialMX]: "MX",
|
||||
[ProxyLocation.ResidentialNL]: "NL",
|
||||
[ProxyLocation.ResidentialNZ]: "NZ",
|
||||
[ProxyLocation.ResidentialPH]: "PH",
|
||||
[ProxyLocation.ResidentialTR]: "TR",
|
||||
[ProxyLocation.ResidentialZA]: "ZA",
|
||||
};
|
||||
@@ -106,6 +110,7 @@ const COUNTRY_TO_PROXY_LOCATION: Record<string, ProxyLocation> = {
|
||||
MX: ProxyLocation.ResidentialMX,
|
||||
NL: ProxyLocation.ResidentialNL,
|
||||
NZ: ProxyLocation.ResidentialNZ,
|
||||
PH: ProxyLocation.ResidentialPH,
|
||||
TR: ProxyLocation.ResidentialTR,
|
||||
ZA: ProxyLocation.ResidentialZA,
|
||||
};
|
||||
|
||||
@@ -27,6 +27,7 @@ ProxyLocation = typing.Union[
|
||||
"RESIDENTIAL_MX",
|
||||
"RESIDENTIAL_IT",
|
||||
"RESIDENTIAL_NL",
|
||||
"RESIDENTIAL_PH",
|
||||
"RESIDENTIAL_ISP",
|
||||
"NONE",
|
||||
],
|
||||
|
||||
@@ -23,6 +23,7 @@ Available geotargeting options:
|
||||
- RESIDENTIAL_FR: France
|
||||
- RESIDENTIAL_DE: Germany
|
||||
- RESIDENTIAL_NZ: New Zealand
|
||||
- RESIDENTIAL_PH: Philippines
|
||||
- RESIDENTIAL_ZA: South Africa
|
||||
- RESIDENTIAL_AR: Argentina
|
||||
- RESIDENTIAL_AU: Australia
|
||||
|
||||
@@ -57,6 +57,7 @@ class ProxyLocation(StrEnum):
|
||||
RESIDENTIAL_MX = "RESIDENTIAL_MX"
|
||||
RESIDENTIAL_IT = "RESIDENTIAL_IT"
|
||||
RESIDENTIAL_NL = "RESIDENTIAL_NL"
|
||||
RESIDENTIAL_PH = "RESIDENTIAL_PH"
|
||||
RESIDENTIAL_ISP = "RESIDENTIAL_ISP"
|
||||
NONE = "NONE"
|
||||
|
||||
@@ -95,6 +96,7 @@ class ProxyLocation(StrEnum):
|
||||
cls.RESIDENTIAL_MX,
|
||||
cls.RESIDENTIAL_IT,
|
||||
cls.RESIDENTIAL_NL,
|
||||
cls.RESIDENTIAL_PH,
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
@@ -118,6 +120,7 @@ class ProxyLocation(StrEnum):
|
||||
ProxyLocation.RESIDENTIAL_MX: 2000,
|
||||
ProxyLocation.RESIDENTIAL_IT: 2000,
|
||||
ProxyLocation.RESIDENTIAL_NL: 2000,
|
||||
ProxyLocation.RESIDENTIAL_PH: 2000,
|
||||
}
|
||||
return counts.get(proxy_location, 10000)
|
||||
|
||||
@@ -142,6 +145,7 @@ class ProxyLocation(StrEnum):
|
||||
ProxyLocation.RESIDENTIAL_MX: "MX",
|
||||
ProxyLocation.RESIDENTIAL_IT: "IT",
|
||||
ProxyLocation.RESIDENTIAL_NL: "NL",
|
||||
ProxyLocation.RESIDENTIAL_PH: "PH",
|
||||
}
|
||||
return mapping.get(proxy_location, "US")
|
||||
|
||||
@@ -165,6 +169,7 @@ SUPPORTED_GEO_COUNTRIES = frozenset(
|
||||
"MX",
|
||||
"NL",
|
||||
"NZ",
|
||||
"PH",
|
||||
"TR",
|
||||
"ZA",
|
||||
}
|
||||
@@ -307,6 +312,9 @@ def get_tzinfo_from_proxy(proxy_location: ProxyLocation) -> ZoneInfo | None:
|
||||
if proxy_location == ProxyLocation.RESIDENTIAL_NL:
|
||||
return ZoneInfo("Europe/Amsterdam")
|
||||
|
||||
if proxy_location == ProxyLocation.RESIDENTIAL_PH:
|
||||
return ZoneInfo("Asia/Manila")
|
||||
|
||||
if proxy_location == ProxyLocation.RESIDENTIAL_ISP:
|
||||
return ZoneInfo("America/New_York")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user