maximedrn / opensea-automatic-bulk-upload-and-sale

A Selenium Python bot to automatically and bulk upload/ mint and list your NFTs on OpenSea. All metadata compatible, Ethereum and Polygon blockchains supported, reCAPTCHA solvers included.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Solution: reCAPTCHAs and Yolo

Vural78 opened this issue · comments

Hello,
In the project in the link below, they managed to solve the recaptcha using ffmpeg.
https://github.com/TeCeG/bulk-upload-to-opensea-with-recaptcha-solution
If you can integrate the recaptcha related script into your project, your project will be great and you will have solved many people's problems.
I don't have Python knowledge, but I'm a web programmer.
I think the code script for recaptcha is as follows.

I tried it myself, recaptchas are being resolved.

Can you solve this problem?

Requirements:
selenium==4.0.0
pillow
certifi
python-dateutil
pydub==0.25.1
SpeechRecognition==3.8.1
urllib3==1.26.6
stem==1.8.0
numpy

def solve_recaptcha():
        global displayOk
        global snnumber3
        snnumber3 = 0
        for snnumber2 in rgnumber:
            patha_iframe = (f"/html/body/div[{snnumber2}]/div[4]/iframe")
            displayOk3 = check_exists_by_xpath(patha_iframe)
            #print(f"Solve div[{snnumber2}]: {displayOk3}")
            if displayOk3:
                snnumber3 = snnumber2
                #print(f"Solve: div[{snnumber2}] = {displayOk3}")
                displayOk3 = False
                break

        patha_iframe = (f"/html/body/div[{snnumber3}]/div[4]/iframe")
        displayOk = check_exists_by_xpath(patha_iframe)
        print(f"Solve recaptcha {snnumber1}: {displayOk}")
        if displayOk:
            try:
                iframes = driver.find_elements_by_tag_name("iframe")
                driver.switch_to.frame(iframes[0])
            except:
                pass
                
            try:
                check_button = WebDriverWait(driver, 10).until(ExpectedConditions.presence_of_element_located((By.XPATH,'//*[@id="recaptcha-anchor"]/div[1]')))
                
                check_button.click()
            except:
                pass

            try:
                time.sleep(1)
                driver.switch_to.default_content() 
                driver.switch_to.frame(iframes[-1])
            except:
                pass

            try:
                time.sleep(1)
                ssd=WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "button#recaptcha-audio-button")))
                ssd.click()
                time.sleep(1)
            except:
                pass
                
            try:        # get the mp3 audio file
                delay()
                src = driver.find_element_by_id("audio-source").get_attribute("src")
                print(f"[INFO] Audio src: {src}")
                
                path_to_mp3 = os.path.normpath(os.path.join(os.getcwd(), "sample.mp3"))
                path_to_wav = os.path.normpath(os.path.join(os.getcwd(), "sample.wav"))
                
                    # download the mp3 audio file from the source
                urllib.request.urlretrieve(src, path_to_mp3)
            except:
                pass
                    

                # load downloaded mp3 audio file as .wav
            try:
                sound = pydub.AudioSegment.from_mp3(path_to_mp3)
                sound.export(path_to_wav, format="wav")
                sample_audio = sr.AudioFile(path_to_wav)
            except Exception:
                sys.exit(
                    "[ERR] Please run program as administrator or download ffmpeg manually, "
                    "https://blog.gregzaal.com/how-to-install-ffmpeg-on-windows/"
                )

            try: 
                # translate audio to text with google voice recognition
                delay()
                r = sr.Recognizer()
                with sample_audio as source:
                    audio = r.record(source)
                key = r.recognize_google(audio)
                print(f"[INFO] Recaptcha Passcode: {key}")

                # key in results and submit
                delay()
                driver.find_element_by_id("audio-response").send_keys(key.lower())
                driver.find_element_by_id("audio-response").send_keys(Keys.ENTER)

                driver.switch_to.default_content()     
                time.sleep(2)  
            except:
                pass
            displayOk=False
      
    def wait_xpath(code):
        wait.until(ExpectedConditions.presence_of_element_located((By.XPATH, code)))

Audio isnt a good alternative, because you get faster then a ant a ban from google...
Yes you can use Proxy or get new IP, but for peoples where not have this, this isnt a alternative...

Maybe this here: https://github.com/ozankaraali/yolov3-recaptcha
or another one, there are many projects on github for this...
or my solution to integrate a captcha service like 2captcha, deathbycaptcha or so (yes not free but lets the user decision)

I'm working on a bot that use Yolov5 with Torch.
It seems to work great with captchas.

I'm working on a bot that use Yolov5 with Torch. It seems to work great with captchas.

This is a great development.
But I could not run Yolov3 on windows.
The error is as follows.

PS C:\Users\Vural\Desktop\yolov3-recaptcha-master> python selenium_demo.py
2022-03-12 12:57:10.280931: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2022-03-12 12:57:10.281127: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

DevTools listening on ws://127.0.0.1:63773/devtools/browser/e49cd903-c827-4e73-9a65-396277d4ceea

 explicit wait for  1.0774036145166395  seconds...

 explicit wait for  0.5613607779828519 seconds...

 after click on CheckBox...
 CheckBox click result:  None

 explicit wait for  1.236022836579071 seconds...
[10720:8240:0312/125725.316:ERROR:device_event_log_impl.cc(214)] [12:57:25.316] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: Sisteme ba­l² bir ayg²t al²■m²yor. (0x1F)
[10720:8240:0312/125725.318:ERROR:device_event_log_impl.cc(214)] [12:57:25.318] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: Sisteme ba­l² bir ayg²t al²■m²yor. (0x1F)
2022-03-12 12:57:26.514592: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2022-03-12 12:57:26.516355: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublas64_11.dll'; dlerror: cublas64_11.dll not found
2022-03-12 12:57:26.518557: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cublasLt64_11.dll'; dlerror: cublasLt64_11.dll not found
2022-03-12 12:57:26.520756: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cufft64_10.dll'; dlerror: cufft64_10.dll not found
2022-03-12 12:57:26.522646: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'curand64_10.dll'; dlerror: curand64_10.dll not found
2022-03-12 12:57:26.524601: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusolver64_11.dll'; dlerror: cusolver64_11.dll not found
2022-03-12 12:57:26.526781: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cusparse64_11.dll'; dlerror: cusparse64_11.dll not found
2022-03-12 12:57:26.529091: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudnn64_8.dll'; dlerror: cudnn64_8.dll not found
2022-03-12 12:57:26.529253: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1850] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2022-03-12 12:57:26.532091: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
  File "C:\Users\Vural\Desktop\yolov3-recaptcha-master\selenium_demo.py", line 81, in <module>
    utils.load_weights(model, "./yolov3.weights")
  File "C:\Users\Vural\Desktop\yolov3-recaptcha-master\core\utils.py", line 24, in load_weights
    wf = open(weights_file, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: './yolov3.weights'

It requires a yolov3.weights file (~ 200MB). You can download it here:
https://pjreddie.com/media/files/yolov3.weights
(from https://pjreddie.com/darknet/yolo/ - YOLOv3-416 model).

It requires a yolov3.weights file (~ 200MB). You can download it here: https://pjreddie.com/media/files/yolov3.weights (from https://pjreddie.com/darknet/yolo/ - YOLOv3-416 model).

I had already loaded the yolov3.weights file but it was not working. I've reinstalled, it's working now, but I'll wait for your improvement on Yolov5. Thank you.

@Vural78 Can you share your Code for working Yolo?

@Vural78 Can you share your Code for working Yolo?

Hello,
I do not have a project available. I tried to download and run the yolov3.weights file just for trial purposes. I couldn't make a working project because I don't have Python knowledge. For now, I'm waiting for maximedrn to release an update.
The Yolov3.weights file gives me some code but I don't know how to use it.
Thanks

Read this: #157 (comment)