Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Cover art for radio e.g. Radio paradise
#3
(01-02-2024, 11:08 PM)Tim Curtis Wrote: The radio station feature in moOde doesn't support track covers but I think there is some code in the upmpdcli repo that fetches covers from RP. Maybe a dev can investigate and see if it can be integrated?

Just because I wasn't feeling sleepy, scratching the net I came across this:

https://api.radioparadise.com/api/now_playing?chan=2

where chan=<station id>, and the station IDs are the following:

0 = main mix
1 = mellow mix
2 = rock mix
3 = global mix

this api call returns this object:
Code:
{
   "time":202,
   "artist":"R.E.M.",
   "title":"What's The Frequency, Kenneth",
   "album":"Monster",
   "year":"1994",
   "cover":"https:\/\/img.radioparadise.com\/covers\/l\/B000002MU3.jpg",
   "cover_med":"https:\/\/img.radioparadise.com\/covers\/m\/B000002MU3.jpg",
   "cover_small":"https:\/\/img.radioparadise.com\/covers\/s\/B000002MU3.jpg"
}


The links of the various albumarts return JPGs at:
l = 300x300 or 500x500
m = 160x160
s = 70x70

ETA
time seems to be counting down to 0, rather than incrementing.



a more complex result can be retrieved with:

https://api.radioparadise.com/api/get_bl...&info=true


and returns something like the following:

Code:
{
   "event": "2524574",
   "block_id": "1022",
   "slice_num": "2",
   "sched_time_millis": 1704252987550,
   "type": "M",
   "priority": "0",
   "end_event": "2524577",
   "length": "1318",
   "url": "https:\/\/audio-geo.radioparadise.com\/chan\/2\/x\/1022\/4\/b\/1022-2.flac",
   "timeout_millis": 2700000,
   "chan": 2,
   "channel": {
       "chan": "2",
       "title": "RP Rock Mix",
       "stream_name": "rock"
   },
   "bitrate": "flac",
   "ext": "flac",
   "cue": 25000,
   "expiration": 1704339414,
   "filename": {
       "0": "2524574-2524577"
   },
   "image_base": "\/\/img.radioparadise.com\/",
   "slide_base": "\/\/img.radioparadise.com\/slideshow\/720\/",
   "song": {
       "0": {
           "event": "2524574",
           "audio_id": "33095",
           "type": "M",
           "priority": "0",
           "block_id": "1022",
           "slice_num": 0,
           "sched_time_millis": 1704252987550,
           "song_id": "33095",
           "ratings_num": "744",
           "ratings_dist": {
               "0": 41,
               "1": 18,
               "2": 36,
               "3": 18,
               "4": 47,
               "5": 111,
               "6": 187,
               "7": 144,
               "8": 73,
               "9": 69
           },
           "duration": 254600,
           "artist": "Depeche Mode",
           "title": "Behind the Wheel\/Route 66",
           "album": "Behind the Wheel\/Route 66 12-inch",
           "year": "1986",
           "asin": "DEPECHEMODE1987",
           "rating": "6.67",
           "slideshow": "35248,73343,62051,47775,64227,43333,73858,42389,2491,43097,62857,71514,38974,46529,39908,52707,41354,44817,2486,71934,63305,35844,2234,62169,41350,12014,35245,30495",
           "user_rating": null,
           "cover": "covers\/l\/DEPECHEMODE1987.jpg",
           "cover_large": "covers\/l\/DEPECHEMODE1987.jpg",
           "cover_medium": "covers\/m\/DEPECHEMODE1987.jpg",
           "cover_small": "covers\/s\/DEPECHEMODE1987.jpg",
           "elapsed": 0,
           "timeout_millis": 2700000,
           "gapless_url": "https:\/\/audio-geo.radioparadise.com\/chan\/2\/x\/1022\/4\/g\/1022-2.flac",
           "episode_id": 0,
           "episode_slug": 0,
           "isRateable": true,
           "isPlayableAfterSkip": true,
           "isPlayableOnStart": true,
           "updateHistory": true,
           "updateProgressIntervalMillis": 0
       },
       "1": {
           "event": "2524575",
           "audio_id": "42079",
           "type": "M",
           "priority": "0",
           "block_id": "1022",
           "slice_num": 0,
           "sched_time_millis": 1704253242150,
           "song_id": "42079",
           "ratings_num": "1532",
           "ratings_dist": {
               "0": 37,
               "1": 30,
               "2": 62,
               "3": 43,
               "4": 82,
               "5": 196,
               "6": 480,
               "7": 354,
               "8": 120,
               "9": 127
           },
           "duration": 260000,
           "artist": "Kings of Leon",
           "title": "The End",
           "album": "Come Around Sundown",
           "year": "2010",
           "asin": "B003YK42LQ",
           "rating": "6.91",
           "slideshow": "46622,11014,37197,56074,63053,70320,19692,71594,12480,15039,43634,67335,3569,50587,25965,17219,12478,42771,12481,65410,12483,35677,25981,37870,12484,73329,50068,40104",
           "user_rating": null,
           "cover": "covers\/l\/B003YK42LQ.jpg",
           "cover_large": "covers\/l\/B003YK42LQ.jpg",
           "cover_medium": "covers\/m\/B003YK42LQ.jpg",
           "cover_small": "covers\/s\/B003YK42LQ.jpg",
           "elapsed": 254600,
           "timeout_millis": 2700000,
           "gapless_url": "https:\/\/audio-geo.radioparadise.com\/chan\/2\/x\/1022\/4\/g\/1022-3.flac",
           "episode_id": 0,
           "episode_slug": 0,
           "isRateable": true,
           "isPlayableAfterSkip": true,
           "isPlayableOnStart": true,
           "updateHistory": true,
           "updateProgressIntervalMillis": 0
       },
       "2": {
           "event": "2524576",
           "audio_id": "1564",
           "type": "M",
           "priority": "0",
           "block_id": "1022",
           "slice_num": 0,
           "sched_time_millis": 1704253502150,
           "song_id": "1564",
           "ratings_num": "3488",
           "ratings_dist": {
               "0": 18,
               "1": 13,
               "2": 14,
               "3": 26,
               "4": 33,
               "5": 69,
               "6": 180,
               "7": 514,
               "8": 952,
               "9": 1669
           },
           "duration": 137500,
           "artist": "Jimi Hendrix",
           "title": "Little Wing",
           "album": "Axis: Bold as Love",
           "year": "1969",
           "asin": "B006WTINYI",
           "rating": "9",
           "slideshow": "71906,59039,53338,72487,32325,64782,37934,37949,56041,33241,33746,44545,27605,38420,60471,66390",
           "user_rating": null,
           "cover": "covers\/l\/B006WTINYI.jpg",
           "cover_large": "covers\/l\/B006WTINYI.jpg",
           "cover_medium": "covers\/m\/B006WTINYI.jpg",
           "cover_small": "covers\/s\/B006WTINYI.jpg",
           "elapsed": 514600,
           "timeout_millis": 2700000,
           "gapless_url": "https:\/\/audio-geo.radioparadise.com\/chan\/2\/x\/1022\/4\/g\/1022-4.flac",
           "episode_id": 0,
           "episode_slug": 0,
           "isRateable": true,
           "isPlayableAfterSkip": true,
           "isPlayableOnStart": true,
           "updateHistory": true,
           "updateProgressIntervalMillis": 0
       },
       "3": {
           "event": "2524577",
           "audio_id": "44630",
           "type": "M",
           "priority": "0",
           "block_id": "1022",
           "slice_num": 0,
           "sched_time_millis": 1704253639650,
           "song_id": "44630",
           "ratings_num": "6859",
           "ratings_dist": {
               "0": 82,
               "1": 70,
               "2": 74,
               "3": 92,
               "4": 170,
               "5": 405,
               "6": 1475,
               "7": 2326,
               "8": 1245,
               "9": 918
           },
           "duration": 666000,
           "artist": "The War on Drugs",
           "title": "Thinking Of A Place",
           "album": "A Deeper Understanding",
           "year": "2017",
           "asin": "B071FL9473",
           "rating": "7.79",
           "slideshow": "48620,39899,46486,34874,13720,70540,46701,54418,52411,43798,56213,18706,65261,17822,73851,73551,46934,74216,66396,33461,61301,12989,71016,30894,39045,27268,58299,44569,74858,28554,26876,53926,38549,41981,74211,44101,61772,72273,60314,61187,48649,45566,29460,27493,35540,47526,46790,42385,55244,74905,39587,65016,73972,42639,19130,74867,47536,28254,54107,38770,59752,74856,65147,53231,61063,57185,66441,72296",
           "user_rating": null,
           "cover": "covers\/l\/B071FL9473.jpg",
           "cover_large": "covers\/l\/B071FL9473.jpg",
           "cover_medium": "covers\/m\/B071FL9473.jpg",
           "cover_small": "covers\/s\/B071FL9473.jpg",
           "elapsed": 652100,
           "timeout_millis": 2700000,
           "gapless_url": "https:\/\/audio-geo.radioparadise.com\/chan\/2\/x\/1022\/4\/g\/1022-5.flac",
           "episode_id": 0,
           "episode_slug": 0,
           "isRateable": true,
           "isPlayableAfterSkip": true,
           "isPlayableOnStart": true,
           "updateHistory": true,
           "updateProgressIntervalMillis": 0
       }
   },
   "cache_ahead_timeout": {
       "0": {
           "cache_length_millis_max": 1800000,
           "timeout_millis": 900000
       },
       "1": {
           "cache_length_millis_max": 3600000,
           "timeout_millis": 1800000
       },
       "2": {
           "cache_length_millis_max": 5400000,
           "timeout_millis": 2700000
       },
       "3": {
           "cache_length_millis_max": 7200000,
           "timeout_millis": 3600000
       },
       "4": {
           "cache_length_millis_max": 10800000,
           "timeout_millis": 5400000
       },
       "5": {
           "cache_length_millis_max": 14400000,
           "timeout_millis": 7200000
       },
       "6": {
           "cache_length_millis_max": 18000000,
           "timeout_millis": 9000000
       },
       "7": {
           "cache_length_millis_max": 21600000,
           "timeout_millis": 10800000
       },
       "8": {
           "cache_length_millis_max": 9223372036854775807,
           "timeout_millis": 14400000
       }
   },
   "current_event_id": 2524574,
   "max_gapless_event_id": 2524604
}

The first "song" is the currently playing, then follow further 3 in the queue.

Only thing, we have to hardcode the channels (or write them in the station data) unless there is an api that returns such channel based on the station name, which I haven't found yet.
Reply


Messages In This Thread
RE: Cover art for radio e.g. Radio paradise - by Nutul - 01-03-2024, 03:23 AM

Forum Jump: