None
closed
nobody
None
2019-12-27
2019-12-10
Anonymous
No

Hi,

I have obtained from Qobuz a personal key and according to the release notes I can associate this with the config file somehow. After searching the upmpdcli site I cannot find any more information. Where do I add ( and what syntax / tag name ) these keys?

I have app_id xxxxx.. and app_secret xxxxxxxx.....

Thanks.

Discussion

1 2 > >> (Page 1 of 2)
  • medoc
    medoc
    2019-12-10

    Lucky you :)

    The pair are stored in the upmpdcli configuration file as qobuzappid and qobuzcfvalue.

    qobuzcfvalue is the app_secret, slightly obfuscated, mostly for minimum change in the original module where it was xor'd with the app_id. Of course, this brings no additional security.

    There is a python function in mediaserver/cdplugins/qobuz/api/wap.py to perform the obfuscation (it's named __unset_s4). I just included it in a small Python program to make things easier (attached).

    Run the program as:

    python3 qobuz-obfuscate.py 285473059 47249d0eaefa6bf43a959c09aacdbce8
    

    Where the values shown here are the old appid and secret used by the module (replace with yours).

    You have to store the id and the output of the above in the configuration file as qobuzappid and qobuzcfvalue.

    Depending on your setup, this could be enough (if you're doing this at home or if the device file system is inaccessible).

    If this is not the case (e.g. commercial device with removable sd card), you will have to fetch the secret from a better hidden place when starting up, then add the values to the config (probably concatenating them with the rest), and then start upmpdcli on the completed configuration. The details of this are so dependant on what you are running on that it's no use to got into more detail in general.

     
    Attachments
    • Anonymous
      Anonymous
      2019-12-10

      Cheers. I've ran my two codes through qobuz-obfuscate and added them plus the appropriate login details to upmpdcli.conf. I now get a "login error" on 8Player. Tidal logs in fine which suggests all the SSL, requests, local time, python etc are all OK. I have confirmed my user name and password are valid via the qobuz app. I'm also assured the two codes from qobuz are good.

      This is using upmpdcli 1.4.5 ( on iMX7 ARM )

      My conf is:

      friendlyname=Valve Amp Lounge
      iconpath = /usr/local/share/upmpdcli/icon.png
      openhome=0
      uprclautostart = 1

      qobuzappid = xxxxxxxxx
      qobuzcfvalue = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxQMLUwI=

      qobuzuser = xxxxxxxxxxxxxxxxxxx.co.uk
      qobuzpass = xxxxxxxxxxxxx
      qobuzformatid = 5

      tidaluser = xxxxxxxxxxxx.net
      tidalpass = xxxxxxx
      tidalquality = lossless

      Any ideas?

      Thanks.

       
  • medoc
    medoc
    2019-12-10

    Where exactly do you get this "login error" ? Is this when trying to browse the qobuz section inside the upmpdcli media server.

    If this the case, we'll need to add traces inside the qobuz module to check that the app-id and secret which are actually used are correct. As I don't have an id/secret pair to test with, I am not sure that this stuff was ever used.

     
    • Anonymous
      Anonymous
      2019-12-10

      How about some debug from upmpdcli itself? What would you suggest be the appropriate parameters to add to upmpdcli to dump some debug when I start it?

       
  • medoc
    medoc
    2019-12-10

    Actually, I forgot a debug statement in the module itself, and it prints the decoded app_secret value (called 's4' internally) to stderr.

    So if you take a look at journalctl -u upmpdci, or start upmpdcli on the command line, you should a line like the following in the output when accessing qobuz:

    S4: 47249d0eaefa6bf43a959c09aacdbce8

    (The value here is the one previously used by upmpdcli).

    This will enable you to check that the app_secret is correct.

     
    • Anonymous
      Anonymous
      2019-12-10

      Attached is the debug of Qobuz. I can see Qobuz as a server, Selecting the server I see Discover Catalog, Genres and Favourites. Selecting Favourites I get four folders - Albums, Artists etc. Selecting anyone of these I get a "service login / communication failure".

      In the debug I see no raw s4 string. I've found the spot in raw.py, maybe the current error is causing an exception before that print point?

      There's a few 400 errors surrounding logging in but I've just retested my user and login with an iOS app and they're fine.

      Thanks.

       
      Last edit: Anonymous 2019-12-10
    • Anonymous
      Anonymous
      2019-12-10

      Update: I am now logged in to the point of selecting songs. Turns out I hadn't replaced the old 1.4.2 mediaserver directory. However when i play a song it lasts 1 seconds and skips to the next. Debug below:

      :4:src/avtransport.cxx:426::Set(next)AVTransportURI: next 0 uri http://192.168.1.164:49149/qobuz/track?version=1&trackId=9883170 metadata[A Love Supreme, Pt. I – AcknowledgementJohn Coltrane QuartetJohn Coltrane QuartetJohn Coltrane QuartetJohn Coltrane QuartetA Love SupremeUnknownhttps://static.qobuz.com/images/covers/84/20/0060253742084_600.jpg1http://192.168.1.164:49149/qobuz/track?version=1&trackId=9883170object.item.audioItem.musicTrack]
      :4:src/upmpd.cxx:295::checkContentFormat: supported: audio/mpeg
      :4:src/mpdcli.cxx:766::MPDCli::clearQueue
      :4:src/mpdcli.cxx:639::MPDCli::repeat:0
      :4:src/mpdcli.cxx:653::MPDCli::random:0
      :4:src/mpdcli.cxx:660::MPDCli::single:0
      :4:src/mpdcli.cxx:646::MPDCli::consume:0
      :4:src/mpdcli.cxx:713::MPDCli::insert at :0 uri http://192.168.1.164:49149/qobuz/track?version=1&trackId=9883170
      :4:src/mpdcli.cxx:608::MPDCli::stop
      :4:libupnpp/device/device.cxx:431::UPNP_CONTROL_ACTION_REQUEST: Play. Params: <?xml version="1.0"?>

      0
      1

      :4:src/avtransport.cxx:680::UpMpdAVTransport::playcontrol State: 1 what 1
      :4:src/mpdcli.cxx:580::MPDCli::play(pos=-1)
      :4:src/mediaserver/cdplugins/plgwithslave.cxx:130::PlgWithSlave::translateurl: url /qobuz/track
      :5:src/mediaserver/cdplugins/plgwithslave.cxx:283::PlgWithSlave::get_media_url: /qobuz/track?version=1&trackId=9883170
      CMDTALK: qobuz-app.py: trackuri: [{'path': '/qobuz/track?version=1&trackId=9883170', 'cmdtalk:proc': 'trackuri'}]
      CMDTALK: qobuz-app.py: processmessage: processor raised: [name 'PY3' is not defined]
      Traceback (most recent call last):
      File "/usr/local/share/upmpdcli/cdplugins/pycommon/cmdtalk.py", line 172, in processmessage
      outfields = processor.process(params)
      File "/usr/local/share/upmpdcli/cdplugins/pycommon/cmdtalkplugin.py", line 53, in process
      return self.dispatcher.run(params[prcnmkey], params)
      File "/usr/local/share/upmpdcli/cdplugins/pycommon/cmdtalkplugin.py", line 36, in run
      return func(params)
      File "/usr/local/share/upmpdcli/cdplugins/qobuz/qobuz-app.py", line 122, in trackuri
      media_url = session.get_media_url(trackid, formatid)
      File "/usr/local/share/upmpdcli/cdplugins/qobuz/session.py", line 44, in get_media_url
      format_id = format_id)
      File "/usr/local/share/upmpdcli/cdplugins/qobuz/api/raw.py", line 228, in track_getFileUrl
      if PY3:
      NameError: name 'PY3' is not defined
      :4:src/mediaserver/cdplugins/cmdtalk.cpp:144::CmdTalk: Got empty line
      :2:src/mediaserver/cdplugins/plgwithslave.cxx:292::PlgWithSlave::get_media_url: slave failure
      :2:src/mediaserver/cdplugins/plgwithslave.cxx:154::answer_to_connection: no media_uri for:
      Application reported internal error, closing connection.
      :4:libupnpp/device/device.cxx:431::UPNP_CONTROL_ACTION_REQUEST: GetTransportInfo. Params: <?xml version="1.0"?>

      0

       
      • Anonymous
        Anonymous
        2019-12-10

        PY3 = sys.version > '3' added to raw.py seems to have fixed things. Best thing to do? It plays now, thanks for your help.

         
  • medoc
    medoc
    2019-12-11

    Congratulations on fixing this by yourself ! the PY3 thing was a leftover after removing python2 compatibility code. You can leave it as it is now or just remove the whole thing (remove the if PY3: and just inconditionally run the following line (align it with the rest of the code). The latter is what I did in the update I just pushed to git.

    If you don't mind, I am curious about the backstory of getting an app-id/secret, you can reach me at jf@dockes.org if you think that you can share it (I'll keep it confidential in any case).

     
    • Anonymous
      Anonymous
      2019-12-11

      Cheers. Backstory is my employer knows a person at Qobuz and managed to get a set of keys so I'm allowed to use them for personal use...

      Thanks again.

       
      Last edit: Anonymous 2019-12-11
1 2 > >> (Page 1 of 2)

Cancel   Add attachment