and those without space
This commit is contained in:
parent
6f7f07e690
commit
33518260ee
1 changed files with 3 additions and 3 deletions
|
@ -31,8 +31,8 @@ def srt2dict(srt, encoding = "utf-8"):
|
|||
subtitle = subtitle.strip().split('\n')
|
||||
if len(subtitle) > 2:
|
||||
start_stop = subtitle[1].split('-->')
|
||||
start_stop[0] = start_stop[0].split(' ')[0]
|
||||
start_stop[1] = start_stop[1].split(' ')[0]
|
||||
start_stop[0] = start_stop[0].strip().split(' ')[0]
|
||||
start_stop[1] = start_stop[1].strip().split(' ')[0]
|
||||
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])
|
||||
|
|
Loading…
Reference in a new issue