diff --git a/gallery_dl/extractor/reddit.py b/gallery_dl/extractor/reddit.py index 89eafc8a..f36b1f5c 100644 --- a/gallery_dl/extractor/reddit.py +++ b/gallery_dl/extractor/reddit.py @@ -259,6 +259,8 @@ class RedditSubredditExtractor(RedditExtractor): self.subreddit, sub, params = match.groups() self.params = text.parse_query(params) if sub: + if sub == "search" and "restrict_sr" not in self.params: + self.params["restrict_sr"] = "1" self.subcategory += "-" + sub RedditExtractor.__init__(self, match) diff --git a/test/results/reddit.py b/test/results/reddit.py index 457aaf4b..3d531922 100644 --- a/test/results/reddit.py +++ b/test/results/reddit.py @@ -40,6 +40,17 @@ __tests__ = ( "#class" : reddit.RedditSubredditExtractor, }, +{ + "#url" : "https://www.reddit.com/r/IdiotsInCars/search/?q=flair%3AOC", + "#comment" : "(#7025)", + "#category": ("", "reddit", "subreddit-search"), + "#class" : reddit.RedditSubredditExtractor, + "#range" : "1-25", + + "subreddit" : "IdiotsInCars", + "link_flair_text": "OC", +}, + { "#url" : "https://www.reddit.com/", "#category": ("", "reddit", "home"),