From 1f8804154e47e3b2261288c53a6dc9688d50c41f Mon Sep 17 00:00:00 2001 From: ze0s Date: Wed, 14 Jun 2023 21:58:56 +0200 Subject: [PATCH] fix(releases): download file follow redirects (#950) --- internal/domain/release.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/domain/release.go b/internal/domain/release.go index 102aeb7..f5342cd 100644 --- a/internal/domain/release.go +++ b/internal/domain/release.go @@ -366,7 +366,7 @@ func (r *Release) DownloadTorrentFile() error { func (r *Release) downloadTorrentFile(ctx context.Context) error { if r.HasMagnetUri() { - return errors.New("downloading magnet links are not supported: %s", r.MagnetURI) + return errors.New("downloading magnet links is not supported: %s", r.MagnetURI) } else if r.Protocol != ReleaseProtocolTorrent { return errors.New("could not download file: protocol %s is not supported", r.Protocol) } @@ -423,9 +423,9 @@ func (r *Release) downloadTorrentFile(ctx context.Context) error { switch resp.StatusCode { case http.StatusOK: // Continue processing the response - case http.StatusMovedPermanently, http.StatusFound, http.StatusSeeOther, http.StatusTemporaryRedirect, http.StatusPermanentRedirect: - // Handle redirect - return retry.Unrecoverable(errors.New("redirect encountered for torrent (%v) file (%v) - status code: %d - check indexer keys for %s", r.TorrentName, r.TorrentURL, resp.StatusCode, r.Indexer)) + //case http.StatusMovedPermanently, http.StatusFound, http.StatusSeeOther, http.StatusTemporaryRedirect, http.StatusPermanentRedirect: + // // Handle redirect + // return retry.Unrecoverable(errors.New("redirect encountered for torrent (%v) file (%v) - status code: %d - check indexer keys for %s", r.TorrentName, r.TorrentURL, resp.StatusCode, r.Indexer)) case http.StatusUnauthorized, http.StatusForbidden: return retry.Unrecoverable(errors.New("unrecoverable error downloading torrent (%v) file (%v) - status code: %d - check indexer keys for %s", r.TorrentName, r.TorrentURL, resp.StatusCode, r.Indexer))