示例#1
0
    def on_captcha(self, image):
        logging.info('Solving captcha...')
        f = StringIO()
        f.write(image)
        f.seek(0)
        dbccli = DBCClient(options.dbc_username, options.dbc_password)

        try:
            captcha = dbccli.decode(f, 60)
        except:
            log.exception('Error solving captcha')
            sys.exit(1)

        if captcha:
            self.captcha = captcha
            return captcha['text'], captcha

        sys.exit(1)
示例#2
0
    def on_captcha(self, image):
        logging.info('Solving captcha...')
        f = StringIO()
        f.write(image)
        f.seek(0)
        dbccli = DBCClient(options.dbc_username, options.dbc_password)

        try:
            captcha = dbccli.decode(f, 60)
        except:
            log.exception('Error solving captcha')
            sys.exit(1)

        if captcha:
            self.captcha = captcha
            return captcha['text'], captcha

        sys.exit(1)
示例#3
0
文件: base.py 项目: QQiot/AMZ_EMAIL
class MyDecapcha:
    def __init__(self):
        self.user = '******'
        self.passwd = 'AAbb1122'
        self.client = SocketClient(self.user, self.passwd)
        self.client.is_verbose = False

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_value, traceback):
        try:
            self.client.close()
        except Exception:
            log.exception('Failed to close dbc client')

    def decode(self, fn, timeout=60):
        try:
            captcha = self.client.decode(fn, timeout=timeout)
            return captcha['text'].strip()
        except Exception:
            log.exception('Failed to decode')
            return None
示例#4
0
文件: aya.py 项目: feisuzhu/thbattle
 def on_captcha_wrong(self, tag):
     log.info('Captcha wrong!')
     from deathbycaptcha import SocketClient as DBCClient
     dbccli = DBCClient(State.options.dbc_username, State.options.dbc_password)
     dbccli.report(tag['captcha'])
示例#5
0
 def on_captcha_wrong(self, tag):
     log.info('Captcha wrong!')
     from deathbycaptcha import SocketClient as DBCClient
     dbccli = DBCClient(State.options.dbc_username,
                        State.options.dbc_password)
     dbccli.report(tag['captcha'])
示例#6
0
 def on_captcha_wrong(self, tag):
     log.info('Captcha wrong!')
     dbccli = DBCClient(options.dbc_username, options.dbc_password)
     dbccli.report(tag['captcha'])
示例#7
0
 def on_captcha_wrong(self, tag):
     log.info('Captcha wrong!')
     dbccli = DBCClient(options.dbc_username, options.dbc_password)
     dbccli.report(tag['captcha'])
示例#8
0
文件: base.py 项目: QQiot/AMZ_EMAIL
 def __init__(self):
     self.user = '******'
     self.passwd = 'AAbb1122'
     self.client = SocketClient(self.user, self.passwd)
     self.client.is_verbose = False