Download Episode fails in Brave web browser
mitchdowney opened this issue · comments
Related to PR: #1247 cc @jj-style
Using the "Download Episode" feature in the Brave web browser, I downloaded a few episodes for different podcasts successfully, but the Linux Unplugged episode errors immediately. When I inspect the dev console, I see the following error:
Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
chtbl.com/track/392D9/aphid.fireside.fm/d/1437767933/f31a453c-fa15-491f-8618-3f71f1d565e5/503da869-566b-4983-87d3-2073a1c085a3.mp3:1
When I inspect the Network tab for the error, I see:
In the UI, the errors display as:
It seems like there is something about the Linux Unplugged's file server configuration that is not allowing the episode to be downloaded. Can this be fixed on our side? Or is there a change we should recommend to the podcaster?
chtbl.com is a download stats tracking prefix url service, so I imagine there is at least one redirect happening. Does chtbl disallow CORS file download requests?
I have been able to replicate this, and have a found a few things.
I have been able to get it closer via setting mode: 'no-cors
in the request.
In addition chtbl.com then redirects to another site where the mp3 is actually hosted and I think that is the URL we want to download.
I set redirect: 'follow'
in the request and it got closer but may need to manually fetch the response.redirect
if it exists on the response as it did not do it by itself.
Another thing to note is chtbl.com was being blocked by the default install of uBlock origin but unfortunately I don't think there is much we can do about that.
I think I nearly have something working so will try and get a fix out soon though may not be until the weekend
Okay I'm not sure this is possible to solve from the browser. I think to solve this the file will need to be downloaded from the server so would require some work in the backend.
Happy if you need to revert #1247 as perhaps the implementation was not quite right there
@jj-style ok thanks so much for investigating. I'll leave the feature up for now as it did seem to work in most of my tests. If it becomes a pain point for listeners we can revert or revise it.
I don't think we want to proxy download requests through our own servers to bypass a CORS (?) issue like this. It would incur network transfer costs on our side, and if podcasters want browsers to be able to download episode files without issue, maybe they should talk to Chartable.
Yeah that makes complete sense, sounds good!