1
0

xunlei_test.go 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package xunlei
  2. import (
  3. "github.com/allanpk716/ChineseSubFinder/internal/pkg/unit_test_helper"
  4. "github.com/allanpk716/ChineseSubFinder/internal/types"
  5. "path/filepath"
  6. "testing"
  7. )
  8. func TestGetList(t *testing.T) {
  9. //movie1 := "X:\\电影\\The Devil All the Time (2020)\\The Devil All the Time (2020) WEBDL-1080p.mkv"
  10. //movie1 := "X:\\电影\\龙猫 (1988)\\龙猫 (1988) 1080p DTS.mkv"
  11. //movie1 := "X:\\电影\\消失爱人 (2016)\\消失爱人 (2016) 720p AAC.rmvb"
  12. //movie1 := "X:\\电影\\Spiral From the Book of Saw (2021)\\Spiral From the Book of Saw (2021) WEBDL-1080p.mkv"
  13. //movie1 := "X:\\电影\\机动战士Z高达:星之继承者 (2005)\\机动战士Z高达:星之继承者 (2005) 1080p TrueHD.mkv"
  14. //movie1 := "X:\\连续剧\\The Bad Batch\\Season 1\\The Bad Batch - S01E01 - Aftermath WEBDL-1080p.mkv"
  15. //movie1 := "X:\\连续剧\\黄石 (2018)\\Season 4\\Yellowstone (2018) - S04E05 - Under a Blanket of Red WEBDL-2160p.mkv"
  16. //movie1 := "X:\\动漫\\碧蓝之海 (2018)\\Season 1\\碧蓝之海 - S01E01 - [UHA-WINGS][Grand Blue][01][BDRIP 1920x1080 x264 FLACx2].mkv"
  17. //movie1 := "X:\\连续剧\\瑞克和莫蒂 (2013)\\Season 5\\Rick and Morty - S05E01 - Mort Dinner Rick Andre WEBDL-1080p.mkv"
  18. //movie1 := "X:\\电影\\手机 (2003)\\手机 (2003) 720p Cooker.rmvb"
  19. rootDir := unit_test_helper.GetTestDataResourceRootPath([]string{"sub_spplier"}, 5, true)
  20. rootDir = filepath.Join(rootDir, "xunlei")
  21. gVideoFPath, err := unit_test_helper.GenerateXunleiVideoFile(rootDir)
  22. if err != nil {
  23. t.Fatal(err)
  24. }
  25. xunlie := NewSupplier(types.ReqParam{Topic: 3})
  26. outList, err := xunlie.getSubListFromFile(gVideoFPath)
  27. if err != nil {
  28. t.Error(err)
  29. }
  30. println(outList)
  31. for i, sublist := range outList {
  32. println(i, sublist.Name, sublist.Ext, sublist.Language.String(), sublist.Score, len(sublist.Data))
  33. }
  34. }