Closed robkam closed 1 year ago
I logged in as USERNAME and exported miraheze.org_cookies.txt then I included --cookies in the command line and the error message changed. Also scruffymirahezeorg_w-20221220-titles.txt is an empty file.
$ dumpgenerator --cookies miraheze.org_cookies.txt --user USERNAME --pass PASSWORD --delay 0.0 --failfast --xml --images --xmlrevisions --images --api=https://scruffy.miraheze.org/w/api.php
Using cookies from miraheze.org_cookies.txt
Checking API... https://scruffy.miraheze.org/w/api.php
API is OK: https://scruffy.miraheze.org/w/api.php
Checking index.php... https://scruffy.miraheze.org/w/index.php
index.php is OK
No --path argument provided. Defaulting to:
[working_directory]/[domain_prefix]-[date]-wikidump
Which expands to:
./scruffymirahezeorg_w-20221220-wikidump
#########################################################################
# Welcome to DumpGenerator 0.4.0-alpha by WikiTeam (GPL v3) #
# More info at: https://github.com/elsiehupp/wikiteam3 #
#########################################################################
#########################################################################
# Copyright (C) 2011-2022 WikiTeam developers #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
#########################################################################
Analysing https://scruffy.miraheze.org/w/api.php
Trying generating a new dump into a new directory...
Loading page titles from namespaces = all
Excluding titles from namespaces = None
28 namespaces found
Traceback (most recent call last):
File "C:\Users\Rob\AppData[...]site-packages\mwclient\listing.py", line 55, in __next__
item = six.next(self._iter)
^^^^^^^^^^^^^^^^^^^^
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\Rob\AppData[...]Scripts\dumpgenerator.exe\__main__.py", line 7, in <module>
File "C:\Users\Rob\AppData[...]site-packages\wikiteam3\dumpgenerator\__init__.py", line 26, in main
DumpGenerator()
File "C:\Users\Rob\AppData[...]site-packages\wikiteam3\dumpgenerator\generator.py", line 87, in __init__
DumpGenerator.createNewDump(config=config, other=other)
File "C:\Users\Rob\AppData[...]site-packages\wikiteam3\dumpgenerator\generator.py", line 98, in createNewDump
getPageTitles(config=config, session=other["session"])
File "C:\Users\Rob\AppData[...]site-packages\wikiteam3\dumpgenerator\page_titles.py", line 193, in getPageTitles
for title in titles:
File "C:\Users\Rob\AppData[...]site-packages\wikiteam3\dumpgenerator\page_titles.py", line 28, in getPageTitlesAPI
for page in site.allpages(namespace=namespace):
File "C:\Users\Rob\AppData[...]site-packages\mwclient\listing.py", line 180, in __next__
info = super(GeneratorList, self).__next__()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Rob\AppData[...]site-packages\mwclient\listing.py", line 61, in __next__
self.load_chunk()
File "C:\Users\Rob\AppData[...]site-packages\mwclient\listing.py", line 191, in load_chunk
return super(GeneratorList, self).load_chunk()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Rob\AppData[...]site-packages\mwclient\listing.py", line 95, in load_chunk
data = self.site.get(
^^^^^^^^^^^^^^
File "C:\Users\Rob\AppData[...]site-packages\mwclient\client.py", line 234, in get
return self.api(action, 'GET', *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Rob\AppData[...]site-packages\mwclient\client.py", line 288, in api
if self.handle_api_result(info, sleeper=sleeper):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Rob\AppData[...]site-packages\mwclient\client.py", line 331, in handle_api_result
raise errors.APIError(info['error']['code'],
mwclient.errors.APIError: ('readapidenied', 'You need read permission to use this module.', 'See https://scruffy.miraheze.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes.')
Retrieving titles in the namespace 0
Added (On Miraheze wiki via Manage this wiki's additional settings > Permissions)
$wgWhitelistRead = [
'Special:Export'
];
gives the same error as above.
This should be using OAuth.
Issue raised at https://github.com/mwclient/mwclient/issues/278
Using Git Bash on Windows 10 with Python 3.11.1 from Microsoft Store, and python3 branch. Substituting fake user and pass here: