@@ -126,6 +126,7 @@ class RCMonitor(Command): | |||||
try: | try: | ||||
result = site.api_query( | result = site.api_query( | ||||
action="query", prop="revisions", rvprop="ids|content", | action="query", prop="revisions", rvprop="ids|content", | ||||
rvslots="main", | |||||
revids=(oldrev + "|" + newrev) if oldrev else newrev) | revids=(oldrev + "|" + newrev) if oldrev else newrev) | ||||
except APIError: | except APIError: | ||||
return None | return None | ||||
@@ -140,14 +141,16 @@ class RCMonitor(Command): | |||||
if not oldrev: | if not oldrev: | ||||
try: | try: | ||||
text = revs[0]["*"] | |||||
text = revs[0]["slots"]["main"]["*"] | |||||
except (IndexError, KeyError): | except (IndexError, KeyError): | ||||
return None | return None | ||||
return _Diff(text.splitlines(), []) | return _Diff(text.splitlines(), []) | ||||
try: | try: | ||||
oldtext = [rv["*"] for rv in revs if rv["revid"] == int(oldrev)][0] | |||||
newtext = [rv["*"] for rv in revs if rv["revid"] == int(newrev)][0] | |||||
oldtext = [rv["slots"]["main"]["*"] for rv in revs | |||||
if rv["revid"] == int(oldrev)][0] | |||||
newtext = [rv["slots"]["main"]["*"] for rv in revs | |||||
if rv["revid"] == int(newrev)][0] | |||||
except (IndexError, KeyError): | except (IndexError, KeyError): | ||||
return None | return None | ||||
@@ -502,9 +502,11 @@ class AFCStatistics(Task): | |||||
if revid in self.revision_cache: | if revid in self.revision_cache: | ||||
return self.revision_cache[revid] | return self.revision_cache[revid] | ||||
res = self.site.api_query(action="query", prop="revisions", | res = self.site.api_query(action="query", prop="revisions", | ||||
revids=revid, rvprop="content") | |||||
rvprop="content", rvslots="main", | |||||
revids=revid) | |||||
try: | try: | ||||
content = res["query"]["pages"].values()[0]["revisions"][0]["*"] | |||||
revision = res["query"]["pages"].values()[0]["revisions"][0] | |||||
content = revision["slots"]["main"]["*"] | |||||
except KeyError: | except KeyError: | ||||
if tries == 0: | if tries == 0: | ||||
raise | raise | ||||
@@ -86,15 +86,16 @@ class BannerUntag(Task): | |||||
return | return | ||||
res2 = self.site.api_query( | res2 = self.site.api_query( | ||||
action="query", prop="revisions", rvprop="content", | |||||
action="query", prop="revisions", rvprop="content", rvslots="main", | |||||
revids="|".join(stage2), formatversion=2) | revids="|".join(stage2), formatversion=2) | ||||
for pagedata in res2["query"]["pages"]: | for pagedata in res2["query"]["pages"]: | ||||
if pagedata["revisions"][0]["contentmodel"] != "wikitext": | |||||
revision = pagedata["revisions"][0]["slots"]["main"] | |||||
if revision["contentmodel"] != "wikitext": | |||||
continue | continue | ||||
pageid = pagedata["pageid"] | pageid = pagedata["pageid"] | ||||
title = pagedata["title"] | title = pagedata["title"] | ||||
content = pagedata["revisions"][0]["content"] | |||||
content = revision["content"] | |||||
self.logger.debug(u"Reverting one edit on [[%s]]" % title) | self.logger.debug(u"Reverting one edit on [[%s]]" % title) | ||||
page = self.site.get_page(title) | page = self.site.get_page(title) | ||||