diff options
| author | 2025-03-10 03:45:04 -0400 | |
|---|---|---|
| committer | 2025-03-10 03:45:04 -0400 | |
| commit | b4181aecfa495a0926a9c065bf54897d64b14fbc (patch) | |
| tree | 1096876572bf7f51488a1a57cb9a5267e571947c /gallery_dl/extractor/reddit.py | |
| parent | 59733b48db6fe610ee4024ce1e93d10e76538087 (diff) | |
| parent | 243d1f1beb4e4eb75a524f1aff948c47761a4f1d (diff) | |
Update upstream source from tag 'upstream/1.29.1'
Update to upstream version '1.29.1'
with Debian dir 67c32bd8f39b0155ec16fb6af065feb7f1333f75
Diffstat (limited to 'gallery_dl/extractor/reddit.py')
| -rw-r--r-- | gallery_dl/extractor/reddit.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gallery_dl/extractor/reddit.py b/gallery_dl/extractor/reddit.py index f36b1f5..7a9e3c5 100644 --- a/gallery_dl/extractor/reddit.py +++ b/gallery_dl/extractor/reddit.py @@ -41,6 +41,11 @@ class RedditExtractor(Extractor): self._extract_video = self._extract_video_dash videos = True + selftext = self.config("selftext") + if selftext is None: + selftext = self.api.comments + selftext = True if selftext else False + submissions = self.submissions() visited = set() depth = 0 @@ -92,12 +97,12 @@ class RedditExtractor(Extractor): elif parentdir: yield Message.Directory, comments[0] + if selftext and submission: + for url in text.extract_iter( + submission["selftext_html"] or "", ' href="', '"'): + urls.append((url, submission)) + if self.api.comments: - if submission: - for url in text.extract_iter( - submission["selftext_html"] or "", - ' href="', '"'): - urls.append((url, submission)) for comment in comments: html = comment["body_html"] or "" href = (' href="' in html) |
