Skip to content

Commit

Permalink
Capture PTP urls not in tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Nov 23, 2024
1 parent 5478cf3 commit 3734c66
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/bbcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3734c66

Please sign in to comment.