aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-03-13 21:38:28 +0600
committerSergey M․ <dstftw@gmail.com>2015-03-13 21:38:28 +0600
commit4a34f69ea6213ffcf5785b30a126b439ceef77e1 (patch)
treef52982f016d5a64b01005eaf808831d13cbb3761 /youtube_dl
parentfb7e68833cc67c23428462bf6c1306cbce207369 (diff)
downloadyoutube-dl-4a34f69ea6213ffcf5785b30a126b439ceef77e1.tar.xz
[extractor/common] Add subtitles timecode formatter
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/common.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index f9e8e2bad..e5245ec3f 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -1062,6 +1062,9 @@ class InfoExtractor(object):
def _get_automatic_captions(self, *args, **kwargs):
raise NotImplementedError("This method must be implemented by subclasses")
+ def _subtitles_timecode(self, seconds):
+ return '%02d:%02d:%02d.%03d' % (seconds / 3600, (seconds % 3600) / 60, seconds % 60, (seconds % 1) * 1000)
+
class SearchInfoExtractor(InfoExtractor):
"""