aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbashonly <88596187+bashonly@users.noreply.github.com>2024-11-18 05:36:38 +0000
committerGitHub <noreply@github.com>2024-11-18 05:36:38 +0000
commit7ea2787920cccc6b8ea30791993d114fbd564434 (patch)
tree70b50916f3d0a2713b8e5b93fa3ed39920e2755d
parentf7257588bdff5f0b0452635a66b253a783c97357 (diff)
[ie/reddit] Improve error handling (#11573)
Authored by: bashonly
-rw-r--r--yt_dlp/extractor/reddit.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/yt_dlp/extractor/reddit.py b/yt_dlp/extractor/reddit.py
index b633dc48a..7325e547b 100644
--- a/yt_dlp/extractor/reddit.py
+++ b/yt_dlp/extractor/reddit.py
@@ -259,6 +259,8 @@ class RedditIE(InfoExtractor):
f'https://www.reddit.com/{slug}/.json', video_id, expected_status=403)
except ExtractorError as e:
if isinstance(e.cause, json.JSONDecodeError):
+ if self._get_cookies('https://www.reddit.com/').get('reddit_session'):
+ raise ExtractorError('Your IP address is unable to access the Reddit API', expected=True)
self.raise_login_required('Account authentication is required')
raise