default.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:nuodtayo.tv 作者: benaranguren 项目源码 文件源码
def login():
    cookie_jar.clear()
    login_page = callServiceApi("/user/login")
    form_login = common.parseDOM(login_page, "form", attrs = {'id' : 'form1'})
    request_verification_token = common.parseDOM(
        form_login[0], "input",
        attrs = {'name': '__RequestVerificationToken'}, ret='value'
    )
    emailAddress = this.getSetting('emailAddress')
    password = this.getSetting('password')
    formdata = {"EMail": emailAddress,
                "Password": password,
                '__RequestVerificationToken': request_verification_token[0]
               }
    headers = [('Referer', 'http://tfc.tv/User/Login')]
    response = callServiceApi("/user/login", formdata, headers=headers,
                              base_url='https://tfc.tv', timeout=120)
    common.log('LOGIN_STATUS')
    if 'logout' in response:
        common.log('LOGGED IN')
    else:
        xbmc.executebuiltin('Sign In Error')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号