|
|
@@ -105,17 +105,17 @@ def _get_results(query, follow=True): |
|
|
|
query.error = "bad action" |
|
|
|
|
|
|
|
def _get_page_by_revid(site, revid): |
|
|
|
res = site.api_query(action="query", prop="info|revisions", revids=revid, |
|
|
|
rvprop="content|timestamp", inprop="protection|url", |
|
|
|
rvslots="main") |
|
|
|
try: |
|
|
|
res = site.api_query(action="query", prop="info|revisions", revids=revid, |
|
|
|
rvprop="content|timestamp", inprop="protection|url", |
|
|
|
rvslots="main") |
|
|
|
page_data = res["query"]["pages"].values()[0] |
|
|
|
title = page_data["title"] |
|
|
|
# Only need to check that these exist: |
|
|
|
revision = page_data["revisions"][0] |
|
|
|
revision["slots"]["main"]["*"] |
|
|
|
revision["timestamp"] |
|
|
|
except (KeyError, IndexError): |
|
|
|
except (exceptions.APIError, KeyError, IndexError): |
|
|
|
return None |
|
|
|
page = site.get_page(title) |
|
|
|
|
|
|
|