From 3a40234c45565f88e0cc36076afadb873377df70 Mon Sep 17 00:00:00 2001 From: coletdjnz Date: Mon, 21 Apr 2025 11:34:06 +1200 Subject: [PATCH] [ie/youtube] Add context to rate limit error --- yt_dlp/extractor/youtube/_video.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/yt_dlp/extractor/youtube/_video.py b/yt_dlp/extractor/youtube/_video.py index bcfe8b1520..2b0c11e054 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"} has been rate-limited by YouTube for up to an hour.' + 'It is recommended to use `-t sleep` to add a delay between downloads to avoid hitting the rate limit. ' + 'For more information, refer to 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 []