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.

4 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.

7 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

try this yambs (erat.org)

Thanks for this. I just wanted to add that for those having some difficulty I found that I didnā€™t have an ā€˜Answersā€™ tab in Firefox, rather a ā€˜Responsesā€™ tab. Maybe this is a localization issue? Iā€™m in Australia and it might be an English (Australian/UK) thing.

I also found that for me there are two ā€œget?album_id=(ā€¦etcā€¦)ā€ request lines, and the one I needed was the one which has in its ā€˜Initiatorā€™ column containing ā€œmain.js?:7(fetch)ā€. I had a second entry with just ā€œfetchā€ that I took some time wandering through that wondering why the Responses section had no data until I noticed the other entry above it and found the UPC data in there.