-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internet radio station won't play #1194
Comments
Thanks for the report, I can reproduce the problem. I will investigate this further as soon as I have time. I can't give any direct suggestions how to debug further but it was already a great help that you reported this 👍. |
The reason seems to be how the new Music version handles stream URL redirections and how those streams have set the HTTP headers: Taking http://streams.egofm.de/egoFM-hq as an example, it firsts redirected me to the URL http://egofm-live.cast.addradio.de/egofm/live/mp3/high/stream.mp3?ar-distributor=ffa0&aw_0_req.gdpr=true which then redirected to http://egofm--di--nacs-ais-lgc--05--cdn.cast.addradio.de/egofm/live/mp3/high/stream.mp3?ar-distributor=ffa0&aw_0_req.gdpr=true&_art=dj0yJmlwPTkxLjE1Ny40NC45MyZpZD1pY3NjeGwtd2pub25jbm1iJnQ9MTczNjQ1NDQzOCZzPTc4NjZmMjljI2U0MGQ5NjA1ZjAyMzQzOGEzODE3M2FmMzk0NTVlMDM1, which was the actual stream. The problem is that both of those redirections return I can easily make a bit hacky fix for this or then use a bit more effort to do the header handling logic with redirections actually work more sanely. Either way, there should be a fix in the next Music app release. I don't see this as so critical that there would be an immediate hotfix for this. If nothing more severe is found, then the next version will likely be released sometime during February. |
Thanks a lot for the explanation! I will patiently wait for the next release then :) |
In the meantime, you should be able to work around this by entering the unwieldy URL http://egofm--di--nacs-ais-lgc--05--cdn.cast.addradio.de/egofm/live/mp3/high/stream.mp3?ar-distributor=ffa0&aw_0_req.gdpr=true&_art=dj0yJmlwPTkxLjE1Ny40NC45MyZpZD1pY3NjeGwtd2pub25jbm1iJnQ9MTczNjQ1NDQzOCZzPTc4NjZmMjljI2U0MGQ5NjA1ZjAyMzQzOGEzODE3M2FmMzk0NTVlMDM1 directly to the Music app as the stream URL. It's possible that this URL changes from time to time but at least for now it still works. |
I tried adding the unwieldy URL but somehow it is still stuck on "Loading". I see some metadata is being parsed from the playlist (broadcaster name, genre, ...) but playback does not start. URL works when pasted directly in the browser though. |
That's weird because for me, it does play fine using the unmodified Music v2.1.1 on Nextcloud 30.0.4. And I tested it now with similar results on Firefox, Chrome, and Edge. It took a few seconds (maybe 3 - 4 s) to start playing but after that, no problems. |
If you open the browser developer tools with the F12 key and look at the Network tab while clicking the radio station with that long URL, then can you see the endpoint I'm just trying to figure out if there is another issue here, besides the obvious one which I mentioned before. |
You may see the headers of the pending request once you stop the stream. Right click on the play button to find the stop option. |
I have (0) Response headers in the |
Any errors in nextcloud.log or the browser console? |
I assume that one comes already when loading the page? If so, then it's not relevant. It's just that the AngularJS framework checks upon load if the |
Btw, have you been able to play some other stream? So is the problem specific for this stream of affecting all the streams? |
That is an excellent question. I managed to playback this stream successfully: http://streamcdnb1-4c4b867c89244861ac216426883d1ad0.msvdn.net/radiodeejay/radiodeejay/play1.m3u8 The above is an HLS stream. Are there any issues with other protocols? I am running Chrome on a Macbook Air. |
HLS steams are technically quite different from the other stream types, and have basically totally separate handling in the Music app. The problem could also be in the settings of your HTTP server or proxy (if using any), as the HLS streams have been specifically designed to be trouble-free with any proxies. To separate server-side issues from the client-side issues, you could try to use some other browser and/or computer if possible. You could also try to disable the stream relaying via your server with the configuration key music.relay_radio_stream, but then you would need to configure also music.allowed_stream_src |
Unfortunately the failing streams fail also with Firefox, although there I receive a couple of error messages:
|
This one should be unrelated to radio streams, but something went wrong when checking if there would be any unscanned audio files available. Nextcloud.log could have more details. |
The problem was how we handled the HTTP headers in case the original stream URL redirected the connection to another URL. And specifically, if the redirection response returned the Content-Length header with value 0 and the final URL didn't have this header (as is typical for live streams). In that case, the 0-length was erroneously returned to the client as the length of the stream. The problem originated from how the "associative" mode of the PHP built-in function get_headers works. It makes it basically impossible to know for certain, which headers come from the final URL and which ones from the intermediate redirection response(s). To work around this, we now use the function in non-associative mode and parse the result to a dictionary with our own logic. refs #1194
The problem was how we handled the HTTP headers in case the original stream URL redirected the connection to another URL. And specifically, if the redirection response returned the Content-Length header with value 0 and the final URL didn't have this header (as is typical for live streams). In that case, the 0-length was erroneously returned to the client as the length of the stream. The problem originated from how the "associative" mode of the PHP built-in function get_headers works. It makes it basically impossible to know for certain, which headers come from the final URL and which ones from the intermediate redirection response(s). To work around this, we now use the function in non-associative mode and parse the result to a dictionary with our own logic. refs #1194
Hi |
After some more digging I also set the relaying options to false and added my radiostations to the allowed streams. The error messege changed to the origin stream URL, but still unable to playback. Firefox Browser Debug also shows it is violating directive of Content security policy. Will try to add the unwieldy URLs. |
@terrlinde
Now, you should get back the old behavior by configuring
Note that you need to reload the page in the browser for the allowed_stream_src to take effect. If the problem with the relaying is not caused by the redirection bug (which I already fixed this week) but affects all the non-HLS streams, then it could be that a reverse proxy or similar is interfering with it. |
Hello there :)
I am playing with this great plugin on my Nextcloud server (v30.0.4).
I'm trying to playback an internet radio station and according to the "Getting Started" page, I have to add the stream URL.
Trying to add, for example, these URLs:
But for both, I am stuck in the "Loading" state. URLs play fine if I paste them directly in the browser.
Any suggestion on how I can debug this issue further?
The text was updated successfully, but these errors were encountered: