eaf_base_api 3.2__tar.gz → 3.2.1__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-3.2 → eaf_base_api-3.2.1}/PKG-INFO +2 -3
- {eaf_base_api-3.2 → eaf_base_api-3.2.1}/base_api/base.py +6 -6
- {eaf_base_api-3.2 → eaf_base_api-3.2.1}/pyproject.toml +5 -5
- {eaf_base_api-3.2 → eaf_base_api-3.2.1}/LICENSE +0 -0
- {eaf_base_api-3.2 → eaf_base_api-3.2.1}/README.md +0 -0
- {eaf_base_api-3.2 → eaf_base_api-3.2.1}/base_api/__init__.py +0 -0
- {eaf_base_api-3.2 → eaf_base_api-3.2.1}/base_api/modules/__init__.py +0 -0
- {eaf_base_api-3.2 → eaf_base_api-3.2.1}/base_api/modules/config.py +0 -0
- {eaf_base_api-3.2 → eaf_base_api-3.2.1}/base_api/modules/errors.py +0 -0
- {eaf_base_api-3.2 → eaf_base_api-3.2.1}/base_api/modules/logger.py +0 -0
- {eaf_base_api-3.2 → eaf_base_api-3.2.1}/base_api/modules/progress_bars.py +0 -0
- {eaf_base_api-3.2 → eaf_base_api-3.2.1}/base_api/modules/static_functions.py +0 -0
- {eaf_base_api-3.2 → eaf_base_api-3.2.1}/base_api/modules/type_hints.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: eaf_base_api
|
|
3
|
-
Version: 3.2
|
|
3
|
+
Version: 3.2.1
|
|
4
4
|
Summary: A base API for EchterAlsFake's Porn APIs
|
|
5
5
|
Author: Johannes Habel
|
|
6
6
|
Author-email: Johannes Habel <EchterAlsFake@proton.me>
|
|
@@ -8,11 +8,10 @@ License-Expression: LGPL-3.0-or-later
|
|
|
8
8
|
License-File: LICENSE
|
|
9
9
|
Classifier: Programming Language :: Python
|
|
10
10
|
Requires-Dist: curl-cffi
|
|
11
|
-
Requires-Dist: pylint>=3.3.9
|
|
12
11
|
Requires-Dist: tenacity>=9.1.2
|
|
13
12
|
Requires-Dist: m3u8 ; extra == 'hls'
|
|
14
13
|
Requires-Dist: av ; python_full_version >= '3.10' and extra == 'hls'
|
|
15
|
-
Requires-Python: >=3.
|
|
14
|
+
Requires-Python: >=3.10
|
|
16
15
|
Project-URL: Homepage, https://github.com/EchterAlsFake/eaf_base_api
|
|
17
16
|
Project-URL: Repository, https://github.com/EchterAlsFake/eaf_base_api
|
|
18
17
|
Provides-Extra: hls
|
|
@@ -1939,8 +1939,8 @@ allow_multipart=%s""", url, path, max_retries, read_timeout, bool(stop_event and
|
|
|
1939
1939
|
|
|
1940
1940
|
async def download_chunk(start_chunk: int, end_chunk: int, chunk_idx_now: int) -> bool:
|
|
1941
1941
|
nonlocal total_downloaded
|
|
1942
|
-
headers_chunk = {"Range": f"bytes={
|
|
1943
|
-
chunk_progress[
|
|
1942
|
+
headers_chunk = {"Range": f"bytes={start_chunk}-{end_chunk}", "Accept-Encoding": "identity"}
|
|
1943
|
+
chunk_progress[chunk_idx_now] = 0
|
|
1944
1944
|
|
|
1945
1945
|
for attempt_chunk in range(max_retries + 1):
|
|
1946
1946
|
if stop_event is not None and stop_event.is_set():
|
|
@@ -1972,18 +1972,18 @@ allow_multipart=%s""", url, path, max_retries, read_timeout, bool(stop_event and
|
|
|
1972
1972
|
elif progress_bar:
|
|
1973
1973
|
progress_bar.text_progress_bar(downloaded=total_downloaded[0], total=file_size)
|
|
1974
1974
|
finally:
|
|
1975
|
-
await asyncio.to_thread(
|
|
1975
|
+
await asyncio.to_thread(file.close)
|
|
1976
1976
|
|
|
1977
1977
|
return True # Chunk success
|
|
1978
1978
|
|
|
1979
1979
|
except Exception as exc:
|
|
1980
|
-
if
|
|
1980
|
+
if attempt_chunk < max_retries:
|
|
1981
1981
|
self.logger.warning("Chunk %s failed (attempt %s/%s): %s",
|
|
1982
|
-
chunk_idx_now,
|
|
1982
|
+
chunk_idx_now, attempt_chunk + 1, max_retries, exc)
|
|
1983
1983
|
# Reset progress for this chunk before retry
|
|
1984
1984
|
total_downloaded[0] -= chunk_progress[chunk_idx_now]
|
|
1985
1985
|
chunk_progress[chunk_idx_now] = 0
|
|
1986
|
-
await asyncio.sleep(1 *
|
|
1986
|
+
await asyncio.sleep(1 * attempt_chunk)
|
|
1987
1987
|
else:
|
|
1988
1988
|
self.logger.error("Chunk %s permanently failed: %s", chunk_idx_now, exc)
|
|
1989
1989
|
return False
|
|
@@ -4,10 +4,10 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "eaf_base_api"
|
|
7
|
-
version = "3.2"
|
|
7
|
+
version = "3.2.1"
|
|
8
8
|
description = "A base API for EchterAlsFake's Porn APIs"
|
|
9
9
|
readme = { file = "README.md", content-type = "text/markdown" }
|
|
10
|
-
requires-python = ">=3.
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
11
|
license = "LGPL-3.0-or-later"
|
|
12
12
|
license-files = ["LICENSE*"]
|
|
13
13
|
|
|
@@ -21,7 +21,6 @@ classifiers = [
|
|
|
21
21
|
|
|
22
22
|
dependencies = [
|
|
23
23
|
"curl_cffi",
|
|
24
|
-
"pylint>=3.3.9",
|
|
25
24
|
"tenacity>=9.1.2",
|
|
26
25
|
]
|
|
27
26
|
|
|
@@ -45,6 +44,7 @@ module-name = "base_api" # Because I named it differently we need to change here
|
|
|
45
44
|
|
|
46
45
|
[dependency-groups]
|
|
47
46
|
dev = [
|
|
48
|
-
"mypy
|
|
49
|
-
"types-m3u8
|
|
47
|
+
"mypy",
|
|
48
|
+
"types-m3u8",
|
|
49
|
+
"pylint"
|
|
50
50
|
]
|
|
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
|