kingosticks / mopidy-tunein

Mopidy extension for playing music from tunein
Apache License 2.0
65 stars 14 forks source link

Radio stopped working in mopidy but works in tunein #46

Closed fmarzocca closed 3 years ago

fmarzocca commented 3 years ago

Hi,

one of my preferred radio station stopped working in mopidy, while it is working from tunein.com browser.

This is the URI: tunein:station:s100963

From the browser ( https://tunein.com/radio/Radio-Antenna-1-Roma-1071-s100963/ ) it is playing, while from mopidy it generates this error:

2020-12-13 10:00:02,244 WARNING [889:TuneInBackend-9] mopidy.internal.http: Problem downloading 'http://a1-it.newradio.it/stream1': Not Available
2020-12-13 10:00:02,245 INFO [889:TuneInBackend-9] mopidy_tunein.actor: Unwrapping stream from URI ('http://a1-it.newradio.it/stream1') failed: error downloading URI 'http://a1-it.newradio.it/stream1'
2020-12-13 10:00:02,357 INFO [889:TuneInBackend-9] mopidy_tunein.tunein: TuneIn playlist request for http://a1-it.newradio.it/stream1 failed: 404 Client Error: Not Available for url: http://a1-it.newradio.it/stream1
2020-12-13 10:00:02,360 WARNING [889:Core-17] mopidy.core.tracklist: Track is not playable: tunein:station:s100963
kingosticks commented 3 years ago

This stream is not available in my country I cannot debug this.

kingosticks commented 3 years ago

In general, this behaviour normally happens when the radio provider changes their streaming URL by appending the new location but decides to keep the defunct old URL somewhere in the 5 million layers of playlist redirects they have decided to use, because... I have no idea why they do this. It's dumb. We probably could work on a better algorithm to resolve the stream but I'm not interested.

You can try to manually resolve the stream yourself. Start at https://opml.radiotime.com/Tune.ashx?render=json&id=s100963 and check each link in each playlist it gives you until you find a playable URI, then just use that URI directly. This will break as soon as they update their URI again. This station is geo protected so even if I was interested in doing this myself, I can't.

fmarzocca commented 3 years ago

Hi Nick,

that url gives me just one result, not playable:

 { "head": {    "status": "200"}, "body": [
 { "element" : "audio", 
"url": "http://a1-it.newradio.it/stream1",
"reliability": 25,
"bitrate": 128,
"media_type": "mp3",
"position": 0,
"player_width": 640,
"player_height": 480,
"is_hls_advanced": "false",
"live_seek_stream": "false",
"guide_id": "e65565228",
"is_direct": true }] }
kingosticks commented 3 years ago

Yes, you have to play the game of follow the links i.e. next you try "http://a1-it.newradio.it/stream1". And if that is a dead link (which it seems to be according to your first log) they have broken it and there is nothing we can do here. You can try reporting the station to TuneIn on their website. Or you could try informing the station themselves. Or you can wait a while and see if it's just their caching problem.