diff --git a/oxdbarchive/subtitles.py b/oxdbarchive/subtitles.py index 9a156ed..da08032 100644 --- a/oxdbarchive/subtitles.py +++ b/oxdbarchive/subtitles.py @@ -33,9 +33,8 @@ def srt2dict(srt, encoding = "utf-8"): start_stop = subtitle[1].split(' --> ') start_stop[0] = start_stop[0].split(' ')[0] start_stop[1] = start_stop[1].split(' ')[0] - if start_stop[0][-4] == '.': - start_stop[0][:-4] + ',' + start_stop[0][-3:] - start_stop[1][:-4] + ',' + start_stop[1][-3:] + start_stop[0] = re.sub('(\d{2}).(\d{2}).(\d{2}).(\d{3})', '\\1:\\2:\\3,\\4', start_stop[0]) + start_stop[1] = re.sub('(\d{2}).(\d{2}).(\d{2}).(\d{3})', '\\1:\\2:\\3,\\4', start_stop[1]) subtitle[0] ="%s" % int(subtitle[0]) subdict[subtitle[0]] = { 'start': start_stop[0], @@ -178,4 +177,4 @@ def loadSrt(fname): if udata.startswith(u'\ufeff'): udata = udata[1:] return udata - \ No newline at end of file +