diff --git a/app.py b/app.py index dc26e4f..1e74520 100644 --- a/app.py +++ b/app.py @@ -10,8 +10,7 @@ from os import getenv PRICE_REGEX = re.compile( "(?:(?P[GBP|EUR|£|€])(?P[0-9]+(?:\.[0-9]{1,2})))") MODEL_REGEX = re.compile("[Rr][Tt][Xx] ?(?P30[6789]0( [Tt][Ii])?).?") - -URL_REGEX = "(?:(?:https?|ftp):\/\/|\b(?:[a-z\d]+\.))(?:(?:[^\s()<>]+|\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))?\))+(?:\((?:[^\s()<>]+|(?:\(?:[^\s()<>]+\)))?\)|[^\s`!()\[\]{};:'.,<>?«»“”‘’]))?" +URL_REGEX = re.compile("(?:(?:https?|ftp):\/\/|\b(?:[a-z\d]+\.))(?:(?:[^\s()<>]+|\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))?\))+(?:\((?:[^\s()<>]+|(?:\(?:[^\s()<>]+\)))?\)|[^\s`!()\[\]{};:'.,<>?«»“”‘’]))?") PARTALERT_ASIN = re.compile("asin=(?P[0-9a-zA-Z]{1,10})") PARTALERT_TLD = re.compile("tld=(?P\.(?:it|es|de|fr|co\.uk))") @@ -122,7 +121,7 @@ def on_message(resp): content = m['content'] if channelID in MONITORED_CHANNELS: - urls = re.findall(URL_REGEX, content) + urls = URL_REGEX.findall(content) if (urls): check_urls(urls)