Skip to content

Commit 98c5922

Browse files
committed
[reddit:user] disable 'only' for '/saved' results (#9071)
and prevent "KeyError: 'name'" when accessing the full username
1 parent e8cb9e3 commit 98c5922

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

docs/configuration.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5506,7 +5506,10 @@ extractor.reddit.user.only
55065506
Type
55075507
``bool``
55085508
Default
5509-
``trur``
5509+
``user-saved``
5510+
``false``
5511+
otherwise
5512+
``true``
55105513
Description
55115514
Only process and return posts from the user specified in the input URL.
55125515

docs/gallery-dl.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,9 @@
714714

715715
"user": {
716716
"only": true
717+
},
718+
"user-saved": {
719+
"only": false
717720
}
718721
},
719722
"redgifs":

gallery_dl/extractor/reddit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ def submissions(self):
319319
self.kwdict["user"] = user = self.api.user_about(username)
320320

321321
submissions = self.api.submissions_user(
322-
user["name"] + (sub or ""), text.parse_query(qs))
323-
if self.config("only", True):
322+
(user.get("name") or username) + (sub or ""), text.parse_query(qs))
323+
if self.config("only", sub != "/saved"):
324324
submissions = self._only(submissions, user)
325325
return submissions
326326

0 commit comments

Comments
 (0)