PlaywrightCapture 1.26.0__tar.gz → 1.26.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PlaywrightCapture
3
- Version: 1.26.0
3
+ Version: 1.26.2
4
4
  Summary: A simple library to capture websites using playwright
5
5
  Home-page: https://github.com/Lookyloo/PlaywrightCapture
6
6
  License: BSD-3-Clause
@@ -17,22 +17,24 @@ Classifier: Programming Language :: Python :: 3.9
17
17
  Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
20
21
  Classifier: Topic :: Internet
21
22
  Classifier: Topic :: Security
22
23
  Provides-Extra: recaptcha
23
- Requires-Dist: SpeechRecognition (>=3.10.4,<4.0.0) ; extra == "recaptcha"
24
+ Requires-Dist: SpeechRecognition (<3.11) ; (python_version < "3.9") and (extra == "recaptcha")
25
+ Requires-Dist: SpeechRecognition (>=3.11) ; (python_version >= "3.9") and (extra == "recaptcha")
24
26
  Requires-Dist: aiohttp-socks (>=0.9,<0.10)
25
- Requires-Dist: aiohttp[speedups] (>=3.10.5,<4.0.0)
27
+ Requires-Dist: aiohttp[speedups] (>=3.10.10,<4.0.0)
26
28
  Requires-Dist: async-timeout (>=4.0.3,<5.0.0) ; python_version < "3.11"
27
29
  Requires-Dist: beautifulsoup4[charset-normalizer,lxml] (>=4.12.3,<5.0.0)
28
30
  Requires-Dist: dateparser (>=1.2.0,<2.0.0)
29
- Requires-Dist: playwright (>=1.47.0,<2.0.0)
31
+ Requires-Dist: playwright (>=1.48.0,<2.0.0)
30
32
  Requires-Dist: playwright-stealth (>=1.0.6,<2.0.0)
31
- Requires-Dist: puremagic (>=1.27,<2.0)
33
+ Requires-Dist: puremagic (>=1.28,<2.0)
32
34
  Requires-Dist: pydub (>=0.25.1,<0.26.0) ; extra == "recaptcha"
33
35
  Requires-Dist: pytz (>=2024.2,<2025.0) ; python_version < "3.9"
34
- Requires-Dist: setuptools (>=75.1.0,<76.0.0)
35
- Requires-Dist: tzdata (>=2024.1,<2025.0)
36
+ Requires-Dist: setuptools (>=75.2.0,<76.0.0)
37
+ Requires-Dist: tzdata (>=2024.2,<2025.0)
36
38
  Requires-Dist: w3lib (>=2.2.1,<3.0.0)
37
39
  Project-URL: Repository, https://github.com/Lookyloo/PlaywrightCapture
38
40
  Description-Content-Type: text/markdown
@@ -198,6 +198,7 @@ class Capture():
198
198
  self._timezone_id: str = ''
199
199
  self._locale: str = 'en-US'
200
200
  self._color_scheme: Literal['dark', 'light', 'no-preference', 'null'] | None = None
201
+ self._java_script_enabled = True
201
202
 
202
203
  def __prepare_proxy_playwright(self, proxy: str) -> ProxySettings:
203
204
  splitted = urlsplit(proxy)
@@ -426,6 +427,14 @@ class Capture():
426
427
  else:
427
428
  raise InvalidPlaywrightParameter(f'Invalid color scheme ({color_scheme}), must be in {", ".join(schemes)}.')
428
429
 
430
+ @property
431
+ def java_script_enabled(self) -> bool:
432
+ return self._java_script_enabled
433
+
434
+ @java_script_enabled.setter
435
+ def java_script_enabled(self, enabled: bool) -> None:
436
+ self._java_script_enabled = enabled
437
+
429
438
  async def initialize_context(self) -> None:
430
439
  device_context_settings = {}
431
440
  if self.device_name:
@@ -445,6 +454,7 @@ class Capture():
445
454
  record_har_path=self._temp_harfile.name,
446
455
  ignore_https_errors=True,
447
456
  bypass_csp=True,
457
+ java_script_enabled=self.java_script_enabled,
448
458
  http_credentials=self.http_credentials if self.http_credentials else None,
449
459
  user_agent=ua,
450
460
  locale=self.locale if self.locale else None,
@@ -1168,7 +1178,7 @@ class Capture():
1168
1178
  self.logger.warning("Unable to close page and context at the end of the capture.")
1169
1179
  self.should_retry = True
1170
1180
  except Exception as e:
1171
- self.logger.warning("Other exception while finishingup the capture: {e}.")
1181
+ self.logger.warning(f"Other exception while finishing up the capture: {e}.")
1172
1182
  if 'error' not in to_return:
1173
1183
  to_return['error'] = f'Unable to generate HAR file: {e}'
1174
1184
  self.logger.debug('Capture done')
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "PlaywrightCapture"
3
- version = "1.26.0"
3
+ version = "1.26.2"
4
4
  description = "A simple library to capture websites using playwright"
5
5
  authors = ["Raphaël Vinot <raphael.vinot@circl.lu>"]
6
6
  license = "BSD-3-Clause"
@@ -19,19 +19,22 @@ classifiers=[
19
19
 
20
20
  [tool.poetry.dependencies]
21
21
  python = "^3.8"
22
- playwright = "^1.47.0"
22
+ playwright = "^1.48.0"
23
23
  dateparser = "^1.2.0"
24
24
  beautifulsoup4 = {version= "^4.12.3", extras = ["lxml", "charset_normalizer"]}
25
25
  w3lib = "^2.2.1"
26
26
  pydub = {version = "^0.25.1", optional = true}
27
- SpeechRecognition = {version = "^3.10.4", optional = true}
27
+ SpeechRecognition = [
28
+ {version = "<3.11", python = "<3.9", optional = true},
29
+ {version = ">=3.11", python = ">=3.9", optional = true}
30
+ ]
28
31
  pytz = {"version" = "^2024.2", python = "<3.9"}
29
- tzdata = "^2024.1"
32
+ tzdata = "^2024.2"
30
33
  playwright-stealth = "^1.0.6"
31
- setuptools = "^75.1.0"
32
- puremagic = "^1.27"
34
+ setuptools = "^75.2.0"
35
+ puremagic = "^1.28"
33
36
  async-timeout = {version = "^4.0.3", python = "<3.11"}
34
- aiohttp = {extras = ["speedups"], version = "^3.10.5"}
37
+ aiohttp = {extras = ["speedups"], version = "^3.10.10"}
35
38
  aiohttp-socks = "^0.9"
36
39
 
37
40
  [tool.poetry.extras]
@@ -41,11 +44,11 @@ recaptcha = ["pydub", "SpeechRecognition"]
41
44
  optional = true
42
45
 
43
46
  [tool.poetry.group.dev.dependencies]
44
- types-beautifulsoup4 = "^4.12.0.20240907"
47
+ types-beautifulsoup4 = "^4.12.0.20241020"
45
48
  pytest = "^8.3.3"
46
- mypy = "^1.11.2"
49
+ mypy = "^1.12.1"
47
50
  types-dateparser = "^1.2.0.20240420"
48
- types-pytz = "^2024.2.0.20240913"
51
+ types-pytz = "^2024.2.0.20241003"
49
52
 
50
53
 
51
54
  [build-system]