From ec8c511fe0aa330af9cfd925ed6b8070954a0e4d Mon Sep 17 00:00:00 2001 From: lifegpc Date: Fri, 22 Dec 2023 11:07:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=A3=80=E6=B5=8B=E5=8E=9F?= =?UTF-8?q?=E6=96=87=E4=B8=8E=E8=AF=91=E6=96=87=E6=97=B6=E9=97=B4=E7=9B=B8?= =?UTF-8?q?=E5=90=8C=E7=9A=84=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- convert_lrc.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/convert_lrc.py b/convert_lrc.py index ff15431..0acf676 100644 --- a/convert_lrc.py +++ b/convert_lrc.py @@ -76,6 +76,13 @@ class Lyric: re.append({'time': max(ltmp, round(i['time'] - 0.01, 2)), 'data': tmp}) 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'] if s.find(' / ') > 0: li = s.split(' / ', 1) @@ -83,6 +90,7 @@ class Lyric: tmp = li[1] re.append({'time': i['time'], 'data': li[0]}) else: + ltmp = i['time'] re.append(i.copy()) if tmp is not None: if dur is not None: