ytsync/downloader/downloader_test.go

41 lines
885 B
Go
Raw Permalink 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)
2022-08-16 02:41:14 +02:00
video, err := GetVideoInformation("kDGOHNpRjzc", s.Ch(), ip)
assert.NoError(t, err)
assert.NotNil(t, video)
logrus.Info(video.ID)
2020-07-27 23:14:06 +02:00
}
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)
}