diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 6e9fb73fd..f95e338c5 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -173,13 +173,6 @@ def sanitize(sanitized): sanitized = sanitized.replace(f':{i.group(1)}:', f'') sanitized = sanitized.replace("https://www.", "https://").replace("https://youtu.be/", "https://youtube.com/watch?v=").replace("https://music.youtube.com/watch?v=", "https://youtube.com/watch?v=").replace("https://open.spotify.com/", "https://open.spotify.com/embed/").replace("https://streamable.com/", "https://streamable.com/e/").replace("https://youtube.com/shorts/", "https://youtube.com/watch?v=") - - if '" rel="nofollow noopener" target="_blank">https://youtube.com/watch?v=' in sanitized: - sanitized = sanitized.replace("watch?v=", "embed/") - url = re.search('(https://youtube.com/embed/.*?)"', sanitized).group(1) - replacing = f'
' - htmlsource = f'' - sanitized = sanitized.replace(replacing, htmlsource) for i in re.finditer('" target="_blank">(https://youtube.com/watch\?v\=.*?)', sanitized): url = i.group(1)