PlaywrightCapture 1.25.6__py3-none-any.whl → 1.25.7__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.
@@ -404,17 +404,24 @@ class Capture():
404
404
  device_context_settings = {}
405
405
  if self.device_name:
406
406
  device_context_settings = self.playwright.devices[self.device_name]
407
+ # We need to make sure the device_context_settings dict doesn't contains
408
+ # keys that are set by default in the context creation
409
+ if context_ua := device_context_settings.pop('user_agent', None):
410
+ ua = self.user_agent if self.user_agent else context_ua
411
+ if context_vp := device_context_settings.pop('viewport', self._default_viewport):
412
+ # Always true, but we also always want to pop it.
413
+ vp = self.viewport if self.viewport else context_vp
407
414
 
408
415
  self.context = await self.browser.new_context(
409
416
  record_har_path=self._temp_harfile.name,
410
417
  ignore_https_errors=True,
411
418
  bypass_csp=True,
412
419
  http_credentials=self.http_credentials if self.http_credentials else None,
413
- user_agent=self.user_agent if self.user_agent else device_context_settings.pop('user_agent', None),
420
+ user_agent=ua,
414
421
  locale=self.locale if self.locale else None,
415
422
  timezone_id=self.timezone_id if self.timezone_id else None,
416
423
  color_scheme=self.color_scheme if self.color_scheme else None,
417
- viewport=self.viewport if self.viewport else device_context_settings.pop('viewport', self._default_viewport),
424
+ viewport=vp,
418
425
  # For debug only
419
426
  # record_video_dir='./videos/',
420
427
  **device_context_settings
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PlaywrightCapture
3
- Version: 1.25.6
3
+ Version: 1.25.7
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
@@ -31,7 +31,7 @@ Requires-Dist: playwright-stealth (>=1.0.6,<2.0.0)
31
31
  Requires-Dist: puremagic (>=1.26,<2.0)
32
32
  Requires-Dist: pydub (>=0.25.1,<0.26.0) ; extra == "recaptcha"
33
33
  Requires-Dist: pytz (>=2024.1,<2025.0) ; python_version < "3.9"
34
- Requires-Dist: setuptools (>=71.0.3,<72.0.0)
34
+ Requires-Dist: setuptools (>=71.1.0,<72.0.0)
35
35
  Requires-Dist: tzdata (>=2024.1,<2025.0)
36
36
  Requires-Dist: w3lib (>=2.2.1,<3.0.0)
37
37
  Project-URL: Repository, https://github.com/Lookyloo/PlaywrightCapture
@@ -1,9 +1,9 @@
1
1
  playwrightcapture/__init__.py,sha256=F90Y8wYS13tDjgsfjuFrCfmzQfdnH44G-ovuilJfLEE,511
2
- playwrightcapture/capture.py,sha256=JYL2tcDz1OVQE2hpCnSa3xSqos6_v6t9CCLnVLfxBSw,70420
2
+ playwrightcapture/capture.py,sha256=iB0hw4402_XrO14A4sblQdB5hVK1NZ-n7D_VkD7Y0hs,70768
3
3
  playwrightcapture/exceptions.py,sha256=LhGJQCGHzEu7Sx2Dfl28OFeDg1OmrwufFjAWXlxQnEA,366
4
4
  playwrightcapture/helpers.py,sha256=SXQLEuxMs8-bcWykMiUVosHzzxBKuS-QC0gBV3OmKmo,1764
5
5
  playwrightcapture/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- playwrightcapture-1.25.6.dist-info/LICENSE,sha256=uwFc39fTLacBUG-XTuxX6IQKTKhg4z14gWOLt3ex4Ho,1775
7
- playwrightcapture-1.25.6.dist-info/METADATA,sha256=59DKFDY5h7uAIeghIFZtV6iTgt8CiRmHiBrx8soZiF8,3173
8
- playwrightcapture-1.25.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
9
- playwrightcapture-1.25.6.dist-info/RECORD,,
6
+ playwrightcapture-1.25.7.dist-info/LICENSE,sha256=uwFc39fTLacBUG-XTuxX6IQKTKhg4z14gWOLt3ex4Ho,1775
7
+ playwrightcapture-1.25.7.dist-info/METADATA,sha256=h0djpVBPhsTTxH2Hm1kV6AkGMPfVwEHA2lcgtoWEx7M,3173
8
+ playwrightcapture-1.25.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
9
+ playwrightcapture-1.25.7.dist-info/RECORD,,