diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-03-04 19:40:10 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-03-04 19:49:36 +0530 |
commit | 4c3f8c3fb68637d80acc58f908b1511f9160bdbc (patch) | |
tree | cb1dab657a777d3c110d8b25c3f5e097ca021572 /yt_dlp/utils.py | |
parent | 7265a2190c46b7312669d613898055c2b080d26e (diff) | |
download | hypervideo-pre-4c3f8c3fb68637d80acc58f908b1511f9160bdbc.tar.lz hypervideo-pre-4c3f8c3fb68637d80acc58f908b1511f9160bdbc.tar.xz hypervideo-pre-4c3f8c3fb68637d80acc58f908b1511f9160bdbc.zip |
Handle negative duration from extractor
Closes #2921
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r-- | yt_dlp/utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index 4134acfdc..ef2c6bb24 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -2257,7 +2257,7 @@ def unsmuggle_url(smug_url, default=None): def format_decimal_suffix(num, fmt='%d%s', *, factor=1000): """ Formats numbers with decimal sufixes like K, M, etc """ num, factor = float_or_none(num), float(factor) - if num is None: + if num is None or num < 0: return None exponent = 0 if num == 0 else int(math.log(num, factor)) suffix = ['', *'kMGTPEZY'][exponent] |