Как обойти reCaptcha
я нашел на gitHub этот код с распознанием аудиофайлов она должна работать по факту но у меня не работает
from selenium import webdriver
import time
from selenium.webdriver.common.by import By
import requests
import whisper
import warnings
warnings.filterwarnings("ignore")
model = whisper.load_model("base")
def transcribe(url):
with open('.temp', 'wb') as f:
f.write(requests.get(url).content)
result = model.transcribe('.temp')
return result["text"].strip()
def click_checkbox(driver):
driver.switch_to.default_content()
driver.switch_to.frame(driver.find_element(By.XPATH, ".//iframe[@title='reCAPTCHA']"))
driver.find_element(By.ID, "recaptcha-anchor-label").click()
driver.switch_to.default_content()
def request_audio_version(driver):
driver.switch_to.default_content()
driver.switch_to.frame(
driver.find_element(By.XPATH, ".//iframe[@title='recaptcha challenge expires in two minutes']"))
driver.find_element(By.ID, "recaptcha-audio-button").click()
def solve_audio_captcha(driver):
text = transcribe(driver.find_element(By.ID, "audio-source").get_attribute('src'))
driver.find_element(By.ID, "audio-response").send_keys(text)
driver.find_element(By.ID, "recaptcha-verify-button").click()
if __name__ == "__main__":
driver = webdriver.Chrome()
driver.get("https://www.google.com/recaptcha/api2/demo")
click_checkbox(driver)
time.sleep(1)
request_audio_version(driver)
time.sleep(1)
solve_audio_captcha(driver)
time.sleep(10)
driver.close()
driver.quit()
FileNotFoundError: [WinError 2] The system cannot find the file specified вот так выглядит ошибка там ещё есть ошибки но думаю главная ошибка эта
Traceback (most recent call last):
File "C:\myRametov\s_work\kino-teatr\test.py", line 48, in <module>
solve_audio_captcha(driver)
File "C:\myRametov\s_work\kino-teatr\test.py", line 35, in solve_audio_captcha
text = transcribe(driver.find_element(By.ID, "audio-source").get_attribute('src'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\myRametov\s_work\kino-teatr\test.py", line 16, in transcribe
result = model.transcribe('.temp')
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\myRametov\s_work\kino-teatr\venv\Lib\site-packages\whisper\transcribe.py", line 122, in transcribe
mel = log_mel_spectrogram(audio, model.dims.n_mels, padding=N_SAMPLES)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\myRametov\s_work\kino-teatr\venv\Lib\site-packages\whisper\audio.py", line 140, in log_mel_spectrogram
audio = load_audio(audio)
^^^^^^^^^^^^^^^^^
File "C:\myRametov\s_work\kino-teatr\venv\Lib\site-packages\whisper\audio.py", line 58, in load_audio
out = run(cmd, capture_output=True, check=True).stdout
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\kageyoshi\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 548, in run
with Popen(*popenargs, **kwargs) as process:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\kageyoshi\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\kageyoshi\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1538, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
Process finished with exit code 1