Sfoglia il codice sorgente

添加日志

Signed-off-by: 716 <[email protected]>
716 4 anni fa
parent
commit
98f696fbf1
4 ha cambiato i file con 7 aggiunte e 2 eliminazioni
  1. 2 1
      downloader_test.go
  2. 1 1
      go.mod
  3. 2 0
      sub_supplier/subhd/subhd.go
  4. 2 0
      sub_supplier/zimuku/zimuku.go

+ 2 - 1
downloader_test.go

@@ -9,7 +9,8 @@ func TestDownloader_DownloadSub(t *testing.T) {
 	var err error
 	var err error
 	//dirRoot := "X:\\电影\\Spiral From the Book of Saw (2021)"
 	//dirRoot := "X:\\电影\\Spiral From the Book of Saw (2021)"
 	//dirRoot := "X:\\电影\\Oslo (2021)"
 	//dirRoot := "X:\\电影\\Oslo (2021)"
-	dirRoot := "X:\\电影\\The Devil All the Time (2020)"
+	//dirRoot := "X:\\电影\\The Devil All the Time (2020)"
+	dirRoot := "X:\\电影\\21座桥 (2019)"
 	//dirRoot := "X:\\电影\\冰海陷落 (2018)"
 	//dirRoot := "X:\\电影\\冰海陷落 (2018)"
 
 
 	dl := NewDownloader(common.ReqParam{
 	dl := NewDownloader(common.ReqParam{

+ 1 - 1
go.mod

@@ -5,7 +5,7 @@ go 1.15
 require (
 require (
 	github.com/PuerkitoBio/goquery v1.6.1
 	github.com/PuerkitoBio/goquery v1.6.1
 	github.com/StalkR/imdb v1.0.7
 	github.com/StalkR/imdb v1.0.7
-	github.com/Tnze/go.num/v2 v2.0.0-20191006170829-cb483d4c9152 // indirect
+	github.com/Tnze/go.num/v2 v2.0.0-20191006170829-cb483d4c9152
 	github.com/abadojack/whatlanggo v1.0.1
 	github.com/abadojack/whatlanggo v1.0.1
 	github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394
 	github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394
 	github.com/beevik/etree v1.1.0
 	github.com/beevik/etree v1.1.0

+ 2 - 0
sub_supplier/subhd/subhd.go

@@ -87,6 +87,7 @@ func (s Supplier) GetSubListFromFile(filePath string) ([]common.SupplierSubInfo,
 		subInfoList, err = s.GetSubListFromKeyword(imdbInfo.ImdbId)
 		subInfoList, err = s.GetSubListFromKeyword(imdbInfo.ImdbId)
 		if err != nil {
 		if err != nil {
 			// 允许的错误,跳过,继续进行文件名的搜索
 			// 允许的错误,跳过,继续进行文件名的搜索
+			s.log.Errorln(s.GetSupplierName(), "keyword:", imdbInfo.ImdbId)
 			s.log.Errorln("GetSubListFromKeyword", "IMDBID can not found sub", filePath, err)
 			s.log.Errorln("GetSubListFromKeyword", "IMDBID can not found sub", filePath, err)
 		}
 		}
 		// 如果有就优先返回
 		// 如果有就优先返回
@@ -98,6 +99,7 @@ func (s Supplier) GetSubListFromFile(filePath string) ([]common.SupplierSubInfo,
 	searchKeyword := model.VideoNameSearchKeywordMaker(info.Title, imdbInfo.Year)
 	searchKeyword := model.VideoNameSearchKeywordMaker(info.Title, imdbInfo.Year)
 	subInfoList, err = s.GetSubListFromKeyword(searchKeyword)
 	subInfoList, err = s.GetSubListFromKeyword(searchKeyword)
 	if err != nil {
 	if err != nil {
+		s.log.Errorln(s.GetSupplierName(), "keyword:", searchKeyword)
 		return nil, err
 		return nil, err
 	}
 	}
 
 

+ 2 - 0
sub_supplier/zimuku/zimuku.go

@@ -163,6 +163,7 @@ func (s Supplier) GetSubListFromFile(filePath string) ([]common.SupplierSubInfo,
 		subInfoList, err = s.GetSubListFromKeyword(imdbInfo.ImdbId)
 		subInfoList, err = s.GetSubListFromKeyword(imdbInfo.ImdbId)
 		if err != nil {
 		if err != nil {
 			// 允许的错误,跳过,继续进行文件名的搜索
 			// 允许的错误,跳过,继续进行文件名的搜索
+			s.log.Errorln(s.GetSupplierName(), "keyword:", imdbInfo.ImdbId)
 			s.log.Errorln("GetSubListFromKeyword", "IMDBID can not found sub", filePath, err)
 			s.log.Errorln("GetSubListFromKeyword", "IMDBID can not found sub", filePath, err)
 		}
 		}
 		// 如果有就优先返回
 		// 如果有就优先返回
@@ -175,6 +176,7 @@ func (s Supplier) GetSubListFromFile(filePath string) ([]common.SupplierSubInfo,
 	searchKeyword := model.VideoNameSearchKeywordMaker(info.Title, imdbInfo.Year)
 	searchKeyword := model.VideoNameSearchKeywordMaker(info.Title, imdbInfo.Year)
 	subInfoList, err = s.GetSubListFromKeyword(searchKeyword)
 	subInfoList, err = s.GetSubListFromKeyword(searchKeyword)
 	if err != nil {
 	if err != nil {
+		s.log.Errorln(s.GetSupplierName(), "keyword:", searchKeyword)
 		return nil, err
 		return nil, err
 	}
 	}