Aevann 2023-08-05 18:47:29 +03:00
parent ecf9cd9538
commit c7b7eb26e1
2 changed files with 2 additions and 2 deletions

View File

@ -122,7 +122,7 @@ 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('(<p>[^<]*)(https:\/\/youtube\.com\/watch\?[\w\-.#&/=?@%+]{7,})', flags=re.I|re.A)
youtube_regex = re.compile('((<p>|<img)[^<]*)(https:\/\/youtube\.com\/watch\?[\w\-.#&/=?@%+]{7,})', 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)

View File

@ -511,7 +511,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
if i.group(0) in captured: continue
captured.append(i.group(0))
html = handle_youtube_links(i.group(2))
html = handle_youtube_links(i.group(3))
if html:
sanitized = sanitized.replace(i.group(0), i.group(1) + html)