jeff-hughes / shellcaster

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

Authorisation support #44

Open lacamar opened 2 years ago

lacamar commented 2 years ago

Would it be possible to add support for podcasts that require authorisation with a username and password?

I am currently trying this with a podcast and it works partially when I insert the username and password in the beginning of the URL (i.e. https://username:password@website.com/rss). This allows the feed to load, but downloads and streams require a verification too, which I cannot find a way to provide via shellcaster. It may be possible with certain hooks but I am not sure. When I try to stream or download the episodes, it just leads to a 401 error code from the server.

jeff-hughes commented 2 years ago

Interesting, that's not a situation I've come across. I'm presuming this is some sort of a "subscribers-only" feed offered only for supporters, or perhaps a feed that's internal to an organization or something.

If you're trying to download/stream an episode, how would you perform the verification there? By inputting the same sort of URL pattern? Based on what you're describing, it sounds like the RSS feed providing generic URLs to you that don't have the same verification inserted. In other words, it's giving back a list of episodes like so:

rather than:

Have you used other podcast managers that handle this properly? And if so, what do they do -- pop up a login prompt or something when you try to download/stream an episode?

lacamar commented 2 years ago

With the feed, it comes via a link to an mp3 like your first set of examples and if it is opened in a browser a system window will appear that has a username and password field. Taking one of these links straight from the feed and inserting the username and password string exactly like your second example satisfies the authentication and the mp3 will load, either in a browser or via mpv.

GPodder has a system for handling this, when adding the podcast via the usual feed URL (no username or password) it will open a dialogue similar to what you would see in the browser, a simple username and password field. You enter the details once and that's it. I haven't looked at how it works under the hood, but trying the podcast feed in GPodder works and the episodes are downloadable.