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

Add option to reconstruct XML from the pages API #429

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

GERZAC1002
Copy link

Merged: Add support to backup pages using API:Query instead of Special:Export #280 into recent version of dumpgenerator.py
(so, most credit should go to NyaMisty who tried to merge this back in 2016 and closed the pull request back in 2018)

Adds additional parameter: --apiquery
which uses a query request instead of submit request on api.php which works without Special:Export which is disabled on some sites.

Also adds: --ignore-api-check
which i just copied from the earlier mentioned pull request and it doesn't do much so it could be removed as well

I stumbled into the problem when trying to download https://pokewiki.de where Special:Export wasn't available and i tried the old version from 2016 with the pull request #280 which seems to work so far. I am still doing some testing as I am mostly just trying to archive game wikis and have not much coding experience. I didn't wanted all revisions and only the current once which didn't work because of the missing 'Special:Export' page. Also '--xmlrevisions' wasn't working either as it failed after some time and resuming the progress only lead to it downloading the same pages over again creating many duplicates inside the output file and not going further.

so some improvements I haven't done would include:

  • checks if something will break by merging it as i am not using '--xmlrevisions' as it caused more problems for me than it solved. I dumped a few wikis with the new version with this options:'--namespaces 0,4,6,8,12,14 --xml --image --curonly <url> '
  • checking for the availability of 'Special:Export' page before retrieving all the namespaces to save bandwidth of the wiki-owners
  • maybe change back some timeouts, I adjusted some for my self as i noticed some slower less performant wikis took longer to respond when dumping everything

Thank you all for the great work :)
I am just trying to give something back to the community even if it is just recycling old pull requests that got closed.

Add support to backup pages using API:Query instead of Special:Export
WikiTeam#280

into recent version of dumpgenerator.py

Adds additional parameter: --apiexport
which uses a query request instead of submit on api.php which works
without Special:Export which is disabled on some sites.
 -renamed --apiexport to '--apiquery' and gave it a more useful help text
 -renamed function 'getXMLPage_' to 'selectXMLQuerMode' to make it distinct enough from 'getXMLPage'
 -added in checks so that '--apiquery' can only be used together with '--curonly'
 -dialed back some timeouts from 120 to 60 which is still more than the previous 30

Improvements that could still be implemented:
 -Checking the availability of Special:Export before trying to download the list of titles and images wasting resources
'--images' and '--xmlrevisions' too, accidentally disabled that in
previous commit
@nemobis
Copy link
Member

nemobis commented Apr 12, 2022 via email

@nemobis nemobis changed the title Merged Pull reques #280 into the recent version of dumpgenerator.py which might solve pinned issue #311 Add option to reconstruct XML from the pages API Apr 12, 2022
@GERZAC1002
Copy link
Author

GERZAC1002 commented Apr 12, 2022

I tried --xmlrevisions which always failed and resuming basically made it write the same pages over and over into the output file
2022-04-12-093155_3840x1080_scrot
at that point it was easier to resolve the other issue using the older pull request:
2022-04-12-094337_3840x1080_scrot

@nemobis
Copy link
Member

nemobis commented Apr 12, 2022 via email

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

Successfully merging this pull request may close these issues.

None yet

2 participants