Send Captchas from Python to GSA Captcha Breaker
Hi,
I have read several threads here, but I couldn't find the solution.
I would like to send Captcha Image from my python script to Captcha breaker. I tried the following:
#!/usr/bin/env python
#
# Decaptcher Python API Module
# By Brandon Smith (brandon.smith@studiobebop.net)
#
import requests
class decaptcher:
def __init__(self, username, password, product_id=""):
self.__action_url = "http://127.0.0.1:65535"
self.__username = username
self.__password = password
self.__product_id = product_id
def get_balance(self):
data = {"function": "balance",
"username": self.__username,
"password": self.__password}
request = requests.post(self.__action_url, data)
return float(request.content)
def solve_image(self, image_path):
from PIL import Image
img = Image.open('securimage_show.png')
data = {"function": "picture2",
"username": self.__username,
"password": self.__password,
"pict_to": "0",
"pict_type": "0",
"captcha_plattform":"Article Script",
"pict": open(image_path, "rb").read()}
request = requests.post(self.__action_url, data)
answer = request.content.split("|")[-1]
return answer
d = decaptcher("a", "b")
print d.solve_image('securimage_show.png')
But I always get the answer: "unknown"
Can anybody help, please?
Thanks
Comments
"captcha_platform" is correct.
"source_url" is another parameter you can use to have the URL in the log.