Explorar el Código

针对电影字幕下载,增加更加详细的 Debug 日志

Signed-off-by: allan716 <[email protected]>
allan716 hace 3 años
padre
commit
d76f9072c2

+ 5 - 1
internal/logic/movie_helper/moviehelper.go

@@ -40,13 +40,17 @@ func OneMovieDlSubInAllSite(Suppliers []ifaces.ISupplier, oneVideoFullPath strin
 			subInfosChannel <- subInfos
 		}()
 	}
-	for i := 0; i < len(Suppliers); i++ {
+	for index := 0; index < len(Suppliers); index++ {
 		v, ok := <-subInfosChannel
 		if ok == true && v != nil {
 			outSUbInfos = append(outSUbInfos, v...)
 		}
 	}
 
+	for index, info := range outSUbInfos {
+		log_helper.GetLogger().Debugln(common.QueueName, i, "OneMovieDlSubInAllSite get sub", index, "Name:", info.Name, "FileUrl:", info.FileUrl)
+	}
+
 	return outSUbInfos
 }
 

+ 5 - 0
internal/logic/sub_supplier/subSupplierHub.go

@@ -79,6 +79,11 @@ func (d SubSupplierHub) DownloadSub4Movie(videoFullPath string, index int, force
 		for s, _ := range organizeSubFiles {
 			outSubFileFullPathList = append(outSubFileFullPathList, organizeSubFiles[s]...)
 		}
+
+		for i, subFile := range outSubFileFullPathList {
+			d.log.Debugln("OneMovieDlSubInAllSite", videoFullPath, i, "SubFileFPath:", subFile)
+		}
+
 		return outSubFileFullPathList, nil
 	} else {
 		// 无需下载字幕

+ 5 - 0
internal/logic/sub_supplier/zimuku/zimuku.go

@@ -336,6 +336,10 @@ func (s Supplier) whichSubInfoNeedDownload(subInfos SubInfos, err error) []suppl
 		outSubInfoList = append(outSubInfoList, *oneSubInfo)
 	}
 
+	for i, info := range outSubInfoList {
+		s.log.Debugln(s.GetSupplierName(), "step3 -> Downloaded File Info", i, "FileName:", info.Name, "FileUrl:", info.FileUrl)
+	}
+
 	// 返回前,需要把每一个 Eps 的 Season Episode 信息填充到每个 SubInfo 中
 	return outSubInfoList
 }
@@ -531,6 +535,7 @@ func (s Supplier) step3(subDownloadPageUrl string) (string, []byte, error) {
 			s.log.Errorln("ZiMuKu step3 DownloadFile", err)
 			continue
 		}
+		s.log.Debugln("Step3,DownFile, FileName:", filename, "DataLen:", len(data))
 		return filename, data, nil
 	}
 	s.log.Debugln("Step3,sub download url not found", subDownloadPageUrl)

+ 1 - 0
internal/pkg/sub_helper/sub_helper.go

@@ -57,6 +57,7 @@ func OrganizeDlSubFiles(tmpFolderName string, subInfos []supplier.SubInfo) (map[
 		if nowExt != ".zip" && nowExt != ".tar" && nowExt != ".rar" && nowExt != ".7z" {
 			// 是否是受支持的字幕类型
 			if sub_parser_hub.IsSubExtWanted(nowExt) == false {
+				log_helper.GetLogger().Debugln("OrganizeDlSubFiles -> IsSubExtWanted == false", "Name:", subInfos[i].Name, "FileUrl:", subInfos[i].FileUrl)
 				continue
 			}
 			// 加入缓存列表