mirror of
https://github.com/lifegpc/pythonscript.git
synced 2026-06-15 12:54:23 +08:00
支持检测原文与译文时间相同的格式
This commit is contained in:
@@ -76,6 +76,13 @@ class Lyric:
|
|||||||
re.append({'time': max(ltmp, round(i['time'] - 0.01, 2)),
|
re.append({'time': max(ltmp, round(i['time'] - 0.01, 2)),
|
||||||
'data': tmp})
|
'data': tmp})
|
||||||
tmp = None
|
tmp = None
|
||||||
|
elif i['time'] == ltmp:
|
||||||
|
if tmp is None:
|
||||||
|
tmp = i['data']
|
||||||
|
else:
|
||||||
|
re.append({'time': ltmp, 'data': tmp})
|
||||||
|
tmp = i['data']
|
||||||
|
continue
|
||||||
s: str = i['data']
|
s: str = i['data']
|
||||||
if s.find(' / ') > 0:
|
if s.find(' / ') > 0:
|
||||||
li = s.split(' / ', 1)
|
li = s.split(' / ', 1)
|
||||||
@@ -83,6 +90,7 @@ class Lyric:
|
|||||||
tmp = li[1]
|
tmp = li[1]
|
||||||
re.append({'time': i['time'], 'data': li[0]})
|
re.append({'time': i['time'], 'data': li[0]})
|
||||||
else:
|
else:
|
||||||
|
ltmp = i['time']
|
||||||
re.append(i.copy())
|
re.append(i.copy())
|
||||||
if tmp is not None:
|
if tmp is not None:
|
||||||
if dur is not None:
|
if dur is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user