You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was receiving the following error when trying to solve captcha by audio in Macos (I leave the solution in case someone else gets the same error):
Traceback (most recent call last):
File "/Users/jxlil/captcha/test.py", line 10, in <module>
token = solver.solve_recaptcha(wait=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jxlil/captcha/.venv/lib/python3.11/site-packages/playwright_recaptcha/recaptchav2/sync_solver.py", line 606, in solve_recaptcha
self._solve_audio_challenge(recaptcha_box)
File "/Users/jxlil/captcha/.venv/lib/python3.11/site-packages/playwright_recaptcha/recaptchav2/sync_solver.py", line 464, in _solve_audio_challenge
text = self._convert_audio_to_text(url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jxlil/captcha/.venv/lib/python3.11/site-packages/playwright_recaptcha/recaptchav2/sync_solver.py", line 274, in _convert_audio_to_text
audio = AudioSegment.from_mp3(mp3_audio)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jxlil/captcha/.venv/lib/python3.11/site-packages/pydub/audio_segment.py", line 796, in from_mp3
return cls.from_file(file, 'mp3', parameters=parameters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jxlil/captcha/.venv/lib/python3.11/site-packages/pydub/audio_segment.py", line 728, in from_file
info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jxlil/captcha/.venv/lib/python3.11/site-packages/pydub/utils.py", line 279, in mediainfo_json
info = json.loads(output)
^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Future exception was never retrieved
future: <Future finished exception=Error('Connection closed')>
playwright._impl._api_types.Error: Connection closed
The error is generated in the pydub (pydub/utils.py) library, in this part:
Hello
I was receiving the following error when trying to solve captcha by audio in Macos (I leave the solution in case someone else gets the same error):
The error is generated in the
pydub
(pydub/utils.py
) library, in this part:This is because
output
is an empty string and it is supposed to be a JSON formatted string.Solution
Although the problem seems to be in one of the libraries, in my case it was due to
ffmpeg
. Reinstalling it as follows solved the problem:The text was updated successfully, but these errors were encountered: