示例#1
0
def prepare():
    global br
    PixivUtil2.__config__.loadConfig()
    br = PixivUtil2.configBrowser()

    ## Log in
    username = PixivUtil2.__config__.username
    if username == '':
        username = raw_input('Username ? ')
    password = PixivUtil2.__config__.password
    if password == '':
        password = getpass.getpass('Password ? ')
        
    result = False
    if len(PixivUtil2.__config__.cookie) > 0:
        result = PixivUtil2.pixivLoginCookie()

    if not result:
        if PixivUtil2.__config__.useSSL:
            result = PixivUtil2.pixivLoginSSL(username,password)
        else:
            result = PixivUtil2.pixivLogin(username,password)