aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/utils.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-11-30 11:34:51 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-12-03 19:52:31 +0530
commit71df9b7fd504767583cf1e088ae307c942799f2b (patch)
tree42112aba8946aee047ee9a8e411a00131882f0c8 /yt_dlp/utils.py
parentc9f5ce511877ae4f22d2eb2f70c3c6edf6c1971d (diff)
downloadhypervideo-pre-71df9b7fd504767583cf1e088ae307c942799f2b.tar.lz
hypervideo-pre-71df9b7fd504767583cf1e088ae307c942799f2b.tar.xz
hypervideo-pre-71df9b7fd504767583cf1e088ae307c942799f2b.zip
[cleanup] Misc
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r--yt_dlp/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py
index ed1b24335..a3da3c69e 100644
--- a/yt_dlp/utils.py
+++ b/yt_dlp/utils.py
@@ -3872,6 +3872,9 @@ class download_range_func:
return (isinstance(other, download_range_func)
and self.chapters == other.chapters and self.ranges == other.ranges)
+ def __repr__(self):
+ return f'{type(self).__name__}({self.chapters}, {self.ranges})'
+
def parse_dfxp_time_expr(time_expr):
if not time_expr:
@@ -5976,7 +5979,7 @@ def truncate_string(s, left, right=0):
assert left > 3 and right >= 0
if s is None or len(s) <= left + right:
return s
- return f'{s[:left-3]}...{s[-right:]}'
+ return f'{s[:left-3]}...{s[-right:] if right else ""}'
def orderedSet_from_options(options, alias_dict, *, use_regex=False, start=None):