Qobuz importer script

Do we have a script that will import a release into MB?

There’s one in murdos’ repository: https://github.com/murdos/musicbrainz-userscripts/raw/master/qobuz_importer.user.js
I’m not sure whether it still works though.

Nope, it doesn’t. Thanks though…I was hoping another might be available since I was thinking of buying hi-res music by track instead of whole albums.

Nope. Broken. There’s no public Qobuz API either, so the only hope to even know 100% if you have the correct matching releases to other services is if they have the barcode in the URL, which they sometimes do. There is an API, but unfortunately, you have to be a paying member to Qobuz to use it.

1 Like

There is an API, but unfortunately, you have to be a paying member to Qobuz to use it.

If you just need album information, you don’t need to have an account, just an “app ID”. It’s possible to find one of Qobuz’ own app ID by inspecting the network requests happening on open.qobuz.com album pages. The one used there hasn’t changed for several years.

3 Likes

I was only going off what another editor told me that has access to the API. I can’t even find where the API is or how to access it. The only one I can find by a search appears to not even exist anymore.

Some pointers for anyone interested in creating a new Qobuz importer or fixing the existing one, the Qobuz provider in Enhanced Cover Art Uploads contains some code to get album metadata from their API. Unfortunately it’s only accessible from an IP in a country where the release is available. It also appears that release countries can be extracted from the alternate URLs present in the HTML <head> element on www.qobuz.com pages (document.querySelectorAll('head > link[rel="alternate"]')): fy3ginyk9q1wa lists only US, AU, and NZ; whereas 0825646184729 (same album, different ID) lists a whole bunch of European countries, but not US, AU, or NZ.

6 Likes

I still don’t get it, but if anyone can just find a way to get barcodes the rest is easy.

2 Likes

anyone else using the qobuz api to find the barcode? I’m wondering why sometimes the api gives an 404 error when giving it a valid release id.

for example:

when using the api call it returns 404:
https://www.qobuz.com/api.json/0.2/album/get?app_id=***&album_id=a7fd1jk60x1gb

is there an alternate method to find the upc in these cases? I usually look on other digital distribution sites when this happens and try to match the release. but in this particular case this is the only digital platform I could find which features this release with the Glassnote label.

Are you specifying a region in your API requests?
This release is only available in CA, MX and US, so the API might 404 for a different (implicitly) requested region.
(I haven’t used their API nor do I have a key, so I can’t confirm.)

2 Likes

to my knowledge there is no way to give the api a region parameter. but you bring up a good point. I haven’t thought of it that maybe the api is discriminating the region of your IP. I don’t live in one of these countries so that might be the issue. I will try it again with a VPN.

edit: nope, still the same issue even with an IP from one of these countries.

edit2:
never mind, the browser cache was at fault here. so it loaded the previous 404 result even with a valid IP. flushed the cache and voila, it works now with a VPN.

3 Likes

figured it out. when using a valid IP and calling the streaming site for this album release, so in this case

https://open.qobuz.com/album/a7fd1jk60x1gb

you can view the api result in the network monitor of your browser. in the case of Firefox, open the network monitor with Ctrl+Shift+E before loading the page. after loading it, look for the get?album-line, click on it and you get the api result in the “answer” tab.

and there it is:
upc “0044003202153”

weirdly enough, it doesn’t work when loading the api call in the browser itself. but we have a solution now.

edit:
realized that the cache was at fault here. so the api call also works when using it directly with a valid IP for the particular release. just make sure that you flush the browser cache beforehand or it will still show you the previous error result from the invalid IP.

6 Likes

nice, based on that - my browser has come up with an app ID of 712109809

so this one liner is working for me to get the UPC

$ curl -s 'https://www.qobuz.com/api.json/0.2/album/get?album_id=g92m3z1ag5gva' -H 'X-App-Id: 712109809' | jq -r '.upc'
3770004998838
1 Like

Is their a Qobuz script for Tampermonkey/Violentmonkey?

No, unfortunately there is not one specifically. I use Yambs (https://yambs.erat.org/) as an importer. Qobuz releases are almost always on other services that have scripts, especially HDtracks. If you follow the conversation immediately above it will tell you the UPC for Qobuz. It works.

1 Like

Thanks for pointing out the API! I’ve updated yambs to use it to seed barcodes for Qobuz albums. Please let me know if you notice any problems (ideally via Issues - derat/yambs - Codeberg.org). :slight_smile:

3 Likes

Working great for me.

1 Like