From ed30144194900da0b5581e9dc4f42500d574f060 Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 23 Aug 2023 02:37:39 +0300 Subject: [PATCH] commit amp-cide --- files/helpers/sanitize.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index f7b3fa0d3..682cd479f 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -762,6 +762,12 @@ def normalize_url(url): .replace("https://www.tiktok.com", "https://tiktok.com") \ .replace("https://imgur.com/", "https://i.imgur.com/") \ .replace("/giphy.gif", "/giphy.webp") \ + .replace('https://www.google.com/amp/s/', 'https://') \ + .replace('https://amp.', 'https://') \ + .replace('/amp/', '/') \ + + if url.endswith('.amp'): + url = url.split('.amp')[0] url = giphy_regex.sub(r'\1.webp', url)