aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/extractor/youtube/_video.py
diff options
context:
space:
mode:
authorcoletdjnz <coletdjnz@protonmail.com>2025-04-25 16:11:07 +1200
committerGitHub <noreply@github.com>2025-04-25 16:11:07 +1200
commit26feac3dd142536ad08ad1ed731378cb88e63602 (patch)
tree84df3556ab4f7c115d3b737c2a1b191b5b421fa0 /yt_dlp/extractor/youtube/_video.py
parent70599e53b736bb75922b737e6e0d4f76e419bb20 (diff)
[ie/youtube] Add context to video request rate limit error (#12958)HEADmaster
Related: https://github.com/yt-dlp/yt-dlp/issues/11426 Authored by: coletdjnz
Diffstat (limited to 'yt_dlp/extractor/youtube/_video.py')
-rw-r--r--yt_dlp/extractor/youtube/_video.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/yt_dlp/extractor/youtube/_video.py b/yt_dlp/extractor/youtube/_video.py
index bcfe8b152..5bcc05f7e 100644
--- a/yt_dlp/extractor/youtube/_video.py
+++ b/yt_dlp/extractor/youtube/_video.py
@@ -3648,6 +3648,13 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
reason = f'{remove_end(reason.strip(), ".")}. {self._youtube_login_hint}'
elif get_first(playability_statuses, ('errorScreen', 'playerCaptchaViewModel', {dict})):
reason += '. YouTube is requiring a captcha challenge before playback'
+ elif "This content isn't available, try again later" in reason:
+ reason = (
+ f'{remove_end(reason.strip(), ".")}. {"Your account" if self.is_authenticated else "The current session"} '
+ f'has been rate-limited by YouTube for up to an hour. It is recommended to use `-t sleep` to add a delay '
+ f'between video requests to avoid exceeding the rate limit. For more information, refer to '
+ f'https://github.com/yt-dlp/yt-dlp/wiki/Extractors#this-content-isnt-available-try-again-later'
+ )
self.raise_no_formats(reason, expected=True)
keywords = get_first(video_details, 'keywords', expected_type=list) or []