[reddit] bugfix for 8e3fd7e034

This commit is contained in:
pukkandan 2021-10-05 08:34:05 +05:30
parent 644149afec
commit 1b6bb4a85a
No known key found for this signature in database
GPG key ID: 0F00D95A001F4698

View file

@ -109,7 +109,7 @@ def _real_extract(self, url):
self._set_cookie('.reddit.com', 'reddit_session', self._gen_session_id()) self._set_cookie('.reddit.com', 'reddit_session', self._gen_session_id())
self._set_cookie('.reddit.com', '_options', '%7B%22pref_quarantine_optin%22%3A%20true%7D') self._set_cookie('.reddit.com', '_options', '%7B%22pref_quarantine_optin%22%3A%20true%7D')
data = self._download_json(f'https://{subdomain}.reddit.com/r/{slug}/.json', video_id, fatal=False) data = self._download_json(f'https://{subdomain}reddit.com/r/{slug}/.json', video_id, fatal=False)
if not data: if not data:
# Fall back to old.reddit.com in case the requested subdomain fails # Fall back to old.reddit.com in case the requested subdomain fails
data = self._download_json(f'https://old.reddit.com/r/{slug}/.json', video_id) data = self._download_json(f'https://old.reddit.com/r/{slug}/.json', video_id)