mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Transformed the main RC fetching function to use new API requesting function
This commit is contained in:
parent
fd03d58a0c
commit
28e8c91871
19
src/wiki.py
19
src/wiki.py
|
@ -119,17 +119,14 @@ class Wiki(object):
|
||||||
"""Make a typical MW request for rc/abuselog
|
"""Make a typical MW request for rc/abuselog
|
||||||
|
|
||||||
If succeeds return the .json() of request and if not raises ConnectionError"""
|
If succeeds return the .json() of request and if not raises ConnectionError"""
|
||||||
request = self._safe_request(WIKI_API_PATH, params=self.construct_params(amount))
|
try:
|
||||||
if request is not None:
|
request = self.api_request(self.construct_params(amount))
|
||||||
try:
|
except (ServerError, MediaWikiError):
|
||||||
request = request.json()
|
raise ConnectionError
|
||||||
except ValueError:
|
except (ClientError, KeyError, BadRequest):
|
||||||
logger.warning("ValueError in fetching changes")
|
raise
|
||||||
logger.warning("Changes URL:" + request.url)
|
return request
|
||||||
self.downtime_controller(True)
|
|
||||||
raise ConnectionError
|
|
||||||
return request
|
|
||||||
raise ConnectionError
|
|
||||||
|
|
||||||
def construct_params(self, amount):
|
def construct_params(self, amount):
|
||||||
"""Constructs GET parameters for recentchanges/abuselog fetching feature"""
|
"""Constructs GET parameters for recentchanges/abuselog fetching feature"""
|
||||||
|
|
Loading…
Reference in a new issue