PlaywrightCapture 1.27.5__py3-none-any.whl → 1.27.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.
- playwrightcapture/capture.py +12 -9
- {playwrightcapture-1.27.5.dist-info → playwrightcapture-1.27.7.dist-info}/METADATA +17 -18
- playwrightcapture-1.27.7.dist-info/RECORD +9 -0
- {playwrightcapture-1.27.5.dist-info → playwrightcapture-1.27.7.dist-info}/WHEEL +1 -1
- playwrightcapture-1.27.5.dist-info/RECORD +0 -9
- {playwrightcapture-1.27.5.dist-info → playwrightcapture-1.27.7.dist-info}/LICENSE +0 -0
playwrightcapture/capture.py
CHANGED
@@ -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[
|
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
|
58
|
-
from speech_recognition import Recognizer, AudioFile
|
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):
|
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
|
-
|
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
|
+
Metadata-Version: 2.3
|
2
2
|
Name: PlaywrightCapture
|
3
|
-
Version: 1.27.
|
3
|
+
Version: 1.27.7
|
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
|
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,19 +18,20 @@ 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.
|
24
|
-
Requires-Dist: aiohttp-socks (>=0.10
|
25
|
-
Requires-Dist: aiohttp[speedups] (>=3.11.11
|
26
|
-
Requires-Dist: async-timeout (>=
|
27
|
-
Requires-Dist: beautifulsoup4[charset-normalizer,lxml] (>=4.
|
28
|
-
Requires-Dist: dateparser (>=1.2.0
|
29
|
-
Requires-Dist: playwright (>=1.
|
30
|
-
Requires-Dist: playwright-stealth (>=1.0.6
|
31
|
-
Requires-Dist: puremagic (>=1.28
|
32
|
-
Requires-Dist: pydub (>=0.25.1
|
33
|
-
Requires-Dist: setuptools (>=75.
|
34
|
-
Requires-Dist: tzdata (>=
|
35
|
-
Requires-Dist: w3lib (>=2.
|
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.13.1)
|
26
|
+
Requires-Dist: dateparser (>=1.2.0)
|
27
|
+
Requires-Dist: playwright (>=1.50.0)
|
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.3.1)
|
34
|
+
Project-URL: Issues, https://github.com/Lookyloo/PlaywrightCapture/issues
|
36
35
|
Project-URL: Repository, https://github.com/Lookyloo/PlaywrightCapture
|
37
36
|
Description-Content-Type: text/markdown
|
38
37
|
|
@@ -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.7.dist-info/LICENSE,sha256=uwFc39fTLacBUG-XTuxX6IQKTKhg4z14gWOLt3ex4Ho,1775
|
7
|
+
playwrightcapture-1.27.7.dist-info/METADATA,sha256=yhTawjHSSyKK0XqUUC6j-MdrTcnWZbPtKxhOb-EOX54,2998
|
8
|
+
playwrightcapture-1.27.7.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
9
|
+
playwrightcapture-1.27.7.dist-info/RECORD,,
|
@@ -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,,
|
File without changes
|