aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dlc/utils.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2021-01-06 22:37:55 +0530
committerpukkandan <pukkandan@gmail.com>2021-01-06 22:37:55 +0530
commitdbbbe555d7a64ff65de5f8a78cc276a848c2e227 (patch)
tree594b56b4f5353efcba661552c2af274919161b60 /youtube_dlc/utils.py
parent7fd86ce1a9e4e9a1eedc715df66346ec810ca7d5 (diff)
downloadhypervideo-pre-dbbbe555d7a64ff65de5f8a78cc276a848c2e227.tar.lz
hypervideo-pre-dbbbe555d7a64ff65de5f8a78cc276a848c2e227.tar.xz
hypervideo-pre-dbbbe555d7a64ff65de5f8a78cc276a848c2e227.zip
Add `duration_string` to info_dict
Diffstat (limited to 'youtube_dlc/utils.py')
-rw-r--r--youtube_dlc/utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/youtube_dlc/utils.py b/youtube_dlc/utils.py
index 6ed8629a7..21e3481a0 100644
--- a/youtube_dlc/utils.py
+++ b/youtube_dlc/utils.py
@@ -2285,11 +2285,11 @@ def decodeOption(optval):
return optval
-def formatSeconds(secs):
+def formatSeconds(secs, delim=':'):
if secs > 3600:
- return '%d:%02d:%02d' % (secs // 3600, (secs % 3600) // 60, secs % 60)
+ return '%d%s%02d%s%02d' % (secs // 3600, delim, (secs % 3600) // 60, delim, secs % 60)
elif secs > 60:
- return '%d:%02d' % (secs // 60, secs % 60)
+ return '%d%s%02d' % (secs // 60, delim, secs % 60)
else:
return '%d' % secs