diff --git a/proxylists/proxies/oxylabs.py b/proxylists/proxies/oxylabs.py index 6a3ccf6..fb062d1 100644 --- a/proxylists/proxies/oxylabs.py +++ b/proxylists/proxies/oxylabs.py @@ -7,7 +7,12 @@ from .server import ProxyServer class Oxylabs(ProxyServer): - url = 'customer-{username}-cc-{country}-sesstime-{session_time}:{password}@pr.oxylabs.io:7777' + """ + Oxylabs Proxy information. + """ + https_support: bool = True + oxylabs_base: str = 'pr.oxylabs.io:7777' + url = 'customer-{username}-cc-{country}-sesstime-{ses_time}:{password}@{oxy}' def __init__(self, **kwargs): self.username = kwargs.get( @@ -24,12 +29,13 @@ def __init__(self, **kwargs): self.customer = self.url.format( username=self.username, password=self.password, - session_time=self.session_time, + ses_time=self.session_time, country=self.country, + oxy=self.oxylabs_base ) self.proxy = { 'http': f'http://{self.customer}', - 'https': f'http://{self.customer}', + 'https': f'https://{self.customer}', } async def get_list(self): diff --git a/proxylists/proxies/server.py b/proxylists/proxies/server.py index 1518a41..a7f1d12 100644 --- a/proxylists/proxies/server.py +++ b/proxylists/proxies/server.py @@ -6,6 +6,7 @@ class ProxyServer: url = "" parser = None + https_support: bool = False async def get_list(self): timeout = aiohttp.ClientTimeout(total=60) @@ -37,6 +38,11 @@ async def get_proxies(self): async def get_proxy_list(self) -> dict: proxies = await self.get_list() + if self.https_support is True: + return { + 'http': f'http://{proxies[0]}', + 'https': f'https://{proxies[0]}', + } return { 'http': f'http://{proxies[0]}', 'https': f'http://{proxies[0]}', diff --git a/proxylists/version.py b/proxylists/version.py index 49fd486..2208db4 100644 --- a/proxylists/version.py +++ b/proxylists/version.py @@ -3,7 +3,7 @@ __title__ = 'proxylists' __description__ = ('Package for getting useful proxy servers, ' 'can use lists like hidemy or proxydb.') -__version__ = '0.14.0' +__version__ = '0.14.1' __author__ = 'Jesus Lara' __author_email__ = 'jesuslarag@gmail.com' __license__ = 'BSD'