From fd65f27ede916bb6bbc83fb56877a6eb9d9f3288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 28 Aug 2023 17:17:03 +0200 Subject: [PATCH] [reddit] fix 'preview.redd.it' URLs (#4470) --- gallery_dl/extractor/reddit.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/reddit.py b/gallery_dl/extractor/reddit.py index 55a7f65f..39e98ba5 100644 --- a/gallery_dl/extractor/reddit.py +++ b/gallery_dl/extractor/reddit.py @@ -65,7 +65,10 @@ class RedditExtractor(Extractor): media = submission url = media["url"] - if url and url.startswith("https://i.redd.it/"): + if url and url.startswith(( + "https://i.redd.it/", + "https://preview.redd.it/", + )): text.nameext_from_url(url, submission) yield Message.Url, url, submission @@ -309,6 +312,11 @@ class RedditSubmissionExtractor(RedditExtractor): ("https://www.reddit.com/r/kittengifs/comments/12m0b8d", { "pattern": r"ytdl:https://v\.redd\.it/cvabpjacrvta1", }), + # preview.redd.it (#4470) + ("https://www.reddit.com/r/europe/comments/pm4531/the_name_of/", { + "pattern": r"https://preview.redd.it/u9ud4k6xaf271.jpg?auto=webp" + r"&s=19b1334cb4409111cda136c01f7b44c2c42bf9fb", + }), ("https://old.reddit.com/r/lavaporn/comments/2a00np/"), ("https://np.reddit.com/r/lavaporn/comments/2a00np/"), ("https://m.reddit.com/r/lavaporn/comments/2a00np/"),