Author Topic: (Version 3.1) Spotify Integration Plugin  (Read 74435 times)

zkhcohen

  • Sr. Member
  • ****
  • Posts: 342
I'm currently working on creating a new Spotify integration plugin using the updated API.
If there's any interest in this project, please let me know what sorts of features you would be interested in having.
---

Update 3.1 (April 11, 2021):

PKCE auth. method now automatically renews tokens when necessary, even between restarts.
General performance improvements.
Bug fixes for network disconnections, refreshing, various other things.

Please test and report issues in this thread.

https://www.mediafire.com/file/rex368art4yr1wh/mb_Spotify-Plugin.zip/file

NOTE: I did notice some artifacting issues and I also noticed that the "Please Click to Authenticate" erroneously appears after a restart. I'm working on resolving these issues.
Last Edit: April 11, 2021, 11:09:08 PM by zkhcohen

awise107

  • Newbie
  • *
  • Posts: 18
This would be awesome to have! Looking forward to updates.

J3man

  • Newbie
  • *
  • Posts: 1
Would be great if possible. Would use for sure.

zkhcohen

  • Sr. Member
  • ****
  • Posts: 342
Just a quick update -

I'm almost done with the first release. Hoping a couple people will be willing to try it out and give me feedback!

t0mekk

  • Newbie
  • *
  • Posts: 2
Just a quick update -

I'm almost done with the first release. Hoping a couple people will be willing to try it out and give me feedback!


awesome idea for plugin! I'll gladly help you mate.

zkhcohen

  • Sr. Member
  • ****
  • Posts: 342
Here's an ALPHA release:

PLEASE SEE BETA LINK IN POST BELOW!


Just extract the contents of the "plugins" folder to your MusicBee Plugins directory.


Here's what it looks like in the panel:





It lets you know if the track, album or artist are already found in your Spotify library. If you click on them, depending on if they're in your library or not, it will either add or remove them from Spotify.

Let me know if you encounter any bugs.


KNOWN ISSUES:


1. Performance issues due to a workaround I implemented because of a bug in the Spotify API. Adding/removing albums is slow. The first track you play after enabling the add-in is slow to load.
2. You have to re-authenticate hourly due to a limitation with the Spotify API. I plan to do this silently in the future.
Last Edit: April 22, 2019, 09:42:21 PM by zkhcohen

zkhcohen

  • Sr. Member
  • ****
  • Posts: 342
Beta 2.0: Improved performance. Removed 500 album restriction. Added automatic prompt to re-authenticate if computer resumes from sleep.

https://www.mediafire.com/file/rex368art4yr1wh/Beta_2.X_mb_Spotify_Plugin.zip/file

Bizy

  • Sr. Member
  • ****
  • Posts: 304
Hello zkhcohen,

Though I don't use Spotify much, if I can integrate it in MB, that would definitely help... ;-)

So I tried your plugin.

And got following message:
"SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data"
(Firefox 66.0.3)

Maybe becoz I'm not a Premium User? 
Or should it work in all cases?

Greetz, b.
Full installer Version 3_4_7805
Portable Editon 3_4_7805 P
OS: Windows 10 Home Edition

fumoretti

  • Newbie
  • *
  • Posts: 2
Amazing work!!!

What is required at minimum to work properly? I mean, I intalled the plugin on my MusicBee (3.2 U3), but on plugin settings the "configure" button does notting when i click on it.

The spotify client software is needed on the computer plus MusicBEE + Plugin?

Thank you for this plugin!

zkhcohen

  • Sr. Member
  • ****
  • Posts: 342

And got following message:
"SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data"
(Firefox 66.0.3)

Maybe becoz I'm not a Premium User? 
Or should it work in all cases?

Greetz, b.

It should work in all cases, regardless of the browser you use. I've had issues using Internet Explorer to reliably authenticate Spotify through their (notably CRAPPY) API. This is what's currently preventing me from allowing it to re-authenticate automatically every hour. It's really annoying...

If you temporarily change your default browser to Chrome and then try to authenticate again, I'd be extremely curious to see if it works.

Alternatively you can copy and paste the link in another browser to see if it works.

Thanks for reporting this!!

zkhcohen

  • Sr. Member
  • ****
  • Posts: 342
Amazing work!!!

What is required at minimum to work properly? I mean, I intalled the plugin on my MusicBee (3.2 U3), but on plugin settings the "configure" button does notting when i click on it.

The spotify client software is needed on the computer plus MusicBEE + Plugin?

Thank you for this plugin!

You actually only need MusicBee and the plugin, not the Spotify client.

Unfortunately this plugin won't work unless you install a newer version of MusicBee.

The most recent version is 3.3.7051 which includes substantial improvements.

https://getmusicbee.com/patches/MusicBee33_Patched.zip

Bizy

  • Sr. Member
  • ****
  • Posts: 304
@zkhcohen:  I tried with Opera and Chrome, and yes, then I can login.  It says 'Ok. This window can be closed now.'
Yet, in the plugin panel, it says:  'No tracks found'.

CORRECTION:  when I play a song of a local playlist, it shows the song and whether it's part of an album in Spotify, if I follow the artist and so on... (and I can change that... add... follow...)

Which is great! 
Yet, I would like to be able to play Spotify playlists:  is that possible?
(I don't see that for now, but I might be overlooking something.)
Last Edit: April 25, 2019, 12:15:49 PM by Bizy
Full installer Version 3_4_7805
Portable Editon 3_4_7805 P
OS: Windows 10 Home Edition

zkhcohen

  • Sr. Member
  • ****
  • Posts: 342
Yet, I would like to be able to play Spotify playlists:  is that possible?
(I don't see that for now, but I might be overlooking something.)

What do you mean by play Spotify playlists?

I could perhaps import playlists from Spotify insofar as you have the same songs in your MusicBee library.

This gave me an interesting idea that I might try to implement going forward.

I'll see what I can do.

Bizy

  • Sr. Member
  • ****
  • Posts: 304
@zkhcohen:  what I mean is:  importing songs that are not in my library, so basically:  streaming Spotify in MB (the present browser plugin doesn't support the Spotifiy media player;  and I don't see a way to export playlists in MB and import them in MB - maybe, there is another way, I don't know).

So:  I would like to be able to scroll through my Spotify playlists and select/play them in MB.
Full installer Version 3_4_7805
Portable Editon 3_4_7805 P
OS: Windows 10 Home Edition

zkhcohen

  • Sr. Member
  • ****
  • Posts: 342
@zkhcohen:  what I mean is:  importing songs that are not in my library, so basically:  streaming Spotify in MB (the present browser plugin doesn't support the Spotifiy media player;  and I don't see a way to export playlists in MB and import them in MB - maybe, there is another way, I don't know).

So:  I would like to be able to scroll through my Spotify playlists and select/play them in MB.

That's not possible using the Spotify API.

It's theoretically possible but would require a lot of 'hacking' to get a usable workaround.