瀏覽代碼

修复 srt 字幕解析时间的 bug

Signed-off-by: allan716 <[email protected]>
allan716 3 年之前
父節點
當前提交
c96bae81db
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      pkg/logic/sub_parser/srt/srt.go

+ 2 - 2
pkg/logic/sub_parser/srt/srt.go

@@ -181,9 +181,9 @@ func (p Parser) parseContent(inBytes []byte) []subparser.OneDialogue {
 		if steps == 1 {
 			// 匹配时间
 			matched := regex_things.ReMatchDialogueTimeSRT.FindAllStringSubmatch(line, -1)
-			if matched == nil || len(matched) < 1 {
+			if matched == nil || len(matched) < 1 || matched[0][0] != line {
 				matched = regex_things.ReMatchDialogueTimeSRT2.FindAllStringSubmatch(line, -1)
-				if matched == nil || len(matched) < 1 {
+				if matched == nil || len(matched) < 1 || matched[0][0] != line {
 					newOneDialogueFun()
 					continue
 				}