summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/reddit.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2022-01-25 20:10:48 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2022-01-25 20:10:48 -0500
commit8a812de1450d5d53fc1cd9a59f6c3f08452fc5b1 (patch)
tree8dc998621e167fb99f5e743857d8495daac2f6cd /gallery_dl/extractor/reddit.py
parent8de58070ee3e55f29966a787fd618632dbf4309b (diff)
New upstream version 1.20.3.upstream/1.20.3
Diffstat (limited to 'gallery_dl/extractor/reddit.py')
-rw-r--r--gallery_dl/extractor/reddit.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/gallery_dl/extractor/reddit.py b/gallery_dl/extractor/reddit.py
index 55c963d..f7809de 100644
--- a/gallery_dl/extractor/reddit.py
+++ b/gallery_dl/extractor/reddit.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2017-2021 Mike Fährmann
+# Copyright 2017-2022 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -19,7 +19,7 @@ class RedditExtractor(Extractor):
directory_fmt = ("{category}", "{subreddit}")
filename_fmt = "{id}{num:? //>02} {title[:220]}.{extension}"
archive_fmt = "{filename}"
- cookiedomain = None
+ cookiedomain = ".reddit.com"
def items(self):
self.api = RedditAPI(self)
@@ -301,6 +301,12 @@ class RedditAPI():
else:
self.refresh_token = token
+ if not self.refresh_token:
+ # allow downloading from quarantined subreddits (#2180)
+ extractor._cookiejar.set(
+ "_options", '%7B%22pref_quarantine_optin%22%3A%20true%7D',
+ domain=extractor.cookiedomain)
+
def submission(self, submission_id):
"""Fetch the (submission, comments)=-tuple for a submission id"""
endpoint = "/comments/" + submission_id + "/.json"