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.
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/PKG-INFO +1 -1
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/base_api/base.py +4 -7
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/eaf_base_api.egg-info/PKG-INFO +1 -1
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/setup.py +1 -1
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/README.md +0 -0
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/base_api/__init__.py +0 -0
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/base_api/modules/__init__.py +0 -0
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/base_api/modules/consts.py +0 -0
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/base_api/modules/download.py +0 -0
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/base_api/modules/progress_bars.py +0 -0
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/base_api/modules/quality.py +0 -0
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/eaf_base_api.egg-info/SOURCES.txt +0 -0
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/eaf_base_api.egg-info/dependency_links.txt +0 -0
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/eaf_base_api.egg-info/requires.txt +0 -0
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/eaf_base_api.egg-info/top_level.txt +0 -0
- {eaf_base_api-1.6.2 → eaf_base_api-1.6.3}/setup.cfg +0 -0
|
@@ -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)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|