subtitle_best_api_test.go 735 B

12345678910111213141516171819202122232425262728
  1. package subtitle_best_api
  2. import (
  3. "testing"
  4. "github.com/allanpk716/ChineseSubFinder/internal/pkg/global_value"
  5. "github.com/allanpk716/ChineseSubFinder/internal/pkg/log_helper"
  6. "github.com/allanpk716/ChineseSubFinder/internal/pkg/my_util"
  7. "github.com/allanpk716/ChineseSubFinder/internal/pkg/random_auth_key"
  8. )
  9. func TestSubtitleBestApi_GetMediaInfo(t *testing.T) {
  10. my_util.ReadCustomAuthFile(log_helper.GetLogger4Tester())
  11. bapi := NewSubtitleBestApi(random_auth_key.AuthKey{
  12. BaseKey: global_value.BaseKey(),
  13. AESKey16: global_value.AESKey16(),
  14. AESIv16: global_value.AESIv16(),
  15. })
  16. mediaInfo, err := bapi.GetMediaInfo("tt7278862", "imdb", "series")
  17. if err != nil {
  18. t.Fatal(err)
  19. }
  20. println(mediaInfo.TitleCN)
  21. }