Git Product home page Git Product logo

Comments (12)

AndreiDrang avatar AndreiDrang commented on May 29, 2024

Hi!
Yes, of course, you need just:
result = ImageToTextTask.ImageToTextTask(anticaptcha_key=ANTICAPTCHA_KEY) .captcha_handler(captcha_link='some_link', verify = False)
P.s. I think we need to add more examples ..

from python3-anticaptcha.

benvindo avatar benvindo commented on May 29, 2024

Hello,

So, When I tried put parameter 'verify = False' in captcha_handler, I received this error:

IdGetError:
Пораждается при ошибке получения ID капчи от сервиса. Ответ сервера:

{'errorId': 3, 'errorCode': 'ERROR_ZERO_CAPTCHA_FILESIZE', 'errorDescription': 'The size of the captcha you are uploading is less than 100 bytes'}

Code bellow:

image_link = "https://sipa.inss.gov.br/SipaINSS/api/imagem?d=I_60fa7b73-a494-4081-a1ce-f9e797387130_DB4A0BA13A6B26C1A0087B4BDE7288C0.lbroute_v131p040_internet"
# Возвращается строка-расшифровка капчи. Get string for solve captcha, and some other info.
user_answer = ImageToTextTask.ImageToTextTask(anticaptcha_key = ANTICAPTCHA_KEY).captcha_handler(captcha_link=image_link, verify = False)

print(user_answer)

from python3-anticaptcha.

AndreiDrang avatar AndreiDrang commented on May 29, 2024

Can you give a link to a page with a captcha?

from python3-anticaptcha.

benvindo avatar benvindo commented on May 29, 2024

Yes, link bellow:

https://sipa.inss.gov.br/SipaINSS/pages/consit/consitInicio.xhtml

from python3-anticaptcha.

AndreiDrang avatar AndreiDrang commented on May 29, 2024

image
Bad news :)
Okay, library can't download image, try add to captcha_handler some cookies/header/other requests params.

from python3-anticaptcha.

benvindo avatar benvindo commented on May 29, 2024

Okay, I'll try add others params in request.

from python3-anticaptcha.

benvindo avatar benvindo commented on May 29, 2024

Hey,

I believe I tried every possible way to add more params in captcha_handler but the library continues giving me same error :/

My code test:

image_link = "https://sipa.inss.gov.br/SipaINSS/api/imagem?d=I_946b3fa6-9796-4509-a8fe-c63a68835b9b_6FBFD2CF5556C06EFBF485588F77ABC6.lbroute_v131p040_internet&uId=1527080962508"
img_link="https://sipa.inss.gov.br/SipaINSS/pages/consit/consitInicio.xhtml"

headers = {
            'Host': 'sipa.inss.gov.br',
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0',
            'Accept': 'image/webp,image/apng,image/*,*/*;q=0.8',
            'Accept-Language': 'pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3',
            'Accept-Encoding': 'gzip, deflate, br',
            'Referer': 'https://sipa.inss.gov.br/SipaINSS/pages/consit/consitInicio.xhtml',
            'Cookie': 'JSESSIONID="YjJ3eUWnCf24mZOembsjjMMT.slave1:server-sipa"',
            'Connection': 'keep-alive'
          }
proxies = {
    "http": 'http://191.34.80.133:8080', 
    "https": 'http://191.34.80.133:8080'
}
payload = "d=I_20091a23-70f8-4c99-a744-a48484588fd4_696D39F6650C5D348D72FD5693E9D3F1.lbroute_v131p041_internet&uId=1527080676318"

user_answer = ImageToTextTask.ImageToTextTask(anticaptcha_key = ANTICAPTCHA_KEY).captcha_handler(captcha_link=img_link, verify=False, proxies=proxies, data=payload, headers=headers)

print(user_answer)

OBs.: I think that format of image is jfif, one thing interesting is when add _save_format = 'const _ in ImageToTextTask show me other error:
Could it be something related to the image format?

IdGetError:
Пораждается при ошибке получения ID капчи от сервиса. Ответ сервера:

{'errorId': 15, 'errorCode': 'ERROR_IMAGE_TYPE_NOT_SUPPORTED', 'errorDescription': 'Image you are uploading is not supported by our API. It must be JPEG, PNG or GIF.'}

from python3-anticaptcha.

AndreiDrang avatar AndreiDrang commented on May 29, 2024

Could it be something related to the image format?

Yes, library use .png format for images.
Try to download captcha-image with own script and than encode image with base64, and put it in python3-anticaptcha library(set param .captcha_handler(captcha_base64=%YOUR_base64_STRING%)).

You can encode image with base64 library and code like this:
base64.b64encode(%IMAGE_HERE%).decode('utf-8')

from python3-anticaptcha.

benvindo avatar benvindo commented on May 29, 2024

I tried send the image in format base64 but return this error:

ParamError:
Пораждается, при передаче неверного параметра.Wrong 'save_format' parameter. Valid formats: 'const' or 'temp'.

Неправильный 'save_format' параметр. Возможные форматы: 'const' или 'temp'.

So I get your exemplo of base64 e tried run but return same error, Can you check this?

OBs: I install your libray by pip, it looks like the outdated library

from python3-anticaptcha.

AndreiDrang avatar AndreiDrang commented on May 29, 2024
  1. Clone it from git and install(later i will update library on PyPi);
  2. U send wrong param, your request mustlook like:
    user_answer_base64 = ImageToTextTask.ImageToTextTask(anticaptcha_key=ANTICAPTCHA_KEY).captcha_handler(captcha_base64=base_64_file)

from python3-anticaptcha.

benvindo avatar benvindo commented on May 29, 2024

Now it's working, thanks for the help :)

from python3-anticaptcha.

AndreiDrang avatar AndreiDrang commented on May 29, 2024

No problem 😊

from python3-anticaptcha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.