1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-05 10:42:37 +01:00

[extractor/common] Add subtitles timecode formatter

This commit is contained in:
Sergey M․ 2015-03-13 21:38:28 +06:00
parent fb7e68833c
commit 4a34f69ea6

View File

@ -1062,6 +1062,9 @@ def extract_automatic_captions(self, *args, **kwargs):
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):
"""