ytsync/downloader/downloader_test.go

44 lines
899 B
Go
Raw Normal View History

package downloader
import (
"testing"
2022-08-11 18:01:55 +02:00
"github.com/lbryio/ytsync/v5/ip_manager"
2020-08-06 02:12:05 +02:00
"github.com/lbryio/ytsync/v5/sdk"
2022-08-11 18:01:55 +02:00
"github.com/lbryio/lbry.go/v2/extras/stop"
"github.com/sirupsen/logrus"
2020-08-06 02:12:05 +02:00
"github.com/stretchr/testify/assert"
)
2020-07-27 23:14:06 +02:00
func TestGetPlaylistVideoIDs(t *testing.T) {
2020-08-06 02:12:05 +02:00
videoIDs, err := GetPlaylistVideoIDs("UCJ0-OtVpF0wOKEqT2Z1HEtA", 50, nil, nil)
if err != nil {
logrus.Error(err)
}
for _, id := range videoIDs {
println(id)
}
}
2020-07-27 23:14:06 +02:00
func TestGetVideoInformation(t *testing.T) {
2022-08-11 18:01:55 +02:00
s := stop.New()
ip, err := ip_manager.GetIPPool(s)
assert.NoError(t, err)
video, err := GetVideoInformation("zT_c6YhkXow", s.Ch(), ip)
2020-07-27 23:14:06 +02:00
if err != nil {
logrus.Error(err)
}
if video != nil {
logrus.Info(video.ID)
}
}
2020-08-06 02:12:05 +02:00
func Test_getUploadTime(t *testing.T) {
configs := sdk.APIConfig{}
2020-08-06 02:12:05 +02:00
got, err := getUploadTime(&configs, "kDGOHNpRjzc", nil, "20060102")
assert.NoError(t, err)
t.Log(got)
}