• Notifications

/upmpdcli

Art for some radio streams not updating #103

Open
distler opened this Issue on 6 Jun · 45 comments

Comments

Projects
None yet
3 participants
Lock conversation

distler commented on 6 Jun

The content you are editing has changed. Please try again.

It's not clear to me that this is a upmpdcli problem, or an irresolvable problem with the MP3 stream.

[radio FIP (Paris)]
url = http://direct.fipradio.fr/live/fip-midfi.mp3
artUrl = http://www.fipradio.fr/sites/default/files/fip-quadri-filet.png
artScript = /usr/local/bin/fip_art.rb

The artScript fires once, when I start playing the stream, and then never again. So the song art displayed is the one associated with the first song playing when the stream started.

The result is the same in both Kazoo and Lumin, so I think it is not a CP problem.

Other radio streams, like

[radio KCRW Music]
url = http://kcrw.streamguys1.com/kcrw_192k_mp3_e24_internet_radio
artUrl = http://www.kcrw.com/music/shows/eclectic24/@@images/square_image
artScript = /usr/local/bin/kcrw_music_art.rb

do update the song art correctly, so my best guess is that upmpdcli is treating the FIP stream as one, infinitely-long, song.

A possible workaround would be a configuration option to re-fire the artScript at a user-defined interval, even if upmpdcli "thinks" the current song is still playing.

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

distler changed the title from FIP Radio art not updating to Art for some radio streams not updating on 7 Jun

distler commented on 7 Jun

The content you are editing has changed. Please try again.

Also of note: the latter stream displays title and artist for current song in the CP. The former stream does not. Another reason to think this is really a problem with the MP3 stream.

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

serverbaboon commented on 7 Jun

The content you are editing has changed. Please try again.

Looks like FIP doesn't have any metadata, the MPD status for that stream gives

{'pos': '0', 'file': 'http://direct.fipradio.fr/live/fip-midfi.mp3', 'id': '3'}

While the KCRW does seem to.

{'id': '6', 'pos': '0', 'name': 'KCRW E24', 'file': 'http://kcrw.streamguys1.com/kcrw_192k_mp3_e24_internet_radio', 'title': 'Little Dragon - Celebrate'}.

Can I ask do you webscrape the radio website most of the time to get the artwork or have you found other Radio stations besides RP who make it easy?

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

distler commented on 7 Jun

The content you are editing has changed. Please try again.

Oh. That's easy. The metadata (in JSON format) is available at this URL. Parsing it to obtain the album art is almost trivial:

#!/usr/bin/ruby
require 'net/http'
require 'json'

uri = URI('http://www.fipradio.fr/livemeta/7')
response = Net::HTTP.get(uri)
songs = JSON.parse(response)['steps'].values
puts songs[songs.length-3]['visual']

The rest of the metadata (song title and artist) is there, too. If there were a way to plug that into upmpdcli ...

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

distler commented on 7 Jun

The content you are editing has changed. Please try again.

Perhaps a good solution would be to generalize (replace or augment) artScript to a more general script which would return the metadata (title, artwork, ...) associated to the currently playing song.

All of the fields would be optional and any which are absent would be replaced by the corresponding in-band metadata (or the artUrl), if present.

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

serverbaboon commented on 7 Jun

The content you are editing has changed. Please try again.

Thanks, your ruby looks better than my python scratchings,

I have found that it can be such a pain tracking down the data for each station, so far xml for RP, json for Linn and webscrape for Naim an d most annoying for me no metadata on BBC streams.

I think (will have to look) upmpdcli passes the url to MPD which does the decoding and upmpdcli pulls back from MPD that current playing status and if MPD does not have artist and track in the file field (for http radio stream) then it cannot trigger the script as there is never a change.

I have mostly working Python script that will do a gracenote lookup for none artwork publishing stations, however since it checks the current mpd song status it still fails as stations that don't have the metadata in the stream.

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

distler commented on 7 Jun edited

The content you are editing has changed. Please try again.

I have found that it can be such a pain tracking down the data for each station, so far xml for RP, json for Linn and webscrape for Naim an d most annoying for me no metadata on BBC streams.

Finding the URL for the metadata is pretty challenging. But, when I find it, parsing is usually easy (it's either JSON or XML).

... if MPD does not have artist and track in the file field (for http radio stream) then it cannot trigger the script as there is never a change.

That's certainly the symptom I was seeing. Which was why my first suggestion was simply to have an option to re-fire the script at some user-defined interval.

As to obtaining the rest of the metadata, here's a trivial modification to the above script, which returns a JSON object with the metadata about the currently playing song

#!/usr/bin/ruby
require 'net/http'
require 'json'

uri = URI('http://www.fipradio.fr/livemeta/7')
response = Net::HTTP.get(uri)
songs = JSON.parse(response)['steps'].values
song = songs[songs.length-3]
metadata = {'title' => song['title'],
           'artist' => song['performers'], 'artUrl' => song['visual']}
puts JSON.generate(metadata)
Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

serverbaboon commented on 7 Jun

The content you are editing has changed. Please try again.

mmm suppose it is a question of what sort of time, not short and not too long that half the song has the wrong image.

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

distler commented on 7 Jun edited

The content you are editing has changed. Please try again.

In the case of the above stream, I can tell you exactly when to refire the script:

#!/usr/bin/ruby
require 'net/http'
require 'json'

uri = URI('http://www.fipradio.fr/livemeta/7')
response = Net::HTTP.get(uri)
songs = JSON.parse(response)['steps'].values
now = Time.now
metadata = {}
songs.each do |song|
  song_end = Time.at(song['end'])
  if (song_end >= now && Time.at(song['start']) <= now)
    metadata = {'title' => song['title'], 'artist' => song['performers'],
       'artUrl' => song['visual'], 'reload' => (song_end - now + 1).to_i}
    break
  end
end
puts JSON.generate(metadata)

The reload parameter is the number of seconds you should wait before refiring the script.

For other streams, I might not be so lucky and might have to guess (say, something like "reload":30).

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

serverbaboon commented on 7 Jun

The content you are editing has changed. Please try again.

Dynamic refresh times based on the return values, interesting , bit beyond my fumblings. I think you maybe lucky on the FIP json data to get the running time Linn Radio and Radio Paradise don't seem to have it.

I'll wait to see what medoc says with interest, he looks busy at the moment, looking at the repositories.

Now if only the BBC opened up their meta data......

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

distler commented on 7 Jun

The content you are editing has changed. Please try again.

Dynamic refresh times based on the return values, interesting ...

Just trying to be as flexible as possible. The script could just as well return the same number each time (for streams that don't provide the relevant information).

Now if only the BBC opened up their meta data......

If they do, let me know. I would love to add that information. :-)

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

Owner

medoc92 commented 29 days ago

The content you are editing has changed. Please try again.

Hi,

It's very nice to have somebody else do the thinking, I would very much like this to happen more often !

You are right about how things currently work: upmpdcli polls mpd for stream metadata (mpd extracts it from streams where it is embedded, look up Icy-Metadata for more info). If the artist or title changed, it fires the art script. Some radios do not embed Icy-Metadata (this does seem to be the case for the FIP stream), so the script is only executed once, when starting up.

Your idea of a script which would retrieve all metadata and also send back an update interval is a good solution to this issue.

I am a bit dubious about JSON though. It's not a problem for the C++ code, because it already uses a JSON package for talking to the streaming services modules. However, the quoting rules will be a bit more complicated than those for the upmpdcli config format (which only needs escaping newlines). This could be an issue for someone writing a shell script. OTOH any radio providing this data is probably going to do it in JSON... (thinking aloud...). So, yes, JSON.

Adding this to the TODO I guess, it should not be very complicated, I hope I can do it soon, it's a nice idea.

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

distler commented 29 days ago

The content you are editing has changed. Please try again.

Some radios do not embed Icy-Metadata (this does seem to be the case for the FIP stream), so the script is only executed once, when starting up.

Your idea of a script which would retrieve all metadata and also send back an update interval is a good solution to this issue.

Obviously, the in-band Icy-Metadata, if present, should take precedence.

This could be an issue for someone writing a shell script. OTOH any radio providing this data is probably going to do it in JSON... (thinking aloud...). So, yes, JSON.

I'm not wedded to JSON output. I can replace

puts JSON.generate(metadata)

with

metadata.each {|key,value| puts "#{key}: #{value}"}

I just assumed that, on the receiving end, JSON would be easier to parse.

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

Owner

medoc92 commented 27 days ago edited

The content you are editing has changed. Please try again.

JSON is fine I think. I wrote a quick implementation, seems to work, but I'd appreciate some testing.

Doc here: https://www.lesbonscomptes.com/upmpdcli/upmpdcli-manual.html#radio-definitions

The git libupnpp seems to crash, use 0.15.2 for now (this has nothing to do with the radio thing).

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

distler commented 27 days ago edited

The content you are editing has changed. Please try again.

I don't recommend the version, above, of the Ruby script that I wrote. Here's one which doesn't rely on the order of the conversion from a hash to an array of values (lousy programming practice):

#!/usr/bin/ruby
require 'net/http'
require 'json'

uri = URI('http://www.fipradio.fr/livemeta/7')
response = Net::HTTP.get(uri)
songs = JSON.parse(response)['steps'].values
now = Time.now
songs.each do |song|
  song_end = Time.at(song['end'])
  if (song['embedType'] == 'song' && song_end >= now && Time.at(song['start']) <= now)
    metadata = {'title' => song['title'].split.collect{|s| s.capitalize}.join(' '),
               'artist' => song['performers'].split.collect{|s| s.capitalize}.join(' '),
               'artUrl' => song['visual'],
               'reload' => (song_end - now + 1).to_i}
    puts JSON.generate(metadata)
    break
  end
end

(It also converts the Artist and Title metadata from ALL CAPS, which is more pleasing to my eyes.)

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

Owner

medoc92 commented 27 days ago

The content you are editing has changed. Please try again.

Ok. I replaced it in the manual.

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

distler commented 27 days ago

The content you are editing has changed. Please try again.

As to testing, I'm sorry to say that I'll be traveling for the next 3 weeks (leaving in an hour), and won't be anywhere near my Rpi streamer. Hopefully someone else will be able to provide more timely feedback.

Thanks for implementing this!

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

Owner

medoc92 commented 27 days ago

The content you are editing has changed. Please try again.

No hurry of any kind really, it will still be there in 3 weeks :)

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

serverbaboon commented 25 days ago

The content you are editing has changed. Please try again.

Just to be clear in my head if we cannot return a reload time do we return a null value or not return the key value pair at all?

{
"title":"The title of the current track",
"artist":"The artist playing",
"artUrl":"https://www.somesite.com/path/to/image.jpg",
}

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

Owner

medoc92 commented 25 days ago

The content you are editing has changed. Please try again.

Don't set it (the default will be 10S).

But use the code I just pushed because things did not work well with reload not set in the previous version.

Of course, you can also set it to the default of 10S or any value of your choice (not too small !)

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

serverbaboon commented 25 days ago

The content you are editing has changed. Please try again.

After struggling trying to understand Ruby , whatever FIP is doing with their metadata and my beginner status I managed to get some success.

I ended up using another FIP station as the one Jacques uses goes into periods of no metadata update for some programs or podcasts which confused me for a while.

I said some success ...

On my older windows Linn Kazoo artwork, artist and title all display correctly.
On my Windows uplay 1.2.7 artist and title are correct but no artwork.
On my Android 7 phone Kazoo 4.11.229.0 title and artwork are ok but the artist is displayed as the title.

I attached a sample from the log, I emailed you the full log, one thing I noticed as that the reload calc needs some allowance for the radio station metadata update on the website as you will be able to see the are several calls of the script running returning a negative reload time. I guess maybe adding 10 secs to the calculated reload time in the script is required before returning the value. I noticed that Jacques does add 1 in his script.

I did notice that Kazoo updates the picture for the current playing track before the FIP website does :-)

:4:src/ohradio.cxx:446::OHRadio::id
:4:src/execmd-fixed.cpp:457::ExecCmd::startExec: (0|1) /usr/local/bin/fips.py 
:5:src/netcon-fixed.cpp:277::Netcon::selectloop: fd 15 has 0x0 mask, erasing
:5:src/execmd-fixed.cpp:815::ExecCmd::doexec: selectloop returned 0
:4:src/execmd-fixed.cpp:981::ExecCmd::wait: got status 0x0
:5:src/ohradio.cxx:234::OHRadio::makestate: metaScript got: [{"reload": 164, "artist": "HOT SUGAR", "artUrl": "https://www.francebleu.fr/s3/cruiser-production/2016/11/842f64cf-cb87-4939-9291-e4a717711f45/400x400_rf_omm_0000919160_dnc.0057894902.jpg", "title": "THE KID WHO DROWNED AT SUMMER CAMP"}

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

distler commented 24 days ago

The content you are editing has changed. Please try again.

The early version of the script had several defects. The last version that I posted corrects those and

  • Will never return a negative reload value.
  • Fixes the capitalization of the artist and title values (so that they're not ALL-CAPS).

I suggest trying that version of the script instead of the one you're using.

You're right that FIPS doesn't provide useful metadata for their late-night (Paris time) shows. In those cases, the current version of the script returns nothing (so the upmpdcli defaults will be used).

I guess maybe adding 10 secs to the calculated reload time in the script is required before returning the value. I noticed that Jacques does add 1 in his script.

I think the current version of the script also addresses this timing issue, but you could try changing the 1 to a 5 if it doesn't.

Again, apologies that I am traveling and can't help in the testing myself.

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

Owner

medoc92 commented 24 days ago

The content you are editing has changed. Please try again.

I just pushed an update to the c++ which guards against very small or negative reload times.

By the way, I've known for some time that there is an issue in upplay about updating the current song metadata, I think mostly for the 1st track played. I intend to look into it, this has nothing to do with the radio art script, but may explain the upplay issue above. As for mixing artist and title, I have no idea what could do this...

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

distler commented 24 days ago

The content you are editing has changed. Please try again.

Also, I suppose it would be good to test that this all works with radio stations which have in-band metadata, e.g.:

[radio Radio Paradise]
url = http://stream-uk1.radioparadise.com/mp3-192
artUrl = http://www.radioparadise.com/graphics/fb_logo.png
metaScript = /usr/local/bin/rp_meta.rb
#!/usr/bin/ruby
require 'open-uri'
require 'nokogiri'
require 'json'

doc = Nokogiri::HTML(open('http://radioparadise.com/xml/now.xml'))
song_end = Time.at(doc.at('refresh_time').content.to_i)
metadata ={'title'  => doc.at('title').content,
           'artist' => doc.at('artist').content,
           'artUrl' => doc.at('coverart').content,
           'reload' => (song_end - Time.now + 1).to_i}
puts JSON.generate(metadata)
Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

serverbaboon commented 24 days ago

The content you are editing has changed. Please try again.

@distler My PI does not have Ruby installed so using Python as I am trying to learn it, I am afraid that learning Ruby on top of Python and also a little French (Metadata) could actually cause important brain function to shutdown. :-). Hadn't realised that Radio Paradise also published the timings, that would have saved some pain. Found FIP electro station does provide constant metadata, however may switch to the Radio Paradise testing.

@medoc92
Was really meaning that the script implementer should take account, but defensive programming it good. I also tried Bubble DS and the that showed the same title/artist issue, but I have given up on Bubble as they are falling behind the times. I will see if I can raise it with the Kazoo developers

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

distler commented 24 days ago

The content you are editing has changed. Please try again.

My PI does not have Ruby installed...

sudo apt-get update
sudo apt-get install ruby ruby-json

Not that I don't like the idea of someone rewriting these in Python, but being able to compare the output with the (known to work) Ruby version might prove useful.

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

serverbaboon commented 24 days ago edited

The content you are editing has changed. Please try again.

mmm ok.

I have had string issues before with Android not liking a url string but windows was ok, Turned out that the Linn Radio art urls needed some spaces converting to %20 before Android would accept the url.

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

serverbaboon commented 24 days ago

The content you are editing has changed. Please try again.

No difference with the Ruby version, I used the FiP Electro station and same symptoms. I will try and get Kazoo to produce some logs. Think it might be charset/string related going off a previous issue but not sure.

http://direct.fipradio.fr/live/fip-webradio8.mp3
http://www.fipradio.fr/livemeta/74

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

serverbaboon commented 24 days ago edited

The content you are editing has changed. Please try again.

Regarding the -ve or 0 value reload times the FIP meta data has the next track details listed, so amended my script as below, I have shoved a couple more variables than necessary as I am still trying to work out what to do with the FIP Paris variable metadata with multiple "levels" and deal with a couple of error conditions.

(nothing really to do with the Kazoo issue though)

Anyway the current playing track is '3' and the next track is '4'

#!/usr/bin/python

# Metadata URL is JSON data with the previous three tracks, the current track and
# the next track, to avoid -ve reload times also get the next track and use that if
# necessary.

import urllib2 , json , time

FipUrl = 'http://www.fipradio.fr/livemeta/74'
StreamInfo = urllib2.urlopen ( FipUrl )

try: StreamData = json.loads  ( str ( StreamInfo.read() ) )
except: StreamData = None

# print json.dumps ( StreamData , indent=4)

MetaIndex = len ( StreamData ["levels"] ) - 1
TrackIndex = StreamData ["levels"][MetaIndex]["position"]
TrackId = StreamData ["levels"][MetaIndex]["items"][TrackIndex]

# Get Details of Next Track if in case reload time is < 0
NextTrackId = StreamData ["levels"][MetaIndex]["items"][TrackIndex+1]


if 'steps' in StreamData:
  if 'visual' in StreamData ["steps"][TrackId]:
    TimeNow =  int(time.time())
    EndTime = StreamData ["steps"][TrackId]["end"]
    if EndTime > TimeNow:
      ImageUrl = StreamData ["steps"][TrackId]["visual"]
      Title = StreamData ["steps"][TrackId]["title"]
      Performers = StreamData ["steps"][TrackId]["performers"]
      ReloadTime = EndTime - TimeNow
    else:
      ImageUrl = StreamData ["steps"][NextTrackId]["visual"]
      Title = StreamData ["steps"][NextTrackId]["title"]
      Performers = StreamData ["steps"][NextTrackId]["performers"]
      EndTime = StreamData ["steps"][NextTrackId]["end"]
      ReloadTime = EndTime - TimeNow

  MetaData = {"title":Title,"artist":Performers,"artUrl":ImageUrl,"reload":ReloadTime }
  print json.dumps (MetaData)

else:
  MetaData = {"title":"FIPS Electro","artist":"None","artUrl":"","reload":"" }
  print json.dumps (MetaData)


Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

serverbaboon commented 20 days ago edited

The content you are editing has changed. Please try again.

Ignore the above, it actually relies to much on someone being consistent in the way they publish their metadata. It seems to be foolish to display the last three tracks, the current playing track and the next track to then for periods of the day not bother updating the next track.

Infos non disponibles....groan.

backup to looping or using position '3' and adding 15 for the reload time.

WIll try and contact Linn see if they will look at it, there was a recent fix to Kazoo that looks suspicious, they at least might tell me how to generate the logs correctly as they are not generating for me.

They fixed this in a recent update and my older working Windows does not have the fix.
"Fixed artist label not showing when artist and album are named the same"

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

serverbaboon commented 19 days ago

The content you are editing has changed. Please try again.

Definitely an issue with the latest version, I have just updated a working windows version to the latest version in the Windows App Store and it has now stopped working correctly. So if you haven't already updated to the June Release 4.11.229.0 (andriod ) or 4.11.228.0 (IOS) then DON'T.

I have emailed Linn from inside the Kazoo Android Application to see if they will look at this.

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

serverbaboon commented 17 days ago

The content you are editing has changed. Please try again.

I have another Radio station where this no artwork, should I pass back a null value or perhaps the station logo address (from the conf file) ?

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview

Owner

medoc92 commented 17 days ago

The content you are editing has changed. Please try again.

I think that returning an empty string should work. Upmpdcli will then use the station static art automatically.

Select a saved reply

The content you are editing has changed. Please try again.

Attach files by dragging & dropping, selecting them, or pasting from the clipboard. Uploading your files… We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP. Attaching documents requires write permission to this repository. with a PNG, GIF, or JPG. We don’t support that file type. with a PNG, GIF, or JPG. Yowza, that’s a big file. with a file smaller than 10MB. This file is empty. with a file that’s not empty. This file is hidden. with another file. Something went really wrong, and we can’t process that file.

Nothing to preview