2captcha / 2captcha-go

Golang Module for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, funcaptcha, geetest and solve any other captchas.
https://2captcha.com
MIT License
108 stars 42 forks source link

base64 encoded images for normal captcha not working #6

Closed guzman12345 closed 1 year ago

guzman12345 commented 2 years ago

base64 encoded image is not working, I keep getting a error stating no image was sent to the API. I made sure to leave the Image parameter blank and only leave the base64 parameter but I still get this error.

2captcha commented 2 years ago

Could you please provide your code that doesn't work as expected?

ArtemKremlyov commented 2 years ago

Hi, also faced the same problem, here is a sample code:

` client := api2captcha.NewClient(os.Getenv("RUCAPTCHA_KEY")) client.DefaultTimeout = 300 client.PollingInterval = 15 client.RecaptchaTimeout = 300

img := api2captcha.Normal{Base64: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAK8DASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygp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KjyG3VvLhjQ5wSR1JxxQBZ8MWltq0D3Woh7q8jcf65ywUEAjC9B3HTtXX1wUVvqthezw2MV6hDNG7JbgrIu7chDMR0DEdKv2WlawdTtbt0mjMb5ke6vPMZkPUbVG0fhQB11FFFABRRRQAUUUUAVNTujZ6fLMv38bUHqx4H61i6DfTFoWnuJZUnLRkynO1x8y/QFf6U/xM7TBLWNgNi+Y3BOSx2KOATk5Yjjqoqm4u3ldpLd7ZZgixFYsKsq8oSS2e2OnpQB0U2lWVxKZZIfnPVlYqT9cEZpRpdisJiFpFsPJBXOfxqSyulvLOK4UY3rkqeqnuPwNT0ANRFjjWNFCooACjoBTY7eGEsYoY4yxySqgZqSigAooooAKzNUAN5p4PQySD/yE9adZ2qJN5ljNDbyT+TOWdIyobaY3X+IgdWHegDBTVdVtNJtisDGAxokTm2GWBAC9JjyeO1a3h628u1a4LKTMAMKc4xnr75JzVizsS/h61srtCri2SNwDyrBQOCO4NVLA3trqhhltpCkoPmSqo2Fx0cem4dR6igDcooooAKKKKACiiigAooooAKKKKAOeX99roL85uW/8cTA/ma1dVjWTS7kN/ChcEdivIP5gUUUAUvDZZ7CSV3LGSQuRxgE9cVs0UUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH//2Q=="}
code, err := client.Solve(img.ToRequest())`
kratzky commented 1 year ago

should be fixed in #3