beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.97k stars 1.83k forks source link

Get audio features from spotify #3578

Closed flovanc closed 4 years ago

flovanc commented 4 years ago

hello, i'm a Home DJ who use beets for tag music with mostly beatport plugin and thanks for this great feature .

Since i have discover http://www.playlistmachinery.com/ i use these tools for adding tag like Genre, Energy, Danceability and Valence in the comment section of id3 for help me to make smooth playlist for my DJ software "traktor"

for do this i ..

needless to say it takes a very long time , so I'm looking for a way to automate everything.

is anyone interested in this and would like to help me implement this with the help of the spotify API ?

https://developer.spotify.com/documentation/web-api/reference/tracks/get-audio-features/

FLO

sampsyo commented 4 years ago

Hi! Have you seen the AcousticBrainz plugin that ships with beets? It provides another (open-source) way to get these acoustic metrics.

flovanc commented 4 years ago

yes it only works with musicbrainz. But in my case I use 100% the beatport plugin and forbid access to musicbrainz, because they are new releases of electronic music from beatport.

sampsyo commented 4 years ago

Aha, that's too bad. But it looks like the Spotify API there requires a Spotify ID—do your files have that?

Laski commented 4 years ago

@flovanc if your files don't have an Spotify ID you can probably import or adapt the code from https://github.com/beetbox/beets/blob/master/beetsplug/spotify.py in order to get the IDs first.

P.S: Just discovered all the data that is available in the Spotify API, thanks! Now I'm looking forward to having an automated way to import that data into my library too. Let me know how can I help you.

flovanc commented 4 years ago

No i don't have spotify ID inside my files because the use of beatport plugin .

But i make a import with the spotify plugin and "mb tag" are updated with spotify ID.

flovanc commented 4 years ago

@Laski thanks for the help, you should know that my programming level is close to zero. I am already happy to be able to install beets and configure it.

But I am relatively curious and I discovered spotipy

https://spotipy.readthedocs.io/en/2.12.0/

Can be that can be useful to us

Flo

rhlahuja commented 4 years ago

I implemented the Spotify plugin and can help add these audio features. Since it'll require an extra API call per track, perhaps we should separate this into a subcommand rather than grab this additional metadata by default on beet import?

flovanc commented 4 years ago

Sounds like a good idea to me. is there the possibility to keep the initial ID coming from (musicbrainz, plugin:discogs, plugin:beatport) to allow the use of plugin as mbsync (in my case use of bpsync) in the future? And where to add these "audio feature"?

rhlahuja commented 4 years ago

Hmm that might be possible if we add separate database fields for Spotify IDs, similar to those added for Discogs. Perhaps @sampsyo or someone else may have a better suggestion.

And like the AcousticBrainz plugin, I was thinking these audio features would be stored as item-level attributes.

sampsyo commented 4 years ago

Sure! Storing the Spotify ID in a flexible attribute seems like a perfectly good idea.

flovanc commented 4 years ago

Hello, I'm the only one interested in this feature. Unfortunately my lack of coding experience prevents me from doing anything, but I thought it would have interested more people.

Flo

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.