-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathnew_recaptcha_token_image.py
More file actions
36 lines (30 loc) · 1.3 KB
/
new_recaptcha_token_image.py
File metadata and controls
36 lines (30 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import deathbycaptcha
import json
# Put your DBC account username and password here.
username = "username"
password = "password"
# Put the proxy and reCaptcha token data
Captcha_dict = {
'proxy': 'http://user:password@127.0.0.1:1234',
'proxytype': 'HTTP',
'googlekey': '6Lc2fhwTAAAAAGatXTzFYfvlQMI2T7B6ji8UVV_f',
'pageurl': 'http://google.com'}
# Create a json string
json_Captcha = json.dumps(Captcha_dict)
# client = deathbycaptcha.SocketClient(username, password)
# to use http client client = deathbycaptcha.HttpClient(username, password)
client = deathbycaptcha.HttpClient(username, password)
try:
balance = client.get_balance()
# Put your CAPTCHA type and Json payload here:
captcha = client.decode(type=4, token_params=json_Captcha)
if captcha:
# The CAPTCHA was solved; captcha["captcha"] item holds its
# numeric ID, and captcha["text"] item its list of "coordinates".
print ("CAPTCHA %s solved: %s" % (captcha["captcha"], captcha["text"]))
if '': # check if the CAPTCHA was incorrectly solved
client.report(captcha["captcha"])
except deathbycaptcha.AccessDeniedException:
# Access to DBC API denied, check your credentials and/or balance
print ("error: Access to DBC API denied," +
"check your credentials and/or balance")