ytsync/downloader/downloader_test.go

38 lines
733 B
Go
Raw Permalink Normal View History

package downloader
import (
"testing"
2020-08-06 02:12:05 +02:00
"github.com/lbryio/ytsync/v5/sdk"
"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) {
video, err := GetVideoInformation("zj7pXM9gE5M", nil, nil)
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)
}