From f97b09d082a8fb486aebe71968472b06be080b61 Mon Sep 17 00:00:00 2001 From: Galiley Date: Wed, 16 Aug 2023 17:19:03 +0200 Subject: [PATCH] fix typo --- goutubedl.go | 6 ++++-- goutubedl_test.go | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/goutubedl.go b/goutubedl.go index 7475010..6a14b65 100644 --- a/goutubedl.go +++ b/goutubedl.go @@ -431,7 +431,9 @@ type DownloadResult struct { waitCh chan struct{} } -// Download is a shortcut of DownloadOptions where the options use the default value +// Download format matched by filter (usually a format id or quality designator). +// If filter is empty, then youtube-dl will use its default format selector. +// It's a shortcut of DownloadWithOptions where the options use the default value func (result Result) Download(ctx context.Context, filter string) (*DownloadResult, error) { return result.DownloadWithOptions(ctx, DownloadOptions{ Filter: filter, @@ -443,7 +445,7 @@ type DownloadOptions struct { // If filter is empty, then youtube-dl will use its default format selector. Filter string // The index of the entry to download from the playlist that would be - // passed to youtube-dl wia --playlist-items. The index value starts at 1 + // passed to youtube-dl via --playlist-items. The index value starts at 1 PlaylistIndex int } diff --git a/goutubedl_test.go b/goutubedl_test.go index 27a74ca..54adab9 100644 --- a/goutubedl_test.go +++ b/goutubedl_test.go @@ -343,7 +343,7 @@ func TestDownloadPlaylistEntry(t *testing.T) { } dr, err := r.DownloadWithOptions(context.Background(), goutubedl.DownloadOptions{ - PlaylistIndex: playlistIndex + 1, + PlaylistIndex: int(r.Info.Entries[playlistIndex].PlaylistIndex), Filter: r.Info.Entries[playlistIndex].Formats[0].FormatID, }) if err != nil {