eaf_base_api 3.2.1__tar.gz → 3.2.2__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.1 → eaf_base_api-3.2.2}/PKG-INFO +1 -1
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.2}/base_api/base.py +7 -1
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.2}/base_api/modules/type_hints.py +7 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.2}/pyproject.toml +4 -2
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.2}/LICENSE +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.2}/README.md +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.2}/base_api/__init__.py +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.2}/base_api/modules/__init__.py +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.2}/base_api/modules/config.py +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.2}/base_api/modules/errors.py +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.2}/base_api/modules/logger.py +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.2}/base_api/modules/progress_bars.py +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.2}/base_api/modules/static_functions.py +0 -0
|
@@ -259,6 +259,12 @@ class Helper:
|
|
|
259
259
|
if asyncio.iscoroutine(video_instance):
|
|
260
260
|
video_instance = await video_instance
|
|
261
261
|
|
|
262
|
+
# Automatically call and await the init method if available (async initialization)
|
|
263
|
+
if hasattr(video_instance, "init") and callable(video_instance.init):
|
|
264
|
+
init_result = video_instance.init()
|
|
265
|
+
if asyncio.iscoroutine(init_result):
|
|
266
|
+
await init_result
|
|
267
|
+
|
|
262
268
|
elapsed_ms = (time.perf_counter() - start_timestamp) * 1000
|
|
263
269
|
logger.debug("video_init ok url=%s (%.2f ms)", video_url, elapsed_ms)
|
|
264
270
|
return video_instance
|
|
@@ -1437,7 +1443,7 @@ a new Python file, import only m3u8 and see what error you get.
|
|
|
1437
1443
|
|
|
1438
1444
|
try:
|
|
1439
1445
|
_, segment_data, is_success = await self.download_segment(url, timeout, stop_event)
|
|
1440
|
-
if is_success and
|
|
1446
|
+
if is_success and segment_data:
|
|
1441
1447
|
return idx, True, segment_data
|
|
1442
1448
|
except Exception as exception:
|
|
1443
1449
|
self.logger.error(f"Worker exception for segment {idx}: {exception}")
|
|
@@ -18,6 +18,9 @@ class DownloadState:
|
|
|
18
18
|
missing: list[int]
|
|
19
19
|
segments: list[str]
|
|
20
20
|
|
|
21
|
+
def __getitem__(self, key: str) -> Any:
|
|
22
|
+
return getattr(self, key)
|
|
23
|
+
|
|
21
24
|
|
|
22
25
|
# Download state is used for the literal file that tracks it
|
|
23
26
|
@dataclass
|
|
@@ -32,3 +35,7 @@ class DownloadReport:
|
|
|
32
35
|
start_segment: int
|
|
33
36
|
quality: str | int
|
|
34
37
|
|
|
38
|
+
def __getitem__(self, key: str) -> Any:
|
|
39
|
+
return getattr(self, key)
|
|
40
|
+
|
|
41
|
+
|
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "eaf_base_api"
|
|
7
|
-
version = "3.2.
|
|
7
|
+
version = "3.2.2"
|
|
8
8
|
description = "A base API for EchterAlsFake's Porn APIs"
|
|
9
9
|
readme = { file = "README.md", content-type = "text/markdown" }
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -46,5 +46,7 @@ module-name = "base_api" # Because I named it differently we need to change here
|
|
|
46
46
|
dev = [
|
|
47
47
|
"mypy",
|
|
48
48
|
"types-m3u8",
|
|
49
|
-
"pylint"
|
|
49
|
+
"pylint",
|
|
50
|
+
"pytest",
|
|
51
|
+
"pytest-asyncio"
|
|
50
52
|
]
|
|
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
|