Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 5 of 5
  1. #1

    JSON request for bitrate of current track

    Hello,

    Briefly, I'm Marcus and I read slimdevices forum since I discovered LMS for 3 or 4 years now.
    I always find answers to my questions by reading but now I am really stuck... :/

    Maybe because I am not really good to programming language (or maybe I'm not good to search ^^)

    I only want to display the bitrate of current track in my conky...

    I tried with PyLMS, with curl request in JSON, wget...

    So, I can display lots of thing but not this "parameter"... I'm sure there is a real easy way but I can not find it by myself so I post this thread to get some help.

    Many thanks for your help.

    Marcus

  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,118

    JSON request for bitrate of current track

    > I only want to display the bitrate of current track in my conky...

    The status query is what you're looking for:

    http://htmlpreview.github.io/?https:...pi.html#status

    status - 1 tags:r

    Would give you the bitrate for the currently playing track (together
    with more information about it).

    --

    Michael

  3. #3
    Many thanks Michael!

    So now, I need to extract only bitrate.

    I am using PyLMS because I do not understand how to use JSON command with curl with LMS...

    I will put my founding when I find it ^^

  4. #4
    Senior Member
    Join Date
    Aug 2012
    Location
    Austria
    Posts
    778
    Have a look at this script, it contains all the pieces you need.

  5. #5
    With PyLMS,
    Code:
    s = sq.request("status - 1 tags:r") 
    print((s.split("bitrate:"))[1].split("buttons")[0])
    And voilÓ!

    Thank you Michael, I searched for that since a lot of days...

    Marcus

    Edit: Thank you to Roland and with equalizer!! I will give it a try soon!
    Last edited by MarcusDjizeuss; 2018-12-03 at 15:36.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •