aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/utils.py
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-11-30 17:19:55 -0500
committerJesús <heckyel@hyperbola.info>2021-11-30 17:19:55 -0500
commitccf02e63e53e481824b56b4e05ab1c2a9558c9a7 (patch)
tree41ad503be3ca01b0d83d0585f577bcf871b3f159 /yt_dlp/utils.py
parent54288332f1d8ec2974c65281e6a712e56b5cd24f (diff)
parent1bad50eced921126ea6587d9ae99e98164da500b (diff)
downloadhypervideo-pre-ccf02e63e53e481824b56b4e05ab1c2a9558c9a7.tar.lz
hypervideo-pre-ccf02e63e53e481824b56b4e05ab1c2a9558c9a7.tar.xz
hypervideo-pre-ccf02e63e53e481824b56b4e05ab1c2a9558c9a7.zip
updated from upstream | 30/11/2021 at 17:19
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r--yt_dlp/utils.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py
index 36597d41a..5537d63be 100644
--- a/yt_dlp/utils.py
+++ b/yt_dlp/utils.py
@@ -2575,10 +2575,6 @@ class PostProcessingError(YoutubeDLError):
indicate an error in the postprocessing task.
"""
- def __init__(self, msg):
- super(PostProcessingError, self).__init__(msg)
- self.msg = msg
-
class DownloadCancelled(YoutubeDLError):
""" Exception raised when the download queue should be interrupted """
@@ -2600,10 +2596,21 @@ class MaxDownloadsReached(DownloadCancelled):
msg = 'Maximum number of downloads reached, stopping due to --max-downloads'
-class ThrottledDownload(YoutubeDLError):
+class ReExtractInfo(YoutubeDLError):
+ """ Video info needs to be re-extracted. """
+
+ def __init__(self, msg, expected=False):
+ super().__init__(msg)
+ self.expected = expected
+
+
+class ThrottledDownload(ReExtractInfo):
""" Download speed below --throttled-rate. """
msg = 'The download speed is below throttle limit'
+ def __init__(self, msg):
+ super().__init__(msg, expected=False)
+
class UnavailableVideoError(YoutubeDLError):
"""Unavailable Format exception.
@@ -6545,10 +6552,11 @@ def traverse_obj(
return default
+# Deprecated
def traverse_dict(dictn, keys, casesense=True):
- ''' For backward compatibility. Do not use '''
- return traverse_obj(dictn, keys, casesense=casesense,
- is_user_input=True, traverse_string=True)
+ write_string('DeprecationWarning: yt_dlp.utils.traverse_dict is deprecated '
+ 'and may be removed in a future version. Use yt_dlp.utils.traverse_obj instead')
+ return traverse_obj(dictn, keys, casesense=casesense, is_user_input=True, traverse_string=True)
def variadic(x, allowed_types=(str, bytes)):