Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Spotify (api is partially broken)

Questions and comments specific to a particular plugin should go here.
Post Reply
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Spotify

Post by krambriw »

That looks really nice!

You know, I use a library for the api and the fanart is not supported there but if we find a way how to grab it and send it, for sure it would be nice. I am not an expert on the Command Fusion plugin but using serial was easy it showed.

Are you good in using the guiDesigner? Could you do me a favour and just make a simple project with one page presenting what is sent with serial? No fancy stuff needed, just that simple feature? I have guiDesigner and could open the simple project just to have a glance how this is done.

Best regards, Walter

EDIT: If you look back on page 4 in this thread, there is a method mentioned how the fanart can be captured and saved as jpg. Remains just to find out how we shall send a jpg to the phone
husa550
Posts: 29
Joined: Sun Sep 09, 2012 2:32 pm

Re: Spotify

Post by husa550 »

krambriw wrote:That looks really nice!

You know, I use a library for the api and the fanart is not supported there but if we find a way how to grab it and send it, for sure it would be nice. I am not an expert on the Command Fusion plugin but using serial was easy it showed.

Are you good in using the guiDesigner? Could you do me a favour and just make a simple project with one page presenting what is sent with serial? No fancy stuff needed, just that simple feature? I have guiDesigner and could open the simple project just to have a glance how this is done.

Best regards, Walter

EDIT: If you look back on page 4 in this thread, there is a method mentioned how the fanart can be captured and saved as jpg. Remains just to find out how we shall send a jpg to the phone
I'l make a gui-file for you.
Working all weekend but do it as soon as possible!
Do you want for iphone or ipad?
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Spotify

Post by krambriw »

Thanks m8,
For iPhone would be great! In the mean time I have made a macro that captures the fanart as a jpg based on the code I referred to and it works pretty neat. If you could find out how we could send a jpg file to to Command Fusion, I will include this in an updated plugin.

Best reg Walter
husa550
Posts: 29
Joined: Sun Sep 09, 2012 2:32 pm

Re: Spotify

Post by husa550 »

krambriw wrote:Thanks m8,
For iPhone would be great! In the mean time I have made a macro that captures the fanart as a jpg based on the code I referred to and it works pretty neat. If you could find out how we could send a jpg file to to Command Fusion, I will include this in an updated plugin.

Best reg Walter
Check your PM !
MANswers
Posts: 17
Joined: Sat Apr 13, 2013 4:13 pm

Re: Spotify

Post by MANswers »

Thanks for the spotify plugin. i am using this with eg for iRule. is there any update with new features on this plugin? anyone tried using a gui frontend on their iphone or ipad for feedback and changing tracks or controlling the player?
I am talking about something similar the JRiver Media Player has called the Gizmo that can be used on any device to control the player
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Spotify

Post by krambriw »

Hi, thanks,

I made this plugin almost 4 years ago with great help using the 'pytify' wrapper made by Bjoerge Naess. A re-work could be justified. There has been some interesting movements in terms of python support for Spotify like 'pyspotify' and 'spotimeta'. With those wrappers I believe it would be a rather normal effort to make a new plugin supporting additional feaures like search and look artists. This plugin could then become a real Spotify client built into EG instead of as it is now, EG controlling the Spotify application.

Best regards, Walter
MANswers
Posts: 17
Joined: Sat Apr 13, 2013 4:13 pm

Re: Spotify

Post by MANswers »

Thanks for your reply Walter, are you planning to update anything for this plugin? Spotify is getting pretty famous now around the world and particularly the US. I believe every few weeks more and more users are linking their facebook account with spotify.
opitmalt
Posts: 3
Joined: Wed Oct 02, 2013 5:11 pm

Re: Spotify

Post by opitmalt »

I downloaded the Spotimeta library for getting data from Spotify's metadata API and can now use it to save the coverart of the song currently playing as C:\spotify.png:

Code: Select all

import spotimeta
import urllib2
import urllib
import json
urllib.urlretrieve(json.load(urllib2.urlopen("https://embed.spotify.com/oembed/?url=" + spotimeta.search_track(eg.plugins.MySpotify.GetCurrentArtist() + u' - ' + eg.plugins.MySpotify.GetCurrentTrack())["result"][0]["href"]))['thumbnail_url'].replace("cover","640"), "c:\\spotify.png")
Samme
Posts: 33
Joined: Tue Nov 22, 2011 9:07 am

Re: Spotify

Post by Samme »

Hi Walter!

Do you know if this plugin have stopped working with newer versions of Spotify? Atleast it isn't working for me.

Running the macro "Start Spotify" gives "The directory name is invalid.".

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

Re: Spotify

Post by krambriw »

Hello,
Just tried it here, it works fine to both start, play, stop and terminate Spotify (tried with Vista 32 bit)
Do you run W7 64 bit?

Best R Walter
Samme
Posts: 33
Joined: Tue Nov 22, 2011 9:07 am

Re: Spotify

Post by Samme »

Hi again!

Yes I run W7 64 bits, is that the reason? I have gotten it to work before...
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Spotify

Post by krambriw »

I have the same error when I try it with W7 64 bit...it seems that Spotify is not installed under the normal path like "Program...", instead it is installed under ..\AppData\Roaming\Spotify
At least in my laptop...
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Spotify

Post by krambriw »

You can change the path in the plugin code yourself. Find this section and modify it accordingly

Code: Select all

class StartSpotify(eg.ActionClass):
    name = "Start Spotify"
    description = "Starts Spotify"


    def __call__(self):
        eg.plugins.System.Execute(
            u'C:\\Program Files\\Spotify\\spotify.exe',
            u'',
            0,
            False,
            2,
            u'C:\\Program Files\\Spotify'
        )
        return


Samme
Posts: 33
Joined: Tue Nov 22, 2011 9:07 am

Re: Spotify

Post by Samme »

Thanks a lot Walter!

That fixed it!
leothlon
Experienced User
Posts: 59
Joined: Tue Dec 17, 2013 6:29 pm

Re: Spotify

Post by leothlon »

Is it possible to have the plugin trigger an event when spotify song changes?
I want to send the new information to command fusion or a webpage when it changes instead of having to request the data on set timers all the time (have websockets send out the new data to website rather than updating the page every 10-ish seconds).

same with the code above that alows getting the coverart, i want that to trigger getting the new coverart right away when spotify changes song.
Post Reply