lacuscore 1.16.2__py3-none-any.whl → 1.16.4__py3-none-any.whl
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.
- lacuscore/helpers.py +3 -11
- lacuscore/lacuscore.py +5 -0
- {lacuscore-1.16.2.dist-info → lacuscore-1.16.4.dist-info}/METADATA +2 -2
- lacuscore-1.16.4.dist-info/RECORD +10 -0
- lacuscore-1.16.2.dist-info/RECORD +0 -10
- {lacuscore-1.16.2.dist-info → lacuscore-1.16.4.dist-info}/LICENSE +0 -0
- {lacuscore-1.16.2.dist-info → lacuscore-1.16.4.dist-info}/WHEEL +0 -0
lacuscore/helpers.py
CHANGED
@@ -20,19 +20,10 @@ from playwrightcapture.capture import CaptureResponse as PlaywrightCaptureRespon
|
|
20
20
|
|
21
21
|
if sys.version_info < (3, 12):
|
22
22
|
from typing_extensions import TypedDict
|
23
|
-
|
24
|
-
class Cookie(TypedDict, total=False):
|
25
|
-
name: str
|
26
|
-
value: str
|
27
|
-
domain: str
|
28
|
-
path: str
|
29
|
-
expires: float
|
30
|
-
httpOnly: bool
|
31
|
-
secure: bool
|
32
|
-
sameSite: Literal["Lax", "None", "Strict"]
|
33
23
|
else:
|
34
24
|
from typing import TypedDict
|
35
|
-
|
25
|
+
|
26
|
+
from playwright._impl._api_structures import Cookie # , StorageState
|
36
27
|
|
37
28
|
|
38
29
|
class LacusCoreException(Exception):
|
@@ -133,6 +124,7 @@ class CaptureSettings(BaseModel):
|
|
133
124
|
with_favicon: bool = True
|
134
125
|
allow_tracking: bool = False
|
135
126
|
headless: bool = True
|
127
|
+
init_script: str | None = None
|
136
128
|
force: bool = False
|
137
129
|
recapture_interval: int = 300
|
138
130
|
priority: int = 0
|
lacuscore/lacuscore.py
CHANGED
@@ -150,6 +150,7 @@ class LacusCore():
|
|
150
150
|
allow_tracking: bool=False,
|
151
151
|
headless: bool=True,
|
152
152
|
max_retries: int | None=None,
|
153
|
+
init_script: str | None=None,
|
153
154
|
force: bool=False,
|
154
155
|
recapture_interval: int=300,
|
155
156
|
priority: int=0,
|
@@ -184,6 +185,7 @@ class LacusCore():
|
|
184
185
|
allow_tracking: bool=False,
|
185
186
|
headless: bool=True,
|
186
187
|
max_retries: int | None=None,
|
188
|
+
init_script: str | None=None,
|
187
189
|
force: bool=False,
|
188
190
|
recapture_interval: int=300,
|
189
191
|
priority: int=0,
|
@@ -220,6 +222,7 @@ class LacusCore():
|
|
220
222
|
:param allow_tracking: If True, PlaywrightCapture will attempt to click through the cookie banners. It is totally dependent on the framework used on the website.
|
221
223
|
:param headless: Whether to run the browser in headless mode. WARNING: requires to run in a graphical environment.
|
222
224
|
:param max_retries: The maximum anount of retries for this capture
|
225
|
+
:param init_script: A JavaScript that will be executed on each page of the capture.
|
223
226
|
|
224
227
|
:param force: Force recapture, even if the same one was already done within the recapture_interval
|
225
228
|
:param recapture_interval: The time the enqueued settings are kept in memory to avoid duplicates
|
@@ -243,6 +246,7 @@ class LacusCore():
|
|
243
246
|
'allow_tracking': allow_tracking,
|
244
247
|
# Quietly force it to true if headed is not allowed.
|
245
248
|
'headless': headless if self.headed_allowed else True,
|
249
|
+
'init_script': init_script,
|
246
250
|
'max_retries': max_retries}
|
247
251
|
try:
|
248
252
|
to_enqueue = CaptureSettings(**settings)
|
@@ -529,6 +533,7 @@ class LacusCore():
|
|
529
533
|
general_timeout_in_sec=to_capture.general_timeout_in_sec,
|
530
534
|
loglevel=self.master_logger.getEffectiveLevel(),
|
531
535
|
headless=to_capture.headless,
|
536
|
+
init_script=to_capture.init_script,
|
532
537
|
uuid=uuid) as capture:
|
533
538
|
# required by Mypy: https://github.com/python/mypy/issues/3004
|
534
539
|
capture.headers = to_capture.headers
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: lacuscore
|
3
|
-
Version: 1.16.
|
3
|
+
Version: 1.16.4
|
4
4
|
Summary: Core of Lacus, usable as a module
|
5
5
|
License: BSD-3-Clause
|
6
6
|
Author: Raphaël Vinot
|
@@ -26,7 +26,7 @@ Requires-Dist: async-timeout (>=5.0.1) ; python_version < "3.11"
|
|
26
26
|
Requires-Dist: defang (>=0.5.3)
|
27
27
|
Requires-Dist: dnspython (>=2.7.0)
|
28
28
|
Requires-Dist: eval-type-backport (>=0.2.2) ; python_version < "3.10"
|
29
|
-
Requires-Dist: playwrightcapture[recaptcha] (>=1.31.
|
29
|
+
Requires-Dist: playwrightcapture[recaptcha] (>=1.31.5)
|
30
30
|
Requires-Dist: pydantic (>=2.11.7)
|
31
31
|
Requires-Dist: redis[hiredis] (>=5.3.0,<6.0.0)
|
32
32
|
Requires-Dist: requests (>=2.32.4)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
lacuscore/__init__.py,sha256=aLBshQPT9IBDKn5qWrX9A_exqtLFPyLsQiPWdfpAFjA,537
|
2
|
+
lacuscore/helpers.py,sha256=cWH-Y2_XKMVlByczH8I8u4-pDCPgbFfdUw9SBQVpQxo,14124
|
3
|
+
lacuscore/lacus_monitoring.py,sha256=r6IaYuh6sMq43eOWdZx0fU8p4PWVZlqSD6nr6yOaTUU,2713
|
4
|
+
lacuscore/lacuscore.py,sha256=8Z3ES5865I-6mqgrhAcu52PIRxUPWmDChxSZhHLuawQ,45069
|
5
|
+
lacuscore/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
lacuscore/task_logger.py,sha256=2wDotU6r6vn-aKO8nZNdxSuisSj11LlcxuvW60qPL0Y,1909
|
7
|
+
lacuscore-1.16.4.dist-info/LICENSE,sha256=4C4hLYrIkUD96Ggk-y_Go1Qf7PBZrEm9PSeTGe2nd4s,1516
|
8
|
+
lacuscore-1.16.4.dist-info/METADATA,sha256=kA3k7wrywae6WnN8gCX6OsAnKqtNw87RXKa_r1ej3wU,2654
|
9
|
+
lacuscore-1.16.4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
10
|
+
lacuscore-1.16.4.dist-info/RECORD,,
|
@@ -1,10 +0,0 @@
|
|
1
|
-
lacuscore/__init__.py,sha256=aLBshQPT9IBDKn5qWrX9A_exqtLFPyLsQiPWdfpAFjA,537
|
2
|
-
lacuscore/helpers.py,sha256=dZjKKSp_4nFlRwvJmB6U8n0TAG2UL5JQjHdng14TX1c,14328
|
3
|
-
lacuscore/lacus_monitoring.py,sha256=r6IaYuh6sMq43eOWdZx0fU8p4PWVZlqSD6nr6yOaTUU,2713
|
4
|
-
lacuscore/lacuscore.py,sha256=I7jQ83-2vDdd4UBWHR0VHQChsWv_CL4F3XzkbW6q3ZI,44773
|
5
|
-
lacuscore/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
lacuscore/task_logger.py,sha256=2wDotU6r6vn-aKO8nZNdxSuisSj11LlcxuvW60qPL0Y,1909
|
7
|
-
lacuscore-1.16.2.dist-info/LICENSE,sha256=4C4hLYrIkUD96Ggk-y_Go1Qf7PBZrEm9PSeTGe2nd4s,1516
|
8
|
-
lacuscore-1.16.2.dist-info/METADATA,sha256=KHGm2s7CfZ9DbYu8bO9N_V_Taw7UJkwXAZ_1wcuceGw,2654
|
9
|
-
lacuscore-1.16.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
10
|
-
lacuscore-1.16.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|