[reddit] fix '/external-preview' embed downloads (#9037)

don't strip URL parameters
This commit is contained in:
Mike Fährmann
2026-02-10 18:59:17 +01:00
parent f67b99a7b4
commit 102f8da294
2 changed files with 14 additions and 1 deletions

View File

@@ -215,7 +215,10 @@ class RedditExtractor(Extractor):
if src := data.get("s"):
if url := src.get("u") or src.get("gif") or src.get("mp4"):
yield url.partition("?")[0].replace("/preview.", "/i.", 1)
if "//external" not in url:
url = url.partition("?")[0].replace(
"/preview.", "/i.", 1)
yield url
else:
self.log.error(
"embed %s: unable to fetch download URL for item %s",