PlaywrightCapture 1.27.5__py3-none-any.whl → 1.27.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.
@@ -31,7 +31,7 @@ from charset_normalizer import from_bytes
31
31
  from playwright._impl._errors import TargetClosedError
32
32
  from playwright.async_api import async_playwright, Frame, Error, Page, Download, Request
33
33
  from playwright.async_api import TimeoutError as PlaywrightTimeoutError
34
- from playwright_stealth import stealth_async, StealthConfig # type: ignore[import-untyped]
34
+ from playwright_stealth import stealth_async, StealthConfig # type: ignore[attr-defined]
35
35
  from puremagic import PureError, from_string
36
36
  from w3lib.html import strip_html5_whitespace
37
37
  from w3lib.url import canonicalize_url, safe_url_string
@@ -54,8 +54,8 @@ if TYPE_CHECKING:
54
54
  BROWSER = Literal['chromium', 'firefox', 'webkit']
55
55
 
56
56
  try:
57
- import pydub # type: ignore[import-untyped]
58
- from speech_recognition import Recognizer, AudioFile # type: ignore[import-untyped]
57
+ from pydub import AudioSegment # type: ignore[attr-defined]
58
+ from speech_recognition import Recognizer, AudioFile
59
59
  CAN_SOLVE_CAPTCHA = True
60
60
  except ImportError:
61
61
  CAN_SOLVE_CAPTCHA = False
@@ -95,7 +95,7 @@ class PlaywrightCaptureLogAdapter(LoggerAdapter): # type: ignore[type-arg]
95
95
  # https://fingerprintjs.github.io/BotD/main/
96
96
 
97
97
  @dataclass
98
- class PCStealthConfig(StealthConfig): # type: ignore[misc]
98
+ class PCStealthConfig(StealthConfig):
99
99
 
100
100
  @property
101
101
  def enabled_scripts(self) -> Iterator[str]:
@@ -696,6 +696,7 @@ class Capture():
696
696
  "Accept",
697
697
  "Agree and close",
698
698
  "I agree",
699
+ "Agree",
699
700
  # Dutch
700
701
  "Accepteer",
701
702
  # Spanish
@@ -1356,12 +1357,12 @@ class Capture():
1356
1357
  mp3_content = await response.read()
1357
1358
  with NamedTemporaryFile() as mp3_file, NamedTemporaryFile() as wav_file:
1358
1359
  mp3_file.write(mp3_content)
1359
- pydub.AudioSegment.from_mp3(mp3_file.name).export(wav_file.name, format="wav")
1360
- recognizer = Recognizer()
1361
- recaptcha_audio = AudioFile(wav_file.name)
1360
+ AudioSegment.from_mp3(mp3_file.name).export(wav_file.name, format="wav") # type: ignore[no-untyped-call]
1361
+ recognizer = Recognizer() # type: ignore[no-untyped-call]
1362
+ recaptcha_audio = AudioFile(wav_file.name) # type: ignore[no-untyped-call]
1362
1363
  with recaptcha_audio as source:
1363
- audio = recognizer.record(source)
1364
- text = recognizer.recognize_google(audio)
1364
+ audio = recognizer.record(source) # type: ignore[no-untyped-call]
1365
+ text = recognizer.recognize_google(audio) # type: ignore[attr-defined]
1365
1366
  await main_frame.get_by_role("textbox", name="Enter what you hear").fill(text)
1366
1367
  await main_frame.get_by_role("button", name="Verify").click()
1367
1368
  await self._safe_wait(page, 5)
@@ -1414,6 +1415,8 @@ class Capture():
1414
1415
  'Error receiving data: Connection reset by peer',
1415
1416
  'Internal SOCKSv5 proxy server error.',
1416
1417
  'Host unreachable through SOCKSv5 server.',
1418
+ # JS stuff
1419
+ 'TurnstileError: [Cloudflare Turnstile] Error: 300030.',
1417
1420
  # The browser barfed
1418
1421
  'Target page, context or browser has been closed',
1419
1422
  ]:
@@ -1,13 +1,11 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: PlaywrightCapture
3
- Version: 1.27.5
3
+ Version: 1.27.6
4
4
  Summary: A simple library to capture websites using playwright
5
- Home-page: https://github.com/Lookyloo/PlaywrightCapture
6
5
  License: BSD-3-Clause
7
6
  Author: Raphaël Vinot
8
7
  Author-email: raphael.vinot@circl.lu
9
- Requires-Python: >=3.9,<4.0
10
- Classifier: Environment :: Console
8
+ Requires-Python: >=3.9
11
9
  Classifier: Intended Audience :: Science/Research
12
10
  Classifier: Intended Audience :: Telecommunications Industry
13
11
  Classifier: License :: OSI Approved :: BSD License
@@ -20,20 +18,19 @@ Classifier: Programming Language :: Python :: 3.13
20
18
  Classifier: Topic :: Internet
21
19
  Classifier: Topic :: Security
22
20
  Provides-Extra: recaptcha
23
- Requires-Dist: SpeechRecognition (>=3.12.0) ; extra == "recaptcha"
24
- Requires-Dist: aiohttp-socks (>=0.10,<0.11)
25
- Requires-Dist: aiohttp[speedups] (>=3.11.11,<4.0.0)
26
- Requires-Dist: async-timeout (>=4.0.3,<5.0.0) ; python_version < "3.11"
27
- Requires-Dist: beautifulsoup4[charset-normalizer,lxml] (>=4.12.3,<5.0.0)
28
- Requires-Dist: dateparser (>=1.2.0,<2.0.0)
29
- Requires-Dist: playwright (>=1.49.1,<2.0.0)
30
- Requires-Dist: playwright-stealth (>=1.0.6,<2.0.0)
31
- Requires-Dist: puremagic (>=1.28,<2.0)
32
- Requires-Dist: pydub (>=0.25.1,<0.26.0) ; extra == "recaptcha"
33
- Requires-Dist: setuptools (>=75.6.0,<76.0.0)
34
- Requires-Dist: tzdata (>=2024.2,<2025.0)
35
- Requires-Dist: w3lib (>=2.2.1,<3.0.0)
36
- Project-URL: Repository, https://github.com/Lookyloo/PlaywrightCapture
21
+ Requires-Dist: SpeechRecognition (>=3.14.1) ; extra == "recaptcha"
22
+ Requires-Dist: aiohttp-socks (>=0.10.1)
23
+ Requires-Dist: aiohttp[speedups] (>=3.11.11)
24
+ Requires-Dist: async-timeout (>=5.0.1) ; python_version < "3.11"
25
+ Requires-Dist: beautifulsoup4[charset-normalizer,lxml] (>=4.12.3)
26
+ Requires-Dist: dateparser (>=1.2.0)
27
+ Requires-Dist: playwright (>=1.49.1)
28
+ Requires-Dist: playwright-stealth (>=1.0.6)
29
+ Requires-Dist: puremagic (>=1.28)
30
+ Requires-Dist: pydub (>=0.25.1) ; extra == "recaptcha"
31
+ Requires-Dist: setuptools (>=75.8.0)
32
+ Requires-Dist: tzdata (>=2025.1)
33
+ Requires-Dist: w3lib (>=2.2.1)
37
34
  Description-Content-Type: text/markdown
38
35
 
39
36
  # Playwright Capture
@@ -0,0 +1,9 @@
1
+ playwrightcapture/__init__.py,sha256=F90Y8wYS13tDjgsfjuFrCfmzQfdnH44G-ovuilJfLEE,511
2
+ playwrightcapture/capture.py,sha256=7Dzb909bGdLD5vxdx2U-nD5Pikf6gWbpJL5eIfG7734,80856
3
+ playwrightcapture/exceptions.py,sha256=LhGJQCGHzEu7Sx2Dfl28OFeDg1OmrwufFjAWXlxQnEA,366
4
+ playwrightcapture/helpers.py,sha256=SXQLEuxMs8-bcWykMiUVosHzzxBKuS-QC0gBV3OmKmo,1764
5
+ playwrightcapture/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ playwrightcapture-1.27.6.dist-info/LICENSE,sha256=uwFc39fTLacBUG-XTuxX6IQKTKhg4z14gWOLt3ex4Ho,1775
7
+ playwrightcapture-1.27.6.dist-info/METADATA,sha256=uebLrhWHQoJdm3qhPPyA6juEnayipPlcG9UxwuCnhrc,2853
8
+ playwrightcapture-1.27.6.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
9
+ playwrightcapture-1.27.6.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.1
2
+ Generator: poetry-core 2.0.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,9 +0,0 @@
1
- playwrightcapture/__init__.py,sha256=F90Y8wYS13tDjgsfjuFrCfmzQfdnH44G-ovuilJfLEE,511
2
- playwrightcapture/capture.py,sha256=yrYHjWCxzFHcnqdFCxDdxZKTF53UBltq896yKlNmrs8,80627
3
- playwrightcapture/exceptions.py,sha256=LhGJQCGHzEu7Sx2Dfl28OFeDg1OmrwufFjAWXlxQnEA,366
4
- playwrightcapture/helpers.py,sha256=SXQLEuxMs8-bcWykMiUVosHzzxBKuS-QC0gBV3OmKmo,1764
5
- playwrightcapture/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- playwrightcapture-1.27.5.dist-info/LICENSE,sha256=uwFc39fTLacBUG-XTuxX6IQKTKhg4z14gWOLt3ex4Ho,1775
7
- playwrightcapture-1.27.5.dist-info/METADATA,sha256=Xwk3Z58_GMiCpeO16zKMw_KXmEoDmBlbKPYvxSQt70o,3103
8
- playwrightcapture-1.27.5.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
9
- playwrightcapture-1.27.5.dist-info/RECORD,,