podgrab icon indicating copy to clipboard operation
podgrab copied to clipboard

4xx and 5xx responses are treated as successful downloads instead of errors

Open oblivierblop opened this issue 4 years ago • 0 comments

Before creating a bug report please make sure you are using the latest docker image / code base.

Please complete the following information

  • Installation Type: Native
  • Have you tried using the latest docker image / code base: yes

Describe the bug If podgrab tries to download an episode file from a URL that returns a client or server error HTTP response (e.g. 403 Forbidden), then podgrab will save the received content (normally some text or some HTML) as the podcast file and mark the episode as downloaded.

It could be there is an assumption in podgrab that net/http Client.Get will return non-2xx responses as errors, which it does not

To Reproduce Steps to reproduce the behavior:

I found this bug because of behavior described in #169 where the URLs for old episodes in Patreon RSS feeds have expiring tokens. However this behavior can be reproduced by manually changing file_url for an entry in podcast_items to any URL that responds with 4xx (and I assume 5xx errors)

  1. Add any podcast to podgrab
  2. Terminate podgrab and change one of the entries in podcast_items file_url to 'http://google.com/404'. Note the title
  3. Restart podgrab
  4. Attempt to download the episode where you altered the url

Expected behavior Nothing is saved and the episode is not marked as downloaded. Ideally some feedback in the web UI would indicate the failure

oblivierblop avatar Nov 13 '21 16:11 oblivierblop