eaf_base_api 3.2.1__tar.gz → 3.2.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-3.2.1 → eaf_base_api-3.2.3}/PKG-INFO +1 -1
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.3}/base_api/base.py +11 -1
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.3}/base_api/modules/type_hints.py +7 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.3}/pyproject.toml +4 -2
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.3}/LICENSE +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.3}/README.md +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.3}/base_api/__init__.py +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.3}/base_api/modules/__init__.py +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.3}/base_api/modules/config.py +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.3}/base_api/modules/errors.py +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.3}/base_api/modules/logger.py +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.3}/base_api/modules/progress_bars.py +0 -0
- {eaf_base_api-3.2.1 → eaf_base_api-3.2.3}/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
|
|
@@ -1196,6 +1202,10 @@ a new Python file, import only m3u8 and see what error you get.
|
|
|
1196
1202
|
self.logger.debug("download: no callback provided, using default text progress bar")
|
|
1197
1203
|
|
|
1198
1204
|
m3u8_url = getattr(video, "m3u8_base_url", None)
|
|
1205
|
+
|
|
1206
|
+
if asyncio.iscoroutine(m3u8_url):
|
|
1207
|
+
m3u8_url = await m3u8_url # For youporn api
|
|
1208
|
+
|
|
1199
1209
|
self.logger.info(
|
|
1200
1210
|
"""
|
|
1201
1211
|
Download requested: quality=%s path=%s remux=%s max_workers=%s
|
|
@@ -1437,7 +1447,7 @@ a new Python file, import only m3u8 and see what error you get.
|
|
|
1437
1447
|
|
|
1438
1448
|
try:
|
|
1439
1449
|
_, segment_data, is_success = await self.download_segment(url, timeout, stop_event)
|
|
1440
|
-
if is_success and
|
|
1450
|
+
if is_success and segment_data:
|
|
1441
1451
|
return idx, True, segment_data
|
|
1442
1452
|
except Exception as exception:
|
|
1443
1453
|
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.3"
|
|
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
|