milaq / YCast

Self hosted vTuner internet radio service emulation
Other
244 stars 93 forks source link

Freecom MusicPal vs Ycast #83

Open lentinj opened 3 years ago

lentinj commented 3 years ago

A Freecom MusicPal (a relatively ancient internet radio) will work fine with YCast with it's last firmware (1.68). However, for the My stations to work, the stations need to provide a "stationMime". You can bodge this by assuming all your radio stations are MP3:

--- a/ycast/my_stations.py
+++ b/ycast/my_stations.py
@@ -20,7 +20,7 @@ class Station:
         self.icon = None

     def to_vtuner(self):
-        return vtuner.Station(self.id, self.name, self.tag, self.url, self.icon, self.tag, None, None, None, None)
+        return vtuner.Station(self.id, self.name, self.tag, self.url, self.icon, self.tag, None, 'MP3', None, None)

...but that's pretty ugly. The obvious answer is to expand the YAML format to allow for extra attributes, e.g.:

FIP:
  FIP autour du jazz:
    url: http://direct.fipRadio.fr/live/fip-webRadio2.mp3
    mime: MP3

And then fill in the "mime" field if there. This is easy enough to do if you like the idea, but https://github.com/milaq/YCast/issues/11 makes it sound like you've got ideas for how to autodetect? There isn't any obvious bullet-proof way to do this as far as I can see though.

EDIT: Note-to-self if I do implement this. stationMime isn't really MIME, the MusicPal expects "MP3", "WMA", as per radiobrowser's codec.