I want to test a tool I’m building in CI, so I set up a bot password for it on test.wikipedia.org. I thought this would mean I could just log in using that bot password in the python mwapi
module and then run the bot as usual (against one page), however it doesn’t seem to work.
$ python3
>>> import mwapi
>>> session = mwapi.Session('https://test.wikipedia.org')
Sending requests with default User-Agent. Set 'user_agent' on mwapi.Session to quiet this message.
>>> session.login(username='Lucas Werkmeister@QuickCategories-Travis-CI', password='REDACTED')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.7/site-packages/mwapi/session.py", line 245, in login
raise LoginError.from_doc(login_doc['clientlogin'])
mwapi.errors.LoginError: FAIL -- Incorrect username or password entered.
Please try again.
>>> session.login(username='Lucas Werkmeister', password='QuickCategories-Travis-CI@REDACTED')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.7/site-packages/mwapi/session.py", line 245, in login
raise LoginError.from_doc(login_doc['clientlogin'])
mwapi.errors.LoginError: FAIL -- Incorrect username or password entered.
Please try again.
After that, I tried adding a debug header and logging in again; the result is at ~lucaswerkmeister-wmde/bot-password.log
on mwlog1001.eqiad.wmnet
. There doesn’t seem to be any mention of a bot password in the log (it seems to treat it like a normal password for the fake user name), but there are some lines about a captcha – I thought that wasn’t supposed to matter for bot passwords?