eaf-base-api 2.3.7__tar.gz → 2.3.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eaf_base_api
3
- Version: 2.3.7
3
+ Version: 2.3.8
4
4
  Summary: A base API for EchterAlsFake's Porn APIs
5
5
  Home-page: https://github.com/EchterAlsFake/eaf_base_api
6
6
  Author: Johannes Habel
@@ -233,13 +233,13 @@ class BaseCore:
233
233
  raise KillSwitch("CRITICAL PROXY ERROR, CHECK LOGS!")
234
234
 
235
235
 
236
- def initialize_session(self, verify=True): # Disable SSL verification only if you really need it....
236
+ def initialize_session(self): # Disable SSL verification only if you really need it....
237
237
  self.session = httpx.Client(
238
238
  proxy=self.config.proxy,
239
239
  headers=self.config.headers,
240
240
  timeout=self.config.timeout,
241
241
  follow_redirects=True,
242
- verify=verify
242
+ verify=self.config.verify_ssl
243
243
  )
244
244
 
245
245
  def update_headers(self, headers: dict):
@@ -369,8 +369,12 @@ class BaseCore:
369
369
  self.logger.error(f"Attempt {attempt}: The connection has been unexpectedly closed by: {url}. Retrying...")
370
370
  continue
371
371
 
372
- except httpx.RequestError as e:
372
+ except (httpx.RequestError, httpx.ConnectError) as e:
373
373
  self.logger.error(f"Attempt {attempt}: Request error for URL {url}: {e}")
374
+
375
+ if "CERTIFICATE_VERIFY_FAILED" in str(e):
376
+ raise ProxySSLError("Proxy has an invalid SSL certificate, to get around this error, set 'verify = False' in config")
377
+
374
378
  self.logger.info(f"Retrying ({attempt}/{self.config.max_retries}) for URL: {url}")
375
379
  continue # Continuing even failed requests, because they may succeed on another try (maybe idk)
376
380
 
@@ -42,3 +42,10 @@ class NetworkingError(Exception):
42
42
  def __init__(self, message):
43
43
  self.message = message
44
44
 
45
+
46
+ class ProxySSLError(Exception):
47
+ """
48
+ Raises if a proxy request fails due to self-signed certificates or invalid TLS verification
49
+ """
50
+ def __init__(self, message):
51
+ self.message = message
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eaf_base_api
3
- Version: 2.3.7
3
+ Version: 2.3.8
4
4
  Summary: A base API for EchterAlsFake's Porn APIs
5
5
  Home-page: https://github.com/EchterAlsFake/eaf_base_api
6
6
  Author: Johannes Habel
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="eaf_base_api",
5
- version="2.3.7",
5
+ version="2.3.8",
6
6
  packages=find_packages(),
7
7
  install_requires=["m3u8", "httpx"],
8
8
  extras_require={
File without changes
File without changes
File without changes