plintx / mopidy-radionet

Mopidy extension for playing music from radio.net http://www.mopidy.com
Apache License 2.0
11 stars 5 forks source link

Browse > Radio.net shows no stations at all #12

Closed TrollDecker closed 3 years ago

TrollDecker commented 3 years ago

Heyo,

I just installed mopidy-radionet and I'm getting nowhere with it because the browse page lists absolutely nothing when it finally appears. This happens in both Iris and the Mobile frontend.

I've checked journalctl -u mopidy and found this:

Feb 09 21:28:26 pirate-audio mopidy[6513]: INFO     [RadioNetBackend-4] mopidy_radionet.radionet Radio.net: APIPREFIX https://api.radio.net/info/v2
Feb 09 21:28:26 pirate-audio mopidy[6513]: INFO     [RadioNetBackend-4] mopidy_radionet.radionet Radio.net: APIKEY [REDACTED]
Feb 09 21:28:38 pirate-audio mopidy[6513]: INFO     [RadioNetBackend-4] mopidy_radionet.radionet Radio.net: Loaded 85 top stations.
Feb 09 21:28:39 pirate-audio mopidy[6513]: INFO     [RadioNetBackend-4] mopidy_radionet.radionet Radio.net: Loaded 9 local stations.
Feb 09 21:28:39 pirate-audio mopidy[6513]: ERROR    [Core-10] mopidy.core.library RadioNetBackend backend caused an exception.
Feb 09 21:28:39 pirate-audio mopidy[6513]: Traceback (most recent call last):
Feb 09 21:28:39 pirate-audio mopidy[6513]:   File "/usr/lib/python3/dist-packages/mopidy/core/library.py", line 17, in _backend_error_handling
Feb 09 21:28:39 pirate-audio mopidy[6513]:     yield
Feb 09 21:28:39 pirate-audio mopidy[6513]:   File "/usr/lib/python3/dist-packages/mopidy/core/library.py", line 114, in _browse
Feb 09 21:28:39 pirate-audio mopidy[6513]:     result = backend.library.browse(uri).get()
Feb 09 21:28:39 pirate-audio mopidy[6513]:   File "/usr/lib/python3/dist-packages/pykka/_threading.py", line 45, in get
Feb 09 21:28:39 pirate-audio mopidy[6513]:     _compat.reraise(*self._data['exc_info'])
Feb 09 21:28:39 pirate-audio mopidy[6513]:   File "/usr/lib/python3/dist-packages/pykka/_compat/__init__.py", line 29, in reraise
Feb 09 21:28:39 pirate-audio mopidy[6513]:     raise value
Feb 09 21:28:39 pirate-audio mopidy[6513]:   File "/usr/lib/python3/dist-packages/pykka/_actor.py", line 193, in _actor_loop
Feb 09 21:28:39 pirate-audio mopidy[6513]:     response = self._handle_receive(envelope.message)
Feb 09 21:28:39 pirate-audio mopidy[6513]:   File "/usr/lib/python3/dist-packages/pykka/_actor.py", line 299, in _handle_receive
Feb 09 21:28:39 pirate-audio mopidy[6513]:     return callee(*message.args, **message.kwargs)
Feb 09 21:28:39 pirate-audio mopidy[6513]:   File "/usr/local/lib/python3.7/dist-packages/mopidy_radionet/library.py", line 49, in browse
Feb 09 21:28:39 pirate-audio mopidy[6513]:     self.backend.refresh()
Feb 09 21:28:39 pirate-audio mopidy[6513]:   File "/usr/local/lib/python3.7/dist-packages/mopidy_radionet/backend.py", line 47, in refresh
Feb 09 21:28:39 pirate-audio mopidy[6513]:     self.radionet.get_favorites()
Feb 09 21:28:39 pirate-audio mopidy[6513]:   File "/usr/local/lib/python3.7/dist-packages/mopidy_radionet/radionet.py", line 199, in get_favorites
Feb 09 21:28:39 pirate-audio mopidy[6513]:     station = self.get_station_by_id(json['categories'][0]['matches'][0]['id'])
Feb 09 21:28:39 pirate-audio mopidy[6513]: IndexError: list index out of range

I'm running the following:

My config is:

[radionet]
enabled = true
min_bitrate = 128 (I've also tried 96)
language = pl     (I've also tried net)
favorite_stations =
  'The Trip'
  'Drone Zone'
  'Fantasy Italo Radio'

[EDIT] I'm getting a 410 Gone when I try to poke api.radio.net with curl and Chromium. I don't know if that's anything.

[EDITEDIT] Scratch that, the API seems fine, I just wasn't poking the right part.

TrollDecker commented 3 years ago

ACK! Nevermind. My favorite_stations config wasn't right. I needed to put the put the station name as it appears in the address bar (the slug?), so my config needed to be:

favorite_stations =
  'thetrip'
  'dronezone'
  'fantasyitalo'

So, it turned out to be a case of this issue needing to be addressed. :woman_facepalming:

chris-aeviator commented 3 years ago

Even after adding favorite_stations to my config I my browse section stays empty of any radionet entries

TrollDecker commented 3 years ago

Which stations are you trying to add? Could it be related to #15?

chris-aeviator commented 3 years ago

I've disabled it since trying it out but this is my config that I've tried

grafik

The interesting thing was that not only no station appeared, but it seemed like the plugin was not installed at all (no entry saying radio in browse section). I have since updated mopidy and will try again to re-enable this today.

UPDATE: no luck with updated Mopidy, no log about this plugin after enabling the config and restarting mopdiy

grafik

kokosowy commented 3 years ago

@chris-aeviator as far as I know favourite station parameter is mandatory. You can't comment it out, you need to use it, you can leave it blank.

chris-aeviator commented 3 years ago

@kokosowy

after enabling the config

meant uncommenting it - the screenshot was from before I did that

EDIT:

here's my config

[radionet]
enabled = true
language = de
min_bitrate = 96
favorite_stations = 'deutschlandfunk'

I tried before also

language = net
TrollDecker commented 3 years ago

Right, I've poked the API and it seems to be returning Deutschlandfunk just fine for me. I've also added it to my favorite_stations, both as part of my list and as a lone item in a single-line format, and it's shown up just fine. If there's no log entries alerting you that it's even just disabled (which means it's at least detected the extension's presence, I would think), the problem seems to lie elsewhere. :confused:

I guess the first question to ask is: how did you install mopidy and how did you install mopidy-radionet?

chris-aeviator commented 3 years ago

I realized I still have mopidy 2 installed - is this an issue? I installed mopidy-radionet via pip.

TrollDecker commented 3 years ago

Mopidy 2 is probably an issue, yeah, because It's still dependent on Python 2 while Mopidy 3 and it's extentions, this one included, will be exclusively Python 3-dependent.

chris-aeviator commented 2 years ago

It's been a while but I now upgraded to mopidy 3, re-installed the plugin and still have no stations listed in browse

[radionet]
enabled = true
language = net # or net, de, at, fr, pt, es, dk, se, it
min_bitrate = 96
favorite_stations =
  'bbcradio1'

image

kokosowy commented 2 years ago

Hi @chris-aeviator. You need to implement https://github.com/plintx/mopidy-radionet/pull/18 manually for this issue, once done it will work for sure.