diff --git a/erepublik/citizen.py b/erepublik/citizen.py index 8b87c4f..9daf851 100644 --- a/erepublik/citizen.py +++ b/erepublik/citizen.py @@ -624,8 +624,16 @@ class BaseCitizen(access_points.CitizenAPI): self.sleep(5 * 60) else: raise classes.ErepublikException(f"HTTP {response.status_code} error!") + + if re.search(r'Occasionally there are a couple of things which we need to check or to implement in order make ' + r'your experience in eRepublik more pleasant. Don\'t worry about ongoing battles, timer ' + r'will be stopped during maintenance.', response.text): + self.write_log("eRepublik ss having maintenance. Sleeping for 5 minutes") + self.sleep(5 * 60) + return True return bool(re.search(r'body id="error"|Internal Server Error|' - r'CSRF attack detected|meta http-equiv="refresh"|not_authenticated', response.text)) + r'CSRF attack detected|meta http-equiv="refresh"|' + r'not_authenticated', response.text)) def _report_action(self, action: str, msg: str, **kwargs: Optional[Dict[str, Any]]): """ Report action to all available reporting channels