lacuscore 1.8.9__py3-none-any.whl → 1.9.0__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/lacuscore.py +9 -2
- {lacuscore-1.8.9.dist-info → lacuscore-1.9.0.dist-info}/METADATA +2 -2
- lacuscore-1.9.0.dist-info/RECORD +8 -0
- lacuscore-1.8.9.dist-info/RECORD +0 -8
- {lacuscore-1.8.9.dist-info → lacuscore-1.9.0.dist-info}/LICENSE +0 -0
- {lacuscore-1.8.9.dist-info → lacuscore-1.9.0.dist-info}/WHEEL +0 -0
lacuscore/lacuscore.py
CHANGED
@@ -134,6 +134,7 @@ class CaptureSettings(TypedDict, total=False):
|
|
134
134
|
viewport: dict[str, int] | None
|
135
135
|
referer: str | None
|
136
136
|
with_favicon: bool
|
137
|
+
allow_tracking: bool
|
137
138
|
force: bool
|
138
139
|
recapture_interval: int
|
139
140
|
priority: int
|
@@ -213,6 +214,7 @@ class LacusCore():
|
|
213
214
|
referer: str | None=None,
|
214
215
|
rendered_hostname_only: bool=True,
|
215
216
|
with_favicon: bool=False,
|
217
|
+
allow_tracking: bool=False,
|
216
218
|
force: bool=False,
|
217
219
|
recapture_interval: int=300,
|
218
220
|
priority: int=0,
|
@@ -240,6 +242,7 @@ class LacusCore():
|
|
240
242
|
referer: str | None=None,
|
241
243
|
rendered_hostname_only: bool=True,
|
242
244
|
with_favicon: bool=False,
|
245
|
+
allow_tracking: bool=False,
|
243
246
|
force: bool=False,
|
244
247
|
recapture_interval: int=300,
|
245
248
|
priority: int=0,
|
@@ -269,6 +272,7 @@ class LacusCore():
|
|
269
272
|
:param referer: The referer URL for the capture
|
270
273
|
:param rendered_hostname_only: If depth > 0: only capture URLs with the same hostname as the rendered page
|
271
274
|
:param with_favicon: If True, PlaywrightCapture will attempt to get the potential favicons for the rendered URL. It is a dirty trick, see this issue for details: https://github.com/Lookyloo/PlaywrightCapture/issues/45
|
275
|
+
: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.
|
272
276
|
:param force: Force recapture, even if the same one was already done within the recapture_interval
|
273
277
|
:param recapture_interval: The time the enqueued settings are kept in memory to avoid duplicates
|
274
278
|
:param priority: The priority of the capture
|
@@ -324,6 +328,8 @@ class LacusCore():
|
|
324
328
|
to_enqueue['referer'] = referer
|
325
329
|
if with_favicon:
|
326
330
|
to_enqueue['with_favicon'] = with_favicon
|
331
|
+
if allow_tracking:
|
332
|
+
to_enqueue['allow_tracking'] = allow_tracking
|
327
333
|
|
328
334
|
hash_query = hashlib.sha512(pickle.dumps(to_enqueue)).hexdigest()
|
329
335
|
if not force:
|
@@ -471,7 +477,7 @@ class LacusCore():
|
|
471
477
|
'document', 'browser', 'device_name', 'user_agent', 'proxy',
|
472
478
|
'general_timeout_in_sec', 'cookies', 'headers', 'http_credentials',
|
473
479
|
'viewport', 'referer', 'geolocation', 'timezone_id', 'locale',
|
474
|
-
'color_scheme', 'with_favicon']
|
480
|
+
'color_scheme', 'with_favicon', 'allow_tracking']
|
475
481
|
result: CaptureResponse = {}
|
476
482
|
to_capture: CaptureSettings = {}
|
477
483
|
document_as_bytes = b''
|
@@ -496,7 +502,7 @@ class LacusCore():
|
|
496
502
|
elif k in ['general_timeout_in_sec', 'depth']:
|
497
503
|
# int
|
498
504
|
to_capture[k] = int(v) # type: ignore[literal-required]
|
499
|
-
elif k in ['rendered_hostname_only', 'with_favicon']:
|
505
|
+
elif k in ['rendered_hostname_only', 'with_favicon', 'allow_tracking']:
|
500
506
|
# bool
|
501
507
|
to_capture[k] = bool(int(v)) # type: ignore[literal-required]
|
502
508
|
elif k == 'document':
|
@@ -633,6 +639,7 @@ class LacusCore():
|
|
633
639
|
depth=to_capture.get('depth', 0),
|
634
640
|
rendered_hostname_only=to_capture.get('rendered_hostname_only', True),
|
635
641
|
with_favicon=to_capture.get('with_favicon', False),
|
642
|
+
allow_tracking=to_capture.get('allow_tracking', False),
|
636
643
|
max_depth_capture_time=self.max_capture_time)
|
637
644
|
result = cast(CaptureResponse, playwright_result)
|
638
645
|
if 'error' in result and 'error_name' in result:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: lacuscore
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.9.0
|
4
4
|
Summary: Core of Lacus, usable as a module
|
5
5
|
Home-page: https://github.com/ail-project/LacusCore
|
6
6
|
License: BSD-3-Clause
|
@@ -28,7 +28,7 @@ Requires-Dist: Sphinx (>=7.2,<8.0) ; (python_version >= "3.9") and (extra == "do
|
|
28
28
|
Requires-Dist: async-timeout (>=4.0.3,<5.0.0) ; python_version < "3.11"
|
29
29
|
Requires-Dist: defang (>=0.5.3,<0.6.0)
|
30
30
|
Requires-Dist: dnspython (>=2.6.1,<3.0.0)
|
31
|
-
Requires-Dist: playwrightcapture[recaptcha] (>=1.
|
31
|
+
Requires-Dist: playwrightcapture[recaptcha] (>=1.24.0,<2.0.0)
|
32
32
|
Requires-Dist: redis[hiredis] (>=5.0.3,<6.0.0)
|
33
33
|
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
34
34
|
Requires-Dist: ua-parser (>=0.18.0,<0.19.0)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
lacuscore/__init__.py,sha256=10JsUmjLD9xQIsjTDYT5nGowsJVe9C-FHNkaUFuAUtU,321
|
2
|
+
lacuscore/lacus_monitoring.py,sha256=UOfE_1-_rhVeKJXQ_m9XxYkr7VwyQnA6iK-x_tcXJfo,2775
|
3
|
+
lacuscore/lacuscore.py,sha256=UhcFsqQ00U5lv35Y2ctLE5ybryRuru3QJjlzLKSal9w,44397
|
4
|
+
lacuscore/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
+
lacuscore-1.9.0.dist-info/LICENSE,sha256=4C4hLYrIkUD96Ggk-y_Go1Qf7PBZrEm9PSeTGe2nd4s,1516
|
6
|
+
lacuscore-1.9.0.dist-info/METADATA,sha256=SHOpneBAkbhPpDqvqfeqFylCaJlR1wQjLgD5QI1g4uo,2628
|
7
|
+
lacuscore-1.9.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
8
|
+
lacuscore-1.9.0.dist-info/RECORD,,
|
lacuscore-1.8.9.dist-info/RECORD
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
lacuscore/__init__.py,sha256=10JsUmjLD9xQIsjTDYT5nGowsJVe9C-FHNkaUFuAUtU,321
|
2
|
-
lacuscore/lacus_monitoring.py,sha256=UOfE_1-_rhVeKJXQ_m9XxYkr7VwyQnA6iK-x_tcXJfo,2775
|
3
|
-
lacuscore/lacuscore.py,sha256=iI1Cz9gnhQo8dw7gPII_vCsGHB_wzv-_9cpB3jRDizw,43901
|
4
|
-
lacuscore/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
lacuscore-1.8.9.dist-info/LICENSE,sha256=4C4hLYrIkUD96Ggk-y_Go1Qf7PBZrEm9PSeTGe2nd4s,1516
|
6
|
-
lacuscore-1.8.9.dist-info/METADATA,sha256=L1ITEAiio8MB6NUSn-Yi9tAL6BaYMnz-VVKFg_2IX-A,2629
|
7
|
-
lacuscore-1.8.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
8
|
-
lacuscore-1.8.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|