jeff-hughes / shellcaster

Terminal-based podcast manager built in Rust
GNU General Public License v3.0
199 stars 12 forks source link

Handle redirects when downloading a file #62

Open dougli1sqrd opened 6 months ago

dougli1sqrd commented 6 months ago

This is mostly suspicion at this point and not confirmed, but I think shellcaster is not properly following a redirect when a podcast episode URL ends up redirecting. I'm seeing this mostly on podcasts that use omny I think? Sadly several podcasts I follow now use it making it hard on shellcaster.

I'm interested in following up to see if redirection is in fact the real issue.

For an example: 1) Add Behind the Bastards: While in Shellcaster type a, and then paste: https://omnycontent.com/d/playlist/e73c998e-6e60-432f-8610-ae210140c5b1/E5F91208-CC7E-4726-A312-AE280140AD11/D64F756D-6D5E-4FAE-B24F-AE280140AD36/podcast.rss 2) Try Download with d the episode titled: It Could Happen Here Weekly 113 3) Shellcaster will say it's downloading and then with red text say that it couldn't download the episode.

If you try to play the episode in VLC it also has a hard time playing the epsiode with error message:

Your input can't be opened:
VLC is unable to open the MRL 'https://chtbl.com/track/5899E/podtrac.com/pts/redirect.mp3/pscrb.fm/rss/p/traffic.omny.fm/d/clips/e73c998e-6e60-432f-8610-ae210140c5b1/78d30acb-8463-4c40-a5ae-ae2d0145c9ff/8673f262-baeb-4a0e-8841-b0ee01814c37/audio.mp3?utm_source=Podcast&in_playlist=d64f756d-6d5e-4fae-b24f-ae280140ad36'. Check the log for details.

Seeing the redirect.mp3 in the path I tried the URL in my browser and that redirected and then correctly started playing the episode. The Redirected URL is: https://26073.mc.tritondigital.com/OMNY_ITCOULDHAPPENHERE_P/media-session/4bad94f6-a8ff-446d-a74d-a2071fa1e2f5/d/clips/e73c998e-6e60-432f-8610-ae210140c5b1/78d30acb-8463-4c40-a5ae-ae2d0145c9ff/8673f262-baeb-4a0e-8841-b0ee01814c37/audio/direct/t1704517258/It_Could_Happen_Here_Weekly_113.mp3?t=1704517258&starship-rollup=v0_214444414144&in_playlist=d64f756d-6d5e-4fae-b24f-ae280140ad36&utm_source=Podcast.

Opening this as a network stream in VLC also plays correctly, so I suspect that shellcaster would be able to download this episode as well if it was using this second link.

Thanks!