From 77ddfa6a7b9d1b6f4a4ac458f4c5a3f15982a186 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 12 Aug 2023 17:17:55 +0300 Subject: [PATCH] fix this https://rdrama.net/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/4788376#context --- files/helpers/regex.py | 4 ++-- files/helpers/sanitize.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/files/helpers/regex.py b/files/helpers/regex.py index 2c18a8a4c..9ba89d80c 100644 --- a/files/helpers/regex.py +++ b/files/helpers/regex.py @@ -119,11 +119,11 @@ imgur_regex = re.compile(f'(https:\/\/i\.imgur\.com\/[a-z0-9]+)\.({image_regex_e giphy_regex = re.compile('(https:\/\/media\.giphy\.com\/media\/[a-z0-9]+\/giphy)\.gif', flags=re.I|re.A) -youtube_regex = re.compile('' + NOT_IN_CODE_OR_LINKS, flags=re.I|re.A) yt_id_regex = re.compile('[\w\-]{5,20}', flags=re.A) rumble_regex = re.compile('https://rumble\.com/embed/([a-zA-Z0-9]*)/\?pub=([a-zA-Z0-9]*)',flags=re.I|re.A) -bare_youtube_regex = re.compile('https:\/\/youtube\.com\/watch\?([\w\-.#&/=?@%+]{7,})',flags=re.I|re.A) +bare_youtube_regex = re.compile('https:\/\/youtube\.com\/watch\?([\w\-.#&/=?@%+;]{7,})',flags=re.I|re.A) twitch_regex = re.compile('(https:\/\/)?(www\.)?twitch.tv/(.*)',flags=re.I|re.A) link_fix_regex = re.compile("(\[.*?\]\()(?!http|\/)(.*?\))" + NOT_IN_CODE_OR_LINKS, flags=re.A) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index df411b80c..8aec49736 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -386,6 +386,7 @@ def get_youtube_id_and_t(url): return (id, t) def handle_youtube_links(url): + url = url.replace('&','&') params = parse_qs(urlparse(url).query, keep_blank_values=True) html = None id, t = get_youtube_id_and_t(url)