mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-12-27 18:11:19 +00:00
Communicate needed wait time through an exception.
Instead of waiting before throwing `ReExtractInfo`, `_wait_until` will now immediately throw a new exception `ReExtractInfoLater`. The `_handle_extraction_exceptions` decorator will then either bail out if the maximum retry count is exceeded, or wait until the specified waiting period expires.
This commit is contained in:
@@ -1110,6 +1110,15 @@ class ReExtractInfo(YoutubeDLError):
|
||||
self.expected = expected
|
||||
|
||||
|
||||
class ReExtractInfoLater(ReExtractInfo):
|
||||
""" Video info needs to be re-extracted after a waiting period. """
|
||||
msg = 'Video is not available yet'
|
||||
|
||||
def __init__(self, time):
|
||||
super().__init__(self.msg, expected=True)
|
||||
self.time = time
|
||||
|
||||
|
||||
class ThrottledDownload(ReExtractInfo):
|
||||
""" Download speed below --throttled-rate. """
|
||||
msg = 'The download speed is below throttle limit'
|
||||
|
||||
Reference in New Issue
Block a user