Page MenuHomePhabricator

Bot can't login. keyError in GetCookie: some modifications that make it work?
Closed, DuplicatePublic

Description

I have edited api.py

if login_result['login']['result'] == "Success":
    prefix = ''   #login_result['login']['cookieprefix']
    cookies = []
    #for key in ('Token', 'UserID', 'UserName'):
    for key in ('UserID', 'UserName'):
        cookies.append("%s%s=%s"
                       % (prefix, key,
                          login_result['login']['lg' + key.lower()]

I just left prefix as a blank string and removed 'Token' from the 'key' loop, and it seems to work. I can do editions, at least.

I don't know anything about the inner workings of pywikibot, so it may be breaking something else. Just to let you know.

Event Timeline

Mpaa renamed this task from Some modifications that make it work? to Bot can't login. keyError in GetCookie: some modifications that make it work?.Aug 5 2016, 9:48 PM