projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3f43275
)
[nrk] Use generic subtitles timecode formatter
author
Sergey M․
<dstftw@gmail.com>
Fri, 13 Mar 2015 15:40:34 +0000
(21:40 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Fri, 13 Mar 2015 15:40:34 +0000
(21:40 +0600)
youtube_dl/extractor/nrk.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/nrk.py
b/youtube_dl/extractor/nrk.py
index 1e4cfa2e7c8c5e3ae05c7d5fbc11242a334a5322..bff36f9d3f24cad293144d8e216faf5eeefed92c 100644
(file)
--- a/
youtube_dl/extractor/nrk.py
+++ b/
youtube_dl/extractor/nrk.py
@@
-149,9
+149,6
@@
class NRKTVIE(InfoExtractor):
}
]
}
]
- def _seconds2str(self, s):
- return '%02d:%02d:%02d.%03d' % (s / 3600, (s % 3600) / 60, s % 60, (s % 1) * 1000)
-
def _debug_print(self, txt):
if self._downloader.params.get('verbose', False):
self.to_screen('[debug] %s' % txt)
def _debug_print(self, txt):
if self._downloader.params.get('verbose', False):
self.to_screen('[debug] %s' % txt)
@@
-168,8
+165,8
@@
class NRKTVIE(InfoExtractor):
for pos, p in enumerate(ps):
begin = parse_duration(p.get('begin'))
duration = parse_duration(p.get('dur'))
for pos, p in enumerate(ps):
begin = parse_duration(p.get('begin'))
duration = parse_duration(p.get('dur'))
- starttime = self._s
econds2str
(begin)
- endtime = self._s
econds2str
(begin + duration)
+ starttime = self._s
ubtitles_timecode
(begin)
+ endtime = self._s
ubtitles_timecode
(begin + duration)
srt += '%s\r\n%s --> %s\r\n%s\r\n\r\n' % (compat_str(pos), starttime, endtime, p.text)
return {lang: [
{'ext': 'ttml', 'url': url},
srt += '%s\r\n%s --> %s\r\n%s\r\n\r\n' % (compat_str(pos), starttime, endtime, p.text)
return {lang: [
{'ext': 'ttml', 'url': url},