aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-12-19 19:29:51 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-12-19 19:29:51 +0800
commitdb2fe38b5508cbd28b89893219d9cccd41406851 (patch)
tree3c7d03cafd8f578c3c7c380321c88f2f5142b0d1 /youtube_dl/utils.py
parentd631d5f9f27f93767226192e4288990413fa9dbd (diff)
downloadyoutube-dl-db2fe38b5508cbd28b89893219d9cccd41406851.tar.xz
[utils] Support alternative timestamp format in TTML
Fixes #7608
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index ee20c3d9b..5b396ede8 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1982,9 +1982,9 @@ def parse_dfxp_time_expr(time_expr):
if mobj:
return float(mobj.group('time_offset'))
- mobj = re.match(r'^(\d+):(\d\d):(\d\d(?:\.\d+)?)$', time_expr)
+ mobj = re.match(r'^(\d+):(\d\d):(\d\d(?:(?:\.|:)\d+)?)$', time_expr)
if mobj:
- return 3600 * int(mobj.group(1)) + 60 * int(mobj.group(2)) + float(mobj.group(3))
+ return 3600 * int(mobj.group(1)) + 60 * int(mobj.group(2)) + float(mobj.group(3).replace(':', '.'))
def srt_subtitles_timecode(seconds):