Skip to content

Commit

Permalink
Log a message when a '429 Too Many Requests' error is detected, in ca…
Browse files Browse the repository at this point in the history
…se of another error log the output from youtube-dl. (#121)

Co-authored-by: Dmitry Panov <[email protected]>
  • Loading branch information
dop251 and dop251 authored Apr 16, 2020
1 parent e3aed44 commit 174557e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/podsync/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ func (u *Updater) downloadEpisodes(ctx context.Context, feedConfig *config.Feed)
// We still need to generate XML, so just stop sending download requests and
// retry next time
if err == ytdl.ErrTooManyRequests {
logger.Warn("server responded with a 'Too Many Requests' error")
break
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/ytdl/ytdl.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ func (dl YoutubeDl) Download(ctx context.Context, feedConfig *config.Feed, episo
return nil, ErrTooManyRequests
}

log.Error(output)

return nil, errors.New(output)
}

Expand Down

0 comments on commit 174557e

Please sign in to comment.