infotrex / bulk-upload-to-opensea

BULK UPLOAD NFTs to OPENSEA
277 stars 202 forks source link

Captcha problem = solution #185

Closed Vigle-N0ir closed 2 years ago

Vigle-N0ir commented 2 years ago

Hi Mr Genius.

There are three modifications to make for this program to work perfectly because you are a genius man.

Modification 1: Modified the code so that it detects if the captcha has not been solved, it just refreshes the captcha and clicks on the buster again until the captcha resolves (if still an error, it refreshes until 'to obtain the positive response) and thus continue the process.

Modification 2: Put an option or if the captcha is resolved instantly without going through the pictures (because by installing the client buster on our computer we have 95% that the captcha is resolved instantly (I tested it)) make the process continue and pass the buster step where it has to click and refresh (Modification 1) and continue the process.

Modifications 3 😁 : Make Modification 1 and 2 have a link with a predefined order.

Example:

       If the Captcha is resolved instantly with the buster client, it continues the process, 
       if the captcha is not solved instantly then it follows the basic and initial configuration with buster 
   & if it detects that the captcha has not been resolved, 
       it refreshes the captcha and click again on buster and repeat the process until the captcha is solved
       as explained in modification 2 and so it will continue the process. 

Sorry i used the translation 😭

Congratulations to you

(I know it's easy to say but hard to do πŸ’ͺ)

Vigle-N0ir commented 2 years ago

The modification must be done here between these lines

    delay()
    create = driver.find_element(By.XPATH, '//*[@id="__next"]/div[1]/main/div/div/section/div[2]/form/div/div[1]/span/button')
    driver.execute_script("arguments[0].click();", create)
    time.sleep(sleeptime)

    main_page = driver.current_window_handle

    if check_exists_by_xpath(driver, '//h4[text()="Almost done"]'):
        wait_xpath('//h4[text()="Almost done"]')
        captcha_element = driver.find_element(By.XPATH,'//h4[text()="Almost done"]')

        if check_exists_by_tagname('iframe'):
            # print("have iframe")

            delay()
            solved_info = WebDriverWait(driver, 150).until(ExpectedConditions.presence_of_element_located((By.XPATH, "//*[@class='captcha-solver-info']" )))
            # solved_status = WebDriverWait(driver, 10).until(ExpectedConditions.presence_of_element_located((By.XPATH, "//*[@class='captcha-solver-info']" ))).get_attribute("innerHTML")
            # print(str(solved_status))
            wait_xpath("//div[@class='captcha-solver']")
            captcha_solver_button = driver.find_element(By.XPATH, "//div[@class='captcha-solver']")
            driver.execute_script("arguments[0].click();", captcha_solver_button)
            time.sleep(sleeptime)
            WebDriverWait(driver, 60).until(ExpectedConditions.presence_of_element_located((By.XPATH, "//*[@data-state='solving']" )))
            print("solving")
            WebDriverWait(driver, 300).until(ExpectedConditions.presence_of_element_located((By.XPATH, "//*[@data-state='solved']")))
            print("solved")

        else:
            pass

    else:
        print("no captcha")

    try:
        delay()
        cross = WebDriverWait(driver, 360).until(ExpectedConditions.presence_of_element_located((By.XPATH, '/html/body/div[6]/div/div/div/div[2]/button/i')))
        cross.click()
        time.sleep(sleeptime)
    except:
        delay()
        cross = WebDriverWait(driver, 360).until(ExpectedConditions.presence_of_element_located((By.XPATH, '/html/body/div[5]/div/div/div/div[2]/button/i')))
        driver.execute_script("arguments[0].click();", cross)
        time.sleep(2)
Chanuth01 commented 2 years ago

Thank u

Chanuth01 commented 2 years ago

where to put this

Chanuth01 commented 2 years ago

This is for 2 captcha right? I want for buster

afcjeweler commented 2 years ago

how can we alter the code? this is the solution I am seeking for