Merhaba, bi captcha bypass kullanmak için git-hub formundan aşşagıdaki kodları aldım ama aşşagıdaki hatalar ile karşılaşıyorum nasıl düzeltmeliyim bulamadım yardımcı olursanız sevinirim.
HATA
C:\Users\user\AppData\Local\Programs\Python\Python38-32\python.exe C:/Users/user/Desktop/Python/recaptcha.py
C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
[INFO] Audio src: https://www.google.com:443/recaptcha/api2/payload?p=06AGdBq24_e_iVqGol4yXsutjBKVu1qPSwYbF5DNJ95BXRtSrRRpkRLb4CEDSeUEEEA45th4XQsymlkTKfSUk8dN7A_ka7KDROO2NNLAVrIT1WvXN_J6OSzfPv2a2aB09WsfzupwcwFjghNxaLtnHud00YX7CNOCqxl6h_uOYAPSwfnvpDVmhu3XAUkYGbYBWc_CZVczziU10L&k=6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-
C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pydub\utils.py:198: RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work
warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)
Traceback (most recent call last):
File "C:/Users/user/Desktop/Python/recaptcha.py", line 70, in <module>
sound = pydub.AudioSegment.from_mp3(os.getcwd()+"sample.mp3")
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pydub\audio_segment.py", line 738, in from_mp3
return cls.from_file(file, 'mp3', parameters=parameters)
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pydub\audio_segment.py", line 685, in from_file
info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pydub\utils.py", line 274, in mediainfo_json
res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\user\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] Sistem belirtilen dosyayı bulamıyor
KOD
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 16 10:01:10 2020
@author: OHyic
"""
#system libraries
import os
import random
import time
#selenium libraries
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import UnexpectedAlertPresentException
from selenium.webdriver.chrome.options import Options
#recaptcha libraries
import speech_recognition as sr
import ffmpy
import requests
import urllib
import pydub
def delay ():
time.sleep(random.randint(2,3))
#create chrome driver
driver = webdriver.Chrome(executable_path=r'C:\Users\user\Desktop\chromedriver.exe')
#go to website
driver.get("https://www.google.com/recaptcha/api2/demo")
#switch to recaptcha frame
frames=driver.find_elements_by_tag_name("iframe")
driver.switch_to.frame(frames[0]);
delay()
#click on checkbox to activate recaptcha
driver.find_element_by_class_name("recaptcha-checkbox-border").click()
#switch to recaptcha audio control frame
driver.switch_to.default_content()
frames=driver.find_element_by_xpath("/html/body/div[2]/div[4]").find_elements_by_tag_name("iframe")
driver.switch_to.frame(frames[0])
delay()
#click on audio challenge
driver.find_element_by_id("recaptcha-audio-button").click()
#switch to recaptcha audio challenge frame
driver.switch_to.default_content()
frames= driver.find_elements_by_tag_name("iframe")
driver.switch_to.frame(frames[-1])
delay()
#click on the play button
driver.find_element_by_xpath("/html/body/div/div/div[3]/div/button").click()
#get the mp3 audio file
src = driver.find_element_by_id("audio-source").get_attribute("src")
print("[INFO] Audio src: %s"%src)
#download the mp3 audio file from the source
urllib.request.urlretrieve(src, os.getcwd()+"\\sample.mp3")
sound = pydub.AudioSegment.from_mp3(os.getcwd()+"sample.mp3")
sound.export(os.getcwd()+"\\sample.wav", format="wav")
sample_audio = sr.AudioFile(os.getcwd()+"sample.wav")
r= sr.Recognizer()
with sample_audio as source:
audio = r.record(source)
#translate audio to text with google voice recognition
key=r.recognize_google(audio)
print("[INFO] Recaptcha Passcode: %s"%key)
#key in results and submit
driver.find_element_by_id("audio-response").send_keys(key.lower())
driver.find_element_by_id("audio-response").send_keys(Keys.ENTER)