From 6ae3cd6d08477a05fa187ae8496f983256a0bfc4 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 19 Oct 2014 20:25:06 -0500 Subject: [PATCH] Handle interwiki page titles correctly. --- earwigbot/wiki/page.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/earwigbot/wiki/page.py b/earwigbot/wiki/page.py index d509d96..e314853 100644 --- a/earwigbot/wiki/page.py +++ b/earwigbot/wiki/page.py @@ -211,8 +211,12 @@ class Page(CopyvioMixIn): inprop="protection|url", rvprop="user", rvlimit=1, rvdir="newer", titles=self._title) - res = result["query"]["pages"].values()[0] + if "interwiki" in result["query"]: + self._title = result["query"]["interwiki"][0]["title"] + self._exists = self.PAGE_INVALID + return + res = result["query"]["pages"].values()[0] self._title = res["title"] # Normalize our pagename/title self._is_redirect = "redirect" in res