Sn8z / Poddr

Podcatcher made with Electron and Angular
https://sn8z.github.io/Poddr/
GNU General Public License v3.0
235 stars 25 forks source link

Bug: Poddr not following redirects? #1421

Open fhitchen opened 1 year ago

fhitchen commented 1 year ago

Describe the bug I subscribed to the "News Agents" podcast and wanted to download a cast. It did not work. I checked the log and found this entry:

[2023-01-06 15:23:32.451] [info] Podcast service :: Getting Podcastfeed using RSS => https://feeds.captivate.fm/the-news-agents/
[2023-01-06 15:23:44.112] [info] Toast service :: Showing toast => Downloading What's Harry's endgame?
[2023-01-06 15:23:44.130] [info] Offline service :: Checking if download folder exists...
[2023-01-06 15:23:44.130] [info] Offline service :: Download folder exists.
[2023-01-06 15:23:44.130] [info] Offline service :: downloading from => https://dax.captivate.fm/74123438-d557-4083-9b9a-1505267c4afb/PINCHER-PILOT-EPISODE-TO-GO-01.mp3?aw_0_1st.showid=c49390b9-6909-4cd3-a974-e270cf686f27&aw_0_1st.episodeid=d2752acb-1101-43fe-bfa7-a2efbc134b5a
[2023-01-06 15:24:24.136] [error] Offline service :: {"message":"Timeout has occurred","name":"TimeoutError"}
[2023-01-06 15:24:24.136] [info] Toast service :: Showing error toast => Something went wrong when trying to download an episode.

To Reproduce Click on the download option.

Expected behavior The podcast should appear in the Downloads/Poddr directory.

Screenshots See log file entry above

Desktop (please complete the following information):

Additional context I tried to download the podcast using the URL mentioned in the log file entry. I noticed that the web server is sending a HTTP 302 status code along with a redirect, I am suspecting that Poddr is not handling redirects. I added the -L flag to curl and was able to successfully retrieve the podcast.

$ curl -v  'https://dax.captivate.fm/74123438-d557-4083-9b9a-1505267c4afb/PINCHER-PILOT-EPISODE-TO-GO-01.mp3?aw_0_1st.showid=c49390b9-6909-4cd3-a974-e270cf686f27&aw_0_1st.episodeid=d2752acb-1101-43fe-bfa7-a2efbc134b5a' -o xxx
.
.
.
> GET /74123438-d557-4083-9b9a-1505267c4afb/PINCHER-PILOT-EPISODE-TO-GO-01.mp3?aw_0_1st.showid=c49390b9-6909-4cd3-a974-e270cf686f27&aw_0_1st.episodeid=d2752acb-1101-43fe-bfa7-a2efbc134b5a HTTP/1.1
> Host: dax.captivate.fm
> User-Agent: curl/7.85.0
> Accept: */*
> 
< HTTP/1.1 302 Found
< location: https://dax.captivate.fm/74123438-d557-4083-9b9a-1505267c4afb/PINCHER-PILOT-EPISODE-TO-GO-01.mp3?aw_0_1st.showid=c49390b9-6909-4cd3-a974-e270cf686f27&aw_0_1st.episodeid=d2752acb-1101-43fe-bfa7-a2efbc134b5a&listeningSessionID=9e496cf7-725e-3fbd-9aa1-12f1de1ea1de
< connection: close
Sn8z commented 1 year ago

Thanks for the detailed investigation :smile: Will take a look when I got the time!