eaf-base-api 1.6.2__tar.gz → 1.6.3__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.1
2
2
  Name: eaf_base_api
3
- Version: 1.6.2
3
+ Version: 1.6.3
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
@@ -8,8 +8,6 @@ from base_api.modules.quality import Quality
8
8
  from base_api.modules.progress_bars import Callback
9
9
  from base_api.modules.download import default, threaded, FFMPEG
10
10
  from base_api.modules.consts import MAX_RETRIES, REQUEST_DELAY
11
- from pathlib import Path
12
-
13
11
 
14
12
  def setup_api(do_logging=False):
15
13
  if do_logging:
@@ -29,7 +27,6 @@ class Core:
29
27
  def get_content(self, url, headers=None, cookies=None, stream=False):
30
28
  for i in range(MAX_RETRIES):
31
29
  try:
32
-
33
30
  # Delay mechanism
34
31
  if self.last_request_time:
35
32
  elapsed_time = time.time() - self.last_request_time
@@ -43,12 +40,16 @@ class Core:
43
40
  if response.status_code == 200:
44
41
  logging.info(f"Successfully fetched {url} on attempt [{i+1}]")
45
42
  return response.content
43
+
46
44
  else:
47
45
  logging.warning(f"Failed to fetch {url} with status code {response.status_code} on attempt [{i+1}]")
46
+
48
47
  except requests.exceptions.RequestException as e:
49
48
  logging.error(f"Exception occurred when trying to fetch {url} on attempt [{i+1}]: {e}")
49
+
50
50
  if i < MAX_RETRIES - 1: # Implement exponential backoff
51
51
  time.sleep(2 ** i)
52
+
52
53
  logging.error(f"Failed to fetch {url} after {MAX_RETRIES} attempts.")
53
54
  logging.error("Returning None")
54
55
  return None
@@ -123,10 +124,6 @@ class Core:
123
124
  elif downloader == FFMPEG or str(downloader) == "FFMPEG":
124
125
  FFMPEG(video=video, quality=quality, path=path, callback=callback)
125
126
 
126
- @classmethod
127
- def correct_path(cls, path):
128
- return Path(path)
129
-
130
127
  @classmethod
131
128
  def get_segments(cls, quality, m3u8_base_url, base_qualities, seperator, source=1):
132
129
  quality = Core().fix_quality(quality)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eaf_base_api
3
- Version: 1.6.2
3
+ Version: 1.6.3
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="1.6.2",
5
+ version="1.6.3",
6
6
  packages=find_packages(),
7
7
  install_requires=[
8
8
  "requests", "ffmpeg-progress-yield"
File without changes
File without changes