Board Thread:API Discussion/@comment-131168-20190730022121

Hi. I'm not sure this is the right place to ask, but I'm not sure where else is, either. Started at the Pywikibot manual talk page. Once I figured it was likely more to do with Fandom than Pywikibot I posted as the Community tech board, and the so far lone reply there suggested I head this way.

I'm trying to use Pywikibot to generate interwiki links. I used to do this with old versions of Pywikibot and Python, but Fandom has changed enough since then that I'm having to move to modern versions and running into new roadblocks. It will work on a small number of pages (either by telling it to start at a late point in the alphabet, or by giving it a file with an explicit list of up to around 25 pages), but when I try to tell it to just do all pages from the start it throws up on me. Based on the error results, maybe something different about what it's getting from Fandom's API than what it expects from default MediaWiki? If that's the case is there a workaround? Or if there's a non-Pywikibot method for doing interwiki links, that would be just as good.

Right now my closest plan to a solution is getting a list of all pages, forcing it into sections of 25, and telling them to run one after the other. Far from ideal, but also far better than doing things manually.

D:\pywikibot>pwb.py interwiki -lang:da -start:! NOTE: Number of pages queued is 0, trying to add 50 more. Skipping: Forside is in the skip list Retrieving 50 pages from hpwiki:da. Dump da (hpwiki) appended. Traceback (most recent call last): File "D:\pywikibot\pwb.py", line 297, in    if not main: File "D:\pywikibot\pwb.py", line 292, in main run_python_file(filename, [filename] + args, argvu, file_package) File "D:\pywikibot\pwb.py", line 96, in run_python_file main_mod.__dict__) File ".\scripts\interwiki.py", line 2577, in     main  File ".\scripts\interwiki.py", line 2553, in main    bot.run  File ".\scripts\interwiki.py", line 2265, in run    self.queryStep  File ".\scripts\interwiki.py", line 2239, in queryStep    self.oneQuery  File ".\scripts\interwiki.py", line 2228, in oneQuery    for page in gen:  File "D:\pywikibot\pywikibot\site.py", line 3374, in preloadpages    for pagedata in rvgen:  File "D:\pywikibot\pywikibot\data\api.py", line 2983, in __iter__    for result in super(PropertyGenerator, self).__iter__:  File "D:\pywikibot\pywikibot\data\api.py", line 2823, in __iter__    for result in self._extract_results(resultdata):  File "D:\pywikibot\pywikibot\data\api.py", line 2997, in _extract_results    self._update_old_result_dict(d, data_dict)  File "D:\pywikibot\pywikibot\data\api.py", line 3018, in _update_old_result_dict 'continued API result had an unexpected type: %s' % type(v)) AssertionError: continued API result had an unexpected type:  CRITICAL: Exiting due to uncaught exception 

D:\pywikibot>  