Skip to content

Commit

Permalink
Use more permissive regex.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmiegit committed Aug 13, 2023
1 parent 8351ad4 commit 88dbcea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from config import Configuration

REGEX_CROM_RATE_LIMIT = re.compile(r"(?:Rate limit exceeded: Try again in (\d+) seconds?\.|You're making requests too often! Please wait for (\d+) seconds?\.)")
REGEX_CROM_RATE_LIMIT = re.compile(r"(?:in|for) (\d+) seconds?")
REGEX_WIKIDOT_URL = re.compile(r'^https?://([\w\-]+)\.wikidot\.com/(.+)$')
REGEX_MODULE_CSS = re.compile(r'\[\[module +css\]\]\n(.+?)\n\[\[/module\]\]', re.IGNORECASE | re.DOTALL)
REGEX_INLINE_CSS = re.compile(r'style="(.+?)"[^\]]*?\]\]', re.MULTILINE | re.IGNORECASE)
Expand Down Expand Up @@ -108,7 +108,7 @@ def _get_message(errors):

def _get_ratelimit(self):
for error in self.errors:
match = REGEX_CROM_RATE_LIMIT.fullmatch(error["message"])
match = REGEX_CROM_RATE_LIMIT.search(error["message"])
if match is not None:
return int(match[1])

Expand Down

0 comments on commit 88dbcea

Please sign in to comment.