only parse 302 for known hosts eg spotify.link

This commit is contained in:
Your Name 2024-04-07 14:22:56 -04:00 committed by Henri Dickson
parent e5c3347380
commit 27a45deb6e

View file

@ -298,7 +298,7 @@ class SiteManager:
cls = next(
filter(lambda p: p.validate_url(url), SiteManager.registry.values()), None
)
if cls is None:
if cls is None and re.match(r"^https?://(spotify.link|t.co).+", url):
try:
url2 = requests.head(url, allow_redirects=True, timeout=1).url
if url2 != url: