MusicBrainz Picard interaction with Spotify

Dear all,

I am new in the MusicBrainz community, so I would like to make sure this is not a commercial.

After using Spotify for more than a year, I am back buying CDs again for different reasons, including quality of sound and real “ownership” of the medium. Still, I am using Spotify Premium to listen to albums before buying them.

Anyhow, my question is as regards Picard/MusicBrainz interaction with Spotify. Spotify offers a rich API in Java to query Spotify database. Could there be any interaction of Picard with Spotify to help tagging?

Addition : I found this official API in Python

Using the API requires agreement from Spotify company, and this could be the problem.

Do you think any interaction with Spotify would be interesting? If this was discussed before, please point me to the relevant discussions.

Kind regards,
KellogsBrainz

Do you have an idea what this interaction would look like? After all Picard is a tagging application, and you can’t tag Spotify. What would you like this interaction to do for you?

I am not saying this is a bad idea, and in fact it is quite interesting. But it would help if there was a clearer idea of what this would look like.

1 Like

Brainstorming:

If you cannot find any information about a CD in MusicBrainz and the CD is listen in Spotify:

  1. Launch Spotify UI (for example in GNU/Linux) and connect to your Spotify account.
  2. Browse Spotify until you find the album. Then right-click : “Copy Spotify URI”.

Example URI is in the form of: spotify:album:4EG6O0FseOD53hZ4B2CosR
The URI can be used to fetch all information from Spotify:


it seems possible to fetch all information from Spotify including tracks, lenght, etc …

Maybe this information could be used as a starting point to add a new release in Picard/MusicBrainz.

1 Like

I think a more interesting use of Spotify data would be to walk through their catalog and MB to look for releases that are unlinked to their Spotify counterparts, then generate a report detailing probable matches.

1 Like

Whaoo. Could be very interesting. But IMHO, I doubt this would be legal to fetch all data from Spotify and the company will probably not allow it.

On the converse, focusing on a single CD release makes sens if you have a Spotify account and want to buy the CD to rip it (which is my case).

By the way, Discogs offers the same kind of API:

Discogs tracks are sometimes poor quality and can only be used as a starting point. I am unsure whether it should be done server-side or client-side:

So a feature could be to use Discogs or Spotify URI as a starting point within MusicBrainz server when creating a new release (which would require Perl API). If you enter an URI, a message could ask you whether you wan to use Discogs or Spotify information as a starting point for a new release.

Legally, nothing can stop the community from registering unique identifiers in Spotify.

@CyberSkull

Finaly, after quick analysis I agree with you.

MusicBrainz server already offers the ability to link to Spotify. Right-click on an album in Spotify and select “Copy Album Link feature”. Then paste the link to Musicbrainz URL field in a release.

Example in Kate Bush album (notice the “Stream at Spotify” right below link):

This offers room for development of a small plugin for Picard and I will have a try for proof-of-concept purpose. The right place for such a feature should be server-side.

Well, Spotify are one of our supporters, so we could always ask.

1 Like

Thank for your replies. Brainstorming the web, I found:
https://bitbucket.org/dotcs/cueonthespot/src

The tools seems to be able to generate a cuesheet using Spotify.

So what is the next step when a cuesheet is generated?
Do I need to use “CD stub import”?

Note that, in addition to the links directly in MusicBrainz, there is also mbspotify which might be useful for stuff like this:


This is what CritiqueBrainz is using for its Spotify links. Unfortunately it doesn’t take actual links in MB into account, but OTOH, it increases coverage by doing automated matching. Most of the time, this will probably result in what you want, but not always.

I think the mbspotify database/dataset could also be used to make a report similar to what @CyberSkull suggested.

Since Spotify doesn’t distribute physical CDs, having DiscIDs doesn’t make sense, IMHO, so not sure what you’d use cuesheets or CD stub reporting for.

If you want to import Spotify data into MusicBrainz, you will probably want to look into release editor seeding. (Note that this should be done by a human. Machine-assisted data entry is fine, but we generally frown upon fully automated data imports.)

1 Like

For clarification, here are my needs according to current process:

  • Listen to Spotify to look for artists and albums. Buy CDs at low cost on Internet for quality (WAVE->FLAC) and ownership issues.
  • insert original CD and query Musicbrainz using GNU/Linux SoundJuicer. Most of the time CD is listed. If CD is not listed in MusicBrainz, select “Open MusicBrainz” and look for a release in MusicBrainz UI. This will attach disc IDs automatically if the release exists in MusicBrainz.
  • When creating a new release : after entering Release name, artist name in MusicBrainz UI (nothing automatic), I run into page 2 track list. At this point I would like to be able to query alternative data sources, including Spotify and Discogs.
  • If this is done in MusicBrainz server-side, “fine”. But on the contrary, I would like to be able to use a third party tool to query track list. Copy track list to clipboard and past it using “Track parser” button.

After study, I am not sure whether Picard is the right place for development. When a CD is not found, most of time it is present in MusicBrainz as a release without disc ID.

Do you think you could use Spotify and Discogs link using server-side logic to query track list when nothing is available in MusicBrainz? I don’t know Perl and do not intend to learn it, so I cannot work on such a feature.

Edit:
This Python script does the job:

import spotipy
sp = spotipy.Spotify()
sp.trace = True

results = sp.album_tracks('5NKTuBLCYhN0OwqFiGdXd1', limit=50, offset=0)
for item in results['items']:
    print item['track_number'].__str__() + ' ' + item['name']

Results in:

1 Moving
2 The Saxophone Song
3 Strange Phenomena
4 Kite
5 The Man With The Child In His Eyes
6 Wuthering Heights
7 James And The Cold Gun
8 Feel It
9 Oh To Be In Love
10 L’Amour Looks Something Like You
11 Them Heavy People
12 Room For The Life
13 The Kick Inside

Would it be possible add this kind of feature server side when no release is available and Spotify URL is present?

1 Like

2 posts were split to a new topic: Importing Soundcloud recordings

Replying to myself:

This Perl library does the job:

use WWW::Spotify;
my $spotify = WWW::Spotify->new();
my $result;
$result = $spotify->albums_tracks( ‘6akEvsycLGftJxYudPjmqK’,
{
limit => 1,
offset => 1

}
);

Licence is free: This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

I would love to see that kind of feature in MusicBrainz when no release is available.

I userscript to import Spotify releases have been suggested, for instance at https://github.com/murdos/musicbrainz-userscripts/issues/108