lacuscore 1.16.5__py3-none-any.whl → 1.17.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/helpers.py CHANGED
@@ -15,40 +15,12 @@ from defang import refang
15
15
  from pydantic import BaseModel, field_validator, model_validator, ValidationError
16
16
  from pydantic_core import from_json
17
17
 
18
- from playwrightcapture.capture import CaptureResponse as PlaywrightCaptureResponse
19
-
18
+ from playwrightcapture import CaptureResponse as PlaywrightCaptureResponse, SetCookieParam, Cookie
20
19
 
21
20
  if sys.version_info < (3, 12):
22
- # This bit is required as long as we need to support python < 3.12, stop removing it, you idiot
23
- # That's the runtime failure: https://github.com/ail-project/lacus/actions/runs/16447900822/job/46484807036
24
- # And the MyPy failure: https://github.com/ail-project/LacusCore/actions/runs/16447753492/job/46484287947
25
21
  from typing_extensions import TypedDict
26
-
27
- class SetCookieParam(TypedDict, total=False):
28
- name: str
29
- value: str
30
- url: str
31
- domain: str
32
- path: str
33
- expires: float
34
- httpOnly: bool
35
- secure: bool
36
- sameSite: Literal["Lax", "None", "Strict"]
37
- partitionKey: str
38
-
39
- class Cookie(TypedDict, total=False):
40
- name: str
41
- value: str
42
- domain: str
43
- path: str
44
- expires: float
45
- httpOnly: bool
46
- secure: bool
47
- sameSite: Literal["Lax", "None", "Strict"]
48
- partitionKey: str
49
22
  else:
50
23
  from typing import TypedDict
51
- from playwright._impl._api_structures import SetCookieParam, Cookie # , StorageState
52
24
 
53
25
 
54
26
  class LacusCoreException(Exception):
lacuscore/lacuscore.py CHANGED
@@ -55,10 +55,8 @@ else:
55
55
  if timeout_cm.expired():
56
56
  logger.warning(f'Timeout expired: {error_message}')
57
57
 
58
- if sys.version_info < (3, 12):
59
- from .helpers import SetCookieParam, Cookie
60
- else:
61
- from playwright._impl._api_structures import SetCookieParam, Cookie
58
+ if TYPE_CHECKING:
59
+ from playwrightcapture import SetCookieParam, Cookie
62
60
 
63
61
 
64
62
  BROWSER = Literal['chromium', 'firefox', 'webkit']
@@ -135,7 +133,7 @@ class LacusCore():
135
133
  proxy: str | dict[str, str] | None=None,
136
134
  socks5_dns_resolver: str | list[str] | None=None,
137
135
  general_timeout_in_sec: int | None=None,
138
- cookies: list[dict[str, Any]] | list[Cookie] | None=None,
136
+ cookies: list[dict[str, Any]] | list[SetCookieParam] | None=None,
139
137
  storage: dict[str, Any] | None=None,
140
138
  headers: dict[str, str] | None=None,
141
139
  http_credentials: dict[str, str] | None=None,
@@ -170,7 +168,7 @@ class LacusCore():
170
168
  proxy: str | dict[str, str] | None=None,
171
169
  socks5_dns_resolver: str | list[str] | None=None,
172
170
  general_timeout_in_sec: int | None=None,
173
- cookies: list[dict[str, Any]] | list[Cookie] | None=None,
171
+ cookies: str | dict[str, str] | list[dict[str, Any]] | list[SetCookieParam] | list[Cookie] | None=None,
174
172
  storage: dict[str, Any] | None=None,
175
173
  headers: dict[str, str] | None=None,
176
174
  http_credentials: dict[str, str] | None=None,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lacuscore
3
- Version: 1.16.5
3
+ Version: 1.17.0
4
4
  Summary: Core of Lacus, usable as a module
5
5
  License: BSD-3-Clause
6
6
  Author: Raphaël Vinot
@@ -26,10 +26,10 @@ 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.6)
29
+ Requires-Dist: playwrightcapture[recaptcha] (>=1.32.0)
30
30
  Requires-Dist: pydantic (>=2.11.7)
31
31
  Requires-Dist: redis[hiredis] (>=5.3.0,<6.0.0)
32
- Requires-Dist: requests (>=2.32.4)
32
+ Requires-Dist: requests (>=2.32.5)
33
33
  Requires-Dist: typing-extensions (>=4.12.2,<5.0.0) ; python_version < "3.12"
34
34
  Requires-Dist: ua-parser[regex] (>=1.0.1)
35
35
  Project-URL: Documentation, https://lacuscore.readthedocs.io/en/latest/
@@ -0,0 +1,10 @@
1
+ lacuscore/__init__.py,sha256=aLBshQPT9IBDKn5qWrX9A_exqtLFPyLsQiPWdfpAFjA,537
2
+ lacuscore/helpers.py,sha256=dTt-FM7SnwEgIeGTCAvREwa1K224iNb16mmaCwcY_eg,14096
3
+ lacuscore/lacus_monitoring.py,sha256=r6IaYuh6sMq43eOWdZx0fU8p4PWVZlqSD6nr6yOaTUU,2713
4
+ lacuscore/lacuscore.py,sha256=oIFNl5Ybcel2Fa5kzGpzJM0v5wgHy_bHUqrYS1ijOlQ,45132
5
+ lacuscore/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ lacuscore/task_logger.py,sha256=2wDotU6r6vn-aKO8nZNdxSuisSj11LlcxuvW60qPL0Y,1909
7
+ lacuscore-1.17.0.dist-info/LICENSE,sha256=4C4hLYrIkUD96Ggk-y_Go1Qf7PBZrEm9PSeTGe2nd4s,1516
8
+ lacuscore-1.17.0.dist-info/METADATA,sha256=VPB1r8b1hWkOb5DwfuaMZjWQiUpQE3wiLDpo5zaBSDk,2654
9
+ lacuscore-1.17.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
10
+ lacuscore-1.17.0.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- lacuscore/__init__.py,sha256=aLBshQPT9IBDKn5qWrX9A_exqtLFPyLsQiPWdfpAFjA,537
2
- lacuscore/helpers.py,sha256=xKrvwFsemad1aBVCboZ_jbvGK0Knxs04cQGhmhRQ2lA,15042
3
- lacuscore/lacus_monitoring.py,sha256=r6IaYuh6sMq43eOWdZx0fU8p4PWVZlqSD6nr6yOaTUU,2713
4
- lacuscore/lacuscore.py,sha256=fCZDyfuPCUygwDEYHlvh2345g1EnUjrV91sIWGDF4k8,45160
5
- lacuscore/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- lacuscore/task_logger.py,sha256=2wDotU6r6vn-aKO8nZNdxSuisSj11LlcxuvW60qPL0Y,1909
7
- lacuscore-1.16.5.dist-info/LICENSE,sha256=4C4hLYrIkUD96Ggk-y_Go1Qf7PBZrEm9PSeTGe2nd4s,1516
8
- lacuscore-1.16.5.dist-info/METADATA,sha256=DtwNjje1j1MMhZJkLq6PomF-2v2DT7w1DYzkBnLtY44,2654
9
- lacuscore-1.16.5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
10
- lacuscore-1.16.5.dist-info/RECORD,,