Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle choice of API for version unsupported by mwclient #392

Open
nemobis opened this issue Aug 6, 2020 · 2 comments
Open

Handle choice of API for version unsupported by mwclient #392

nemobis opened this issue Aug 6, 2020 · 2 comments

Comments

@nemobis
Copy link
Member

nemobis commented Aug 6, 2020

mwclient wants MediaWiki 1.16. Maybe we can work around it when we get an error, or at least try again with a guessed index.php.

$ python dumpgenerator.py --xml --images --xmlrevisions --api=http://igra-govno.com/api.php                                                                [72/78]
Checking API... http://igra-govno.com/api.php
MediaWiki API seems to work but returned no index URL
Traceback (most recent call last):
  File "dumpgenerator.py", line 2528, in <module>
    main()
  File "dumpgenerator.py", line 2474, in main
    config, other = getParameters(params=params)
  File "dumpgenerator.py", line 1779, in getParameters
    check, checkedapi = checkRetryAPI(api, args.retries, args.xmlrevisions, session)
  File "dumpgenerator.py", line 1917, in checkRetryAPI
    site = mwclient.Site(apiurl.netloc, apiurl.path.replace("api.php", ""), scheme=apiurl.scheme)
  File "/home/users/federico/.local/lib/python2.7/site-packages/mwclient/client.py", line 131, in __init__
    self.site_init()
  File "/home/users/federico/.local/lib/python2.7/site-packages/mwclient/client.py", line 166, in site_init
    self.require(1, 16)
  File "/home/users/federico/.local/lib/python2.7/site-packages/mwclient/client.py", line 464, in require
    current=(self.version[:2]))
mwclient.errors.MediaWikiVersionError: Requires version 1.16, current version is 1.15
@nemobis nemobis added this to the 0.4 milestone Aug 6, 2020
@nathanwaldman
Copy link

I just ran into this yesterday for my version 1.10 media wiki. I posted about it over here. Are there older versions of mwclient that support older media wiki API versions? Are they a drop in replacement for dumpgenerator.py? I started tweaking the code to remove the userinfo argument to the meta API parameter, but then ran in to the version check you described:

mwclient.errors.MediaWikiVersionError: Requires version 1.16, current version is 1.10

@nemobis
Copy link
Member Author

nemobis commented Aug 15, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants