Add --ignore-errors for info download also

--ignore-errors still return error message and exit code != 0
so workaround is to assume things went ok if we get some json on stdout

Filter out failed entries for playlists
This commit is contained in:
Mattias Wadman
2019-09-22 23:03:20 +02:00
parent 8705585522
commit 47b4e26567
2 changed files with 41 additions and 4 deletions

View File

@ -181,6 +181,26 @@ func TestPlaylist(t *testing.T) {
}
}
func TestPlaylistWithPrivateVideo(t *testing.T) {
defer leaktest.Check(t)()
playlistRawURL := "https://www.youtube.com/playlist?list=PLX0g748fkegS54oiDN4AXKl7BR7mLIydP"
ydlResult, ydlResultErr := New(context.Background(), playlistRawURL, Options{
YesPlaylist: true,
DownloadThumbnail: false,
})
if ydlResultErr != nil {
t.Errorf("failed to download: %s", ydlResultErr)
}
expectedLen := 2
actualLen := len(ydlResult.Info.Entries)
if expectedLen != actualLen {
t.Errorf("expected len %d got %d", expectedLen, actualLen)
}
}
func TestPlaylistBadURL(t *testing.T) {
defer leakChecks(t)()