0

I am trying to log pywikibot into a mediawiki I am running on my local computer through Wanpserver.

When I try to login.py I get

(base) PS C:\core_stable> python pwb.py login.py
WARNING: No user is logged in on site mediawiki:mediawiki
ERROR: Username 'Melchior' does not exist on mediawiki:mediawiki
Not logged in on mediawiki:mediawiki.

Execution time: 0 seconds

I think I don't understand how to configure user-config.py and nothing I am reading makes sense (new to python).

I tried to change mess around with user-config.py (tried different ways to try and point to the correct server. I think what is happening is I am not pointing the bot at the server correctly).

This is my current user-config.py

family = 'mediawiki'
mylang = 'mediawiki'
usernames['mediawiki']['mediawiki'] = 'melchior'
password_file = None

What am I doing wrong?

1 Answers1

0

Because your wiki is a custom one, you need to define a new family. Assume your wiki is installed in 'http://localhost/w/' and the API page is located at 'http://localhost/w/api.php', the user-config.py file will look like below:

family_files['yourwiki'] = 'http://localhost/w/api.php'

family = 'yourwiki'
mylang = 'yourwiki'
usernames['yourwiki']['*'] = 'YourUsername'
password_file = None

After that, you should be able to login to your wiki:

PS D:\core> python pwb.py login
WARNING: No user is logged in on site yourwiki:yourwiki
Password for user YourUsername on yourwiki:yourwiki (no characters will be shown):
Logging in to yourwiki:yourwiki as YourUsername
Logged in on yourwiki:yourwiki as YourUsername.

Check out this page for further documentation: Manual:Pywikibot/Use on third-party wikis.

IoeCmcomc
  • 86
  • 2
  • 5