Page MenuHomePhabricator

Pywikibot failing with non-jSON response errors due to FANDOM url change
Closed, ResolvedPublic

Description

I am writing due to the issues I have with the usage of pywikibot on FANDOM site. This problem is connected with the URL change to fandom.com. For example, on this wiki I cannot use my bot. Here is the bug with using this bot.

15.png (343×600 px, 50 KB)

The version of Python is 3.7.1. All files required are installed, because I have been working with my bot earlier, before the domain migration, and it had worked. Do you know how to resolve this issue? I would be very grateful if you help me with the bug.

Event Timeline

zhuyifei1999 renamed this task from Bot problems to Pywikibot failing with non-jSON response errors due to FANDOM url change.Jan 31 2019, 9:33 PM
zhuyifei1999 removed a subscriber: pywikibot-bugs-list.
zhuyifei1999 subscribed.

Update your mlp family file. The file should be in C:\Users\Home\Downloads\core\pywikibot\families

Or you can backup and delete that file and re-generate.

The same for wowwiki. I'll provide a patch for wowwiki and you (@Gurte) can change your family accordingly

Xqt triaged this task as Low priority.Feb 1 2019, 2:19 PM

Change 487511 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [L10N] Update wowwiki family file

https://gerrit.wikimedia.org/r/487511

The Family file for mlp wiki (ul only) looks like

# -*- coding: utf-8 -*-
"""
This family file was auto-generated by generate_family_file.py script.

Configuration parameters:
  url = https://mlp.fandom.com/uk/wiki/%D0%94%D1%80%D1%83%D0%B6%D0%B1%D0%B0_%E2%80%94_%D1%86%D0%B5_%D0%B4%D0%B8%D0%B2%D0%BE_%D0%92%D1%96%D0%BA%D1%96
  name = mlpwiki

Please do not commit this to the Git repository!
"""
from __future__ import absolute_import, division, unicode_literals

from pywikibot import family
from pywikibot.tools import deprecated


class Family(family.Family):  # noqa: D101

    name = 'mlpwiki'
    langs = {
        'uk': 'mlp.fandom.com',
    }

    def scriptpath(self, code):
        return {
            'uk': '/uk',
        }[code]

    @deprecated('APISite.version()')
    def version(self, code):
        return {
            'uk': '1.19.24',
        }[code]

    def protocol(self, code):
        return {
            'uk': 'https',
        }[code]

This family file was auto-generated by generate_family_file.py script. For the complete family file use this script or change the current family file accordingly.

I'll try it. If some problems appear, I'll tell you.

Change 487511 merged by jenkins-bot:
[pywikibot/core@master] [L10N] Update wowwiki family file

https://gerrit.wikimedia.org/r/487511

Xqt claimed this task.