request_method = default_proxy and proxy_post or post
    r = request_method(url_prefix + '/user/register?%s' % time.time(), data=data).json()
    if 'successful' in r['strText']:
        global current_acc
        current_acc = acc
        write_file('login.id', acc)
        print('注册成功')
        return True
    print(r['strText'])
    return r['strText']


def active_account(active_resp):
    active_url = re.findall(r'(http.+) ', active_resp['body']['text'])
    if active_url:
        requests.get(active_url[0])
        return False
    return True


if __name__ == '__main__':
    mail = Mailbox(True, active_account)
    if isinstance(register(mail.address), bool):
        mail.forever(active_account)
    pl = map_proxy_list()
    plt = '\r\n'.join(pl)
    write_file('proxy.list', plt)
    print('已将获取到的%s个代理写入 proxy.list 当中.' % len(pl))
    print('开始筛选代理,你可以通过设置超时时间来作为筛选条件')
    TestProxy(pl, timeout=1)