fix nil ptr?

This commit is contained in:
Niko Storni committed 2022-08-16 02:41:14 +02:00
1 parent ea3315d1d6
commit 9ef1b7800b
3 files changed
+8 -8

No files matched your search

+2 -1
View File
@@ -285,7 +285,8 @@ func runCmd(cmd *exec.Cmd, stopChan stop.Chan) ([]string, error) {
return nil, errors.Err("interrupted by user")
case err := <-done:
if err != nil {
return nil, errors.Prefix("yt-dlp "+strings.Join(cmd.Args, " ")+" ["+string(errorLog)+"]", err)
//return nil, errors.Prefix("yt-dlp "+strings.Join(cmd.Args, " ")+" ["+string(errorLog)+"]", err)
return nil, errors.Prefix(string(errorLog), err)
}
return strings.Split(strings.Replace(string(outLog), "\r\n", "\n", -1), "\n"), nil
}
+4 -7
View File
@@ -26,13 +26,10 @@ func TestGetVideoInformation(t *testing.T) {
s := stop.New()
ip, err := ip_manager.GetIPPool(s)
assert.NoError(t, err)
video, err := GetVideoInformation("zT_c6YhkXow", s.Ch(), ip)
if err != nil {
logrus.Error(err)
}
if video != nil {
logrus.Info(video.ID)
}
video, err := GetVideoInformation("kDGOHNpRjzc", s.Ch(), ip)
assert.NoError(t, err)
assert.NotNil(t, video)
logrus.Info(video.ID)
}
func Test_getUploadTime(t *testing.T) {
+2
View File
@@ -78,6 +78,7 @@ var ErrorsNoRetry = []string{
"giving up after 0 fragment retries",
"Sorry about that",
"This video is not available",
"Video unavailable",
"requested format not available",
"interrupted by user",
"Sign in to confirm your age",
@@ -117,6 +118,7 @@ var NeverRetryFailures = []string{
"Playback on other websites has been disabled by the video owner",
"uploader has not made this video available in your country",
"This video has been removed by the uploader",
"Video unavailable",
}
type SyncFlags struct {