Self-encapsulated CAPTCHA human bypass. We recommend that you use CAPTCHA human bypass (called official dll) in windows, and Superman CAPTCHA human bypass (http api) in linux)
Copy codeThe Code is as follows:
# Coding: UTF-8
From ctypes import *
Import requests
Import json
Import random
Import binascii
From config import config
Class Dama2 ():
"CAPTCHA human bypass ."""
_ Username =''
_ Password =''
_ Attrs _ = ['dm', 'username', 'Password', 'softuuid', 'timeout']
Def _ init _ (self ):
Self. DM = WinDLL ('lib/CrackCaptchaAPI. dll ')
If not self. _ username:
Dama2. _ username = config ['dama'] ['dama2 '] ['username']
Dama2. _ password = config ['dama'] ['dama2 '] ['Password']
Self. username = c_char_p (self. _ username)
Self. password = c_char_p (self. _ password)
Self. softuuid = c_char_p ('6fbc06efdc777eee854810972102daec ')
Self. timeout = c_ushort (30)
Def recv_byte (self, imgdata, imgtype = 42 ):
# Imgdata = c_void_p (imgdata)
Imgleng = c_uint (len (imgdata ))
Imgtype = c_ulong (imgtype)
Res = c_char_p ('')
Code = self. DM. D2Buf (self. softuuid, self. username, self. password, imgdata, imgleng, self. timeout, imgtype, res)
If code> 0:
Return res. value
Return False
Def report_err (self, imgid ):
Return False
Class Chaoren ():
_ Username =''
_ Password =''
_ Attrs _ = ['dm', 'username', 'Password', 'softuuid', 'timeout']
Def _ init _ (self ):
If not self. _ username:
Chaoren. _ username = config ['dama'] ['chaoren'] ['username']
Chaoren. _ password = config ['dama'] ['chaoren'] ['Password']
Self. s = requests. Session ()
Self. s. encoding = 'utf-8'
Self. s. timeout = 16
Self. data = {
'Username': self. username,
'Password': self. password,
'Softid': '000000', # Replace 1234 with your own
'Imgid ':'',
'Imgdata ':''
}
Def get_left_point (self ):
Try:
R = self. s. post ('HTTP: // apib.sz789.net: 88/GetUserInfo. ashx', self. data)
Return r. json ()
Failed t requests. ConnectionError:
Return self. get_left_point ()
Except t:
Return False
Def recv_byte (self, imgdata ):
Self. data ['imgdata'] = binascii. b2a_hex (imgdata). upper ()
Try:
R = self. s. post ('HTTP: // apib.sz789.net: 88/RecvByte. ashx', self. data)
Res = r. json ()
If res [u'info'] =-1:
Self. report_err (res [u'imgid']) # identify errors
Return False
Return r. json () [u 'result']
Failed t requests. ConnectionError:
Return self. recv_byte (imgdata)
Except t:
Return False
Def report_err (self, imgid ):
Self. data ['imgid'] = imgid
If self. data ['imgdata']:
Del self. data ['imgdata']
Try:
R = self. s. post ('HTTP: // apib.sz789.net: 88/ReportError. ashx', self. data)
Return r. json ()
Failed t requests. ConnectionError:
Return self. report_err (imgid)
Except t:
Return False
Class Dama ():
Flag = 'dama2'
Def _ init _ (self ):
If self. flag = 'dama2 ':
Self. w = Dama2 ()
Elif self. flag = 'chaoren ':
Self. w = Chaoren ()
Else:
Self. w = Dama2 () # default
Def recv_byte (self, imgdata ):
Return self. w. recv_byte (imgdata)
Def report_err (self, imgid ):
Return self. w. report_err (imgid)
# Test
If _ name _ = '_ main __':
Pass
"""
Replace username and password with your own
"""