Anyone willing to make a new Spotify plugin?

Questions and comments specific to a particular plugin should go here.
Post Reply
Septik
Posts: 39
Joined: Sun Feb 15, 2015 1:29 pm

Anyone willing to make a new Spotify plugin?

Post by Septik » Fri Aug 26, 2016 5:08 pm

Hello!

A long while ago, the Spotify plugin for EventGhost stopped working. I did some research and found this thread, where the developer says he has stopped working on it since the API he was using no longer works. He mentions it's possible to use a different music player (with Spotify support), and I'm sure this solution will work for some people, but personally I'd very much like to keep using Spotify. This because it has features like Discover Weekly, (the newly released) Release Radar and remote controls from mobile.

It's much to ask, I know. Hoping to reach some developer superhero that is currently unaware of the Spotify plugin being broken!

Thanks for your time.

Jefman
Posts: 4
Joined: Tue Nov 26, 2013 1:09 pm

Re: Anyone willing to make a new Spotify plugin?

Post by Jefman » Fri Aug 26, 2016 7:56 pm

I don't know much about EventGhost, but Spotify do have a open API:

https://developer.spotify.com/web-api/

Septik
Posts: 39
Joined: Sun Feb 15, 2015 1:29 pm

Re: Anyone willing to make a new Spotify plugin?

Post by Septik » Fri Aug 26, 2016 9:52 pm

Okay, I actually made some progress! My biggest issue with the now defect plugin has been that I'm not able to retrieve the currently playing track. I found a workaround way to do that. The solution was found in one of Pako's posts, like so many times before! So thanks, Pako.

Basically, I just do a Find Window to find the Spotify window, and then I do: spotVar = eg.WinApi.GetWindowText(eg.result[0]) - before displaying spotVar with ShowOSD. This works perfectly with the current version of Spotify, as the window title is always the (artist name and) song playing.

Right now, with the outdated Spotify plugin for EventGhost, I am able to skip tracks (both previous and next track actions work). So I have assigned keyboard shortcuts for this, and use ShowOSD to display the song name each time I skip. Back when the plugin worked, I also had a shortcut for pausing. When pressed, ShowOSD would display "ll Paused". The play/pause action returns an error, however, seemingly due to changes in the Spotify API. For now I'm happy with being able to display the artist/song name at least.

User avatar
kgschlosser
Site Admin
Posts: 5508
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Anyone willing to make a new Spotify plugin?

Post by kgschlosser » Sat Aug 27, 2016 6:27 am

i'll tell you what. this is something i can take on. going to take me a while to develop for ya though. so you have to be patient. and read this thread for updates from me. i have another coding project i am currently finishing up on and i have one other i have to do up but is a smaller less involved project. but after that i can work on this for ya.
If you like the work I have been doing then feel free to Image

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Anyone willing to make a new Spotify plugin?

Post by krambriw » Sat Aug 27, 2016 7:41 am

Please feel free to use/modify/whatever the Spotify plugin i wrote earlier. For me the further development of this plugin has ended, I am done. Myself I am using SqeeuzeBoxServer 8obvio with my other plugin) controlling both hard and soft players. Since you can play Spotify with those, I have a solution that fits my needs.

Anyway, this is regarding coding a plugin for Spotify:

For the current plugin I use a python library (pytify) that worked pretty ok for a while in combination with the win32gui/win32api stuff to navigate & provide support for additional features. Using this technic is however unreliable & complicated and very likely to break sooner or later (sometimes it was enough when the Spotify desktop application got updated and that happens rather frequently)

There are several ways to interact with Spotify, where the post popular right now is the Web API. The Web API offers a lot of features, but not playback of full tracks. Therefore, it doesn't matter if you're using Python, Java, C#, or whatever language, you'll still not be able to play music using the Web API. There are however mobile SDKs that support playback, available for both Android and iOS. You can however play preview tracks (30 seconds) using the Web API. Check out spotipy, it's one of the better Python clients, if not the best. There are other ways to interact directly with the Spotify desktop application, but none that are supported officially by Spotify, and I can't recommend them since they may stop working at any point in time.

User avatar
kgschlosser
Site Admin
Posts: 5508
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Anyone willing to make a new Spotify plugin?

Post by kgschlosser » Mon Aug 29, 2016 12:46 am

ahh ok i see, i didn't know the web API doesn't allow for playing a track. that's almost pointless then. and i also looked into the spotipy lib. and What you are telling me is that the player API gets changed all the time and breaks anything that relies on it. well I already have a plugin where the manufacturer likes to do the same thing and it quite irritating. and I don't believe i want to have another maintenance nightmare caused by some other party.

so unfortunately I think I am going pass on this one then. i don't wat to have to keep on rewriting code to keep something running.
If you like the work I have been doing then feel free to Image

jachin99
Experienced User
Posts: 651
Joined: Sat Feb 13, 2016 8:39 pm

Re: Anyone willing to make a new Spotify plugin?

Post by jachin99 » Mon Aug 29, 2016 1:23 am

Why not just use the emulate keystrokes plugin. I created a macro that only activates my Spotify macros when I launch the program. From here, I just remap the forward, back, and pause, and play keys to my MCE remote. I have a certain key combo on my keyboard that launches Spotify so I can use it without ever turning on a screen. There is also the option to subscribe to Spotify premium, and play one instance of Spotify on a phone or tablet to another instance of Spotify on a PC, or stereo reciver ( I have a Yamaha AVR with a Spotify app built in) There might not even be a need for a Spotify plugin.

Post Reply