lacuscore 1.16.4__py3-none-any.whl → 1.16.6__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,16 +15,13 @@ 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
21
  from typing_extensions import TypedDict
23
22
  else:
24
23
  from typing import TypedDict
25
24
 
26
- from playwright._impl._api_structures import Cookie # , StorageState
27
-
28
25
 
29
26
  class LacusCoreException(Exception):
30
27
  pass
@@ -107,7 +104,7 @@ class CaptureSettings(BaseModel):
107
104
  proxy: str | dict[str, str] | None = None
108
105
  socks5_dns_resolver: str | list[str] | None = None
109
106
  general_timeout_in_sec: int | None = None
110
- cookies: list[Cookie] | None = None
107
+ cookies: list[SetCookieParam] | None = None
111
108
  # NOTE: should be that, but StorageState doesn't define the indexeddb
112
109
  # storage: StorageState | None = None
113
110
  storage: dict[str, Any] | None = None
@@ -242,8 +239,8 @@ class CaptureSettings(BaseModel):
242
239
  try:
243
240
  cookies = json.loads(cookies)
244
241
  except json.JSONDecodeError as e:
245
- print(e)
246
242
  # Cookies are invalid, ignoring.
243
+ print(f'Broken cookie: {e}')
247
244
  return None
248
245
  if isinstance(cookies, dict):
249
246
  # might be a single cookie in the format name: value, make it a list
lacuscore/lacuscore.py CHANGED
@@ -56,7 +56,7 @@ else:
56
56
  logger.warning(f'Timeout expired: {error_message}')
57
57
 
58
58
  if TYPE_CHECKING:
59
- from playwright._impl._api_structures import Cookie
59
+ from playwrightcapture import SetCookieParam
60
60
 
61
61
 
62
62
  BROWSER = Literal['chromium', 'firefox', 'webkit']
@@ -133,7 +133,7 @@ class LacusCore():
133
133
  proxy: str | dict[str, str] | None=None,
134
134
  socks5_dns_resolver: str | list[str] | None=None,
135
135
  general_timeout_in_sec: int | None=None,
136
- cookies: list[dict[str, Any]] | list[Cookie] | None=None,
136
+ cookies: list[dict[str, Any]] | list[SetCookieParam] | None=None,
137
137
  storage: dict[str, Any] | None=None,
138
138
  headers: dict[str, str] | None=None,
139
139
  http_credentials: dict[str, str] | None=None,
@@ -168,7 +168,7 @@ class LacusCore():
168
168
  proxy: str | dict[str, str] | None=None,
169
169
  socks5_dns_resolver: str | list[str] | None=None,
170
170
  general_timeout_in_sec: int | None=None,
171
- cookies: list[dict[str, Any]] | list[Cookie] | None=None,
171
+ cookies: list[dict[str, Any]] | list[SetCookieParam] | None=None,
172
172
  storage: dict[str, Any] | None=None,
173
173
  headers: dict[str, str] | None=None,
174
174
  http_credentials: dict[str, str] | None=None,
@@ -503,7 +503,7 @@ class LacusCore():
503
503
  else:
504
504
  browser_engine = 'webkit'
505
505
 
506
- cookies: list[Cookie] = []
506
+ cookies: list[SetCookieParam] = []
507
507
  if to_capture.cookies:
508
508
  # In order to properly pass the cookies to playwright,
509
509
  # each of then must have a name, a value and either a domain + path or a URL
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lacuscore
3
- Version: 1.16.4
3
+ Version: 1.16.6
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.5)
29
+ Requires-Dist: playwrightcapture[recaptcha] (>=1.31.7)
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=dTt-FM7SnwEgIeGTCAvREwa1K224iNb16mmaCwcY_eg,14096
3
+ lacuscore/lacus_monitoring.py,sha256=r6IaYuh6sMq43eOWdZx0fU8p4PWVZlqSD6nr6yOaTUU,2713
4
+ lacuscore/lacuscore.py,sha256=UTaMvDCGIzrs2K2GAOpBj6DQTJIQ_I0BrjQmJ1BXA9s,45086
5
+ lacuscore/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ lacuscore/task_logger.py,sha256=2wDotU6r6vn-aKO8nZNdxSuisSj11LlcxuvW60qPL0Y,1909
7
+ lacuscore-1.16.6.dist-info/LICENSE,sha256=4C4hLYrIkUD96Ggk-y_Go1Qf7PBZrEm9PSeTGe2nd4s,1516
8
+ lacuscore-1.16.6.dist-info/METADATA,sha256=tj2PdgbP3l3ROjVt-Xvt32gvdgPOadCXC1eAFuLESCQ,2654
9
+ lacuscore-1.16.6.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
10
+ lacuscore-1.16.6.dist-info/RECORD,,
@@ -1,10 +0,0 @@
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,,