Airsonic: [10.4.0] web radio not handling binary stream anymore

Created on 13 Aug 2019  路  7Comments  路  Source: airsonic/airsonic

Problem description

With 10.4.0, webradio using a direct link to a mp3 or any equivalent binary stream doesn't work anymore.
Also, this error is recorded in the log file:

2019-08-13 19:10:24.020 ERROR --- o.a.p.s.InternetRadioService             : Failed to retrieve sources for internet radio http://direct.franceinfo.fr/live/franceinfo-midfi.mp3.

org.airsonic.player.service.InternetRadioService$PlaylistFormatUnsupported: Unsupported playlist format http://direct.franceinfo.fr/live/franceinfo-midfi.mp3
        at org.airsonic.player.service.InternetRadioService.retrievePlaylist(InternetRadioService.java:243) ~[classes!/:10.4.0-RELEASE]
        at org.airsonic.player.service.InternetRadioService.retrieveInternetRadioSources(InternetRadioService.java:157) ~[classes!/:10.4.0-RELEASE]
        at org.airsonic.player.service.InternetRadioService.retrieveInternetRadioSources(InternetRadioService.java:135) ~[classes!/:10.4.0-RELEASE]
        at org.airsonic.player.service.InternetRadioService.getInternetRadioSources(InternetRadioService.java:110) ~[classes!/:10.4.0-RELEASE]
        at org.airsonic.player.ajax.PlayQueueService.convertInternetRadio(PlayQueueService.java:746) [classes!/:10.4.0-RELEASE]
        at org.airsonic.player.ajax.PlayQueueService.convert(PlayQueueService.java:685) [classes!/:10.4.0-RELEASE]
        at org.airsonic.player.ajax.PlayQueueService.convert(PlayQueueService.java:674) [classes!/:10.4.0-RELEASE]
        at org.airsonic.player.ajax.PlayQueueService.doPlayInternetRadio(PlayQueueService.java:459) [classes!/:10.4.0-RELEASE]
        at org.airsonic.player.ajax.PlayQueueService.playInternetRadio(PlayQueueService.java:255) [classes!/:10.4.0-RELEASE]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_222]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_222]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_222]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_222]
        at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:740) [dwr-3.0.rc1.jar!/:na]
        at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:744) [dwr-3.0.rc1.jar!/:na]
        at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:593) [dwr-3.0.rc1.jar!/:na]
        at org.directwebremoting.dwrp.BaseCallHandler.handle(BaseCallHandler.java:90) [dwr-3.0.rc1.jar!/:na]
        at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:120) [dwr-3.0.rc1.jar!/:na]
        at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:141) [dwr-3.0.rc1.jar!/:na]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [javax.servlet-api-3.1.0.jar!/:3.1.0]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-8.5.42.jar!/:8.5.42]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.42.jar!/:8.5.42]
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.5.42.jar!/:8.5.42]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.42.jar!/:8.5.42]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.42.jar!/:8.5.42]
(...)

Steps to reproduce

  • Define a radio with a link targeting directly a binary stream (.mp3 for example) and not a text file (.m3u). You can use the url in the error log (french information radio).
  • start the radio, an error notification will appear instead.
    The error log will also have an entry related to the unknown playlist format error.

System information

  • Airsonic version: 10.4.0
  • Operating system: Ubuntu 18.04
  • Java version: 1.8.0_222
  • Proxy server: None
  • Client: Firefox 67

Additional notes

No change in the setting, start Airsonic 10.3.1 instead and it'll work correctly.

web-playback neverstale waiting-for-feedback regression

Most helpful comment

As soon as the pull request is reviewed and merged in airsonic-advanced, I'll port it to airsonic as well.

All 7 comments

i'm able to reproduce - can confirm

Is this related to (or a dupe of) #1169?

At first glance, not directly.

1169 seems related to a malformed or unhandled data returned from a playlist link.

Here is related to the fact the 10.4.0 change to web radio doesn't expect anything else than a playlist in text format. Problem is, sometimes the only thing you have is a http link directly to the binary stream (usually in .mp3) without any playlist file in the middle.

This sounds like a good first issue if somebody is interested.

The relevant file is InternetRadioService.java, specifically the retrieveInternetRadioSources method. That method should return a list containing one InternetRadioSource object for URLs that have Content-Type set to an audio format such as audio/mpeg. It's probably not a good idea to trust the extension as that can be changed to be anything in URLs.

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

Hi,

I have the same issue here. I can't help much with code but my workaround is to have a m3u file on a webserver of mine with the mp3 URL inside.

Typically, for radio stream http://icecast.radiofrance.fr/fip-midfi.mp3, I have a m3u file containing:

http://icecast.radiofrance.fr/fip-midfi.mp3

and I use this m3u file instead.

As soon as the pull request is reviewed and merged in airsonic-advanced, I'll port it to airsonic as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anarcat picture anarcat  路  5Comments

kaysond picture kaysond  路  6Comments

RuralHunter picture RuralHunter  路  4Comments

protist picture protist  路  8Comments

saintfrater picture saintfrater  路  7Comments