diff --git a/src/bbcode.py b/src/bbcode.py index 102dcff1..8ed1a386 100644 --- a/src/bbcode.py +++ b/src/bbcode.py @@ -47,7 +47,11 @@ def clean_ptp_description(self, desc, is_disc): desc = desc.replace('\r\n', '\n') # Remove url tags with PTP/HDB links - url_tags = re.findall(r"(\[url[\=\]]https?:\/\/passthepopcorn\.m[^\]]+)([^\[]+)(\[\/url\])?", desc, flags=re.IGNORECASE) + url_tags = re.findall( + r"(?:\[url(?:=|\])[^\]]*https?:\/\/passthepopcorn\.m[^\]]*\]|\bhttps?:\/\/passthepopcorn\.m[^\s]+)", + desc, + flags=re.IGNORECASE, + ) url_tags += re.findall(r"(\[url[\=\]]https?:\/\/hdbits\.o[^\]]+)([^\[]+)(\[\/url\])?", desc, flags=re.IGNORECASE) if url_tags: for url_tag in url_tags: