Pārlūkot izejas kodu

修复 srt 字幕解析时间的 bug

Signed-off-by: allan716 <[email protected]>
allan716 3 gadi atpakaļ
vecāks
revīzija
c96bae81db
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  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
 				}