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.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Spotify

Post by krambriw »

Hello, happy it worked for you!
I added the "Tabulator" simulation events to the Spotify to so I can tab between the playlists and songs.
Can you explain more what you did? Is this something that I could improve the plugin with?

Best regards, Walter
Siernan
Posts: 6
Joined: Mon Jan 18, 2010 7:38 pm

Re: Spotify

Post by Siernan »

I didn't find any way to switch between the playlist and songlist, if I start to play a playlist and I want to hear the 10th song in that playlist I press "forward" on my remote controller (I have copied the macro Forward -> Tabulator) and the "marker" move to the songlist.

So when I press forward on my remote it uses the macro Forward - Tabulator and if I press rewind it uses the macro Rewind- Alt+Tabulator. That way I can switch between playist, songlist and the search field. I was thinking of maybe make a macro that enables the onscreen keyboard so that I can search for songs using the remote.

One more thing that would bee good is if was possible to via a button add a song to the playlist queue, so if I'm making a playlist for a party I can just click on the songs I want to add and the will be sent to the "Play queue". I don't know if it's possible but it would be really nice to have that function :-)

This is my Spotify configuration:
tab.JPG
tab.JPG (21.88 KiB) Viewed 9600 times
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Spotify

Post by krambriw »

The main functionality of the Spotify plugin is based on the api provided by the pytify.py interface

Some other functions where it could be made "safe" (enough predictable and reliable), I have used win32com.client (like using SendKeys for some functions)

This is however not (my) preferred way because it is easy to "get lost" if you don't have a good reference point that you always can start from. Besides, it disturbs, or you can disturb the functionality, by normal use of your computer. So I have kept the usage of this at a minimum level. My original requirement was also to make the "thing" possible to control without need for looking at the PC screen

If you have dedicated PC for Spotify + EG it is always possible to add your own python scripts for various needs

Checking specifically for a solution to the features you asked for, I came out with nothing :cry:

- retrieve the picture of the album (I have no idea how to retrieve the picture, the study of the web page source did not help me and I couldn't find that Spotify stores it locally somewhere either)

- add to play queue (The problem is I didn't find a reliable way to set focus on the current track which would be needed to make the next key commands (right mouse click, down two times and enter)

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

Re: Spotify

Post by krambriw »

The new version now also has actions for tabulators (forward/back)

Best regards, Walter
hanspettersson
Posts: 42
Joined: Sat Feb 20, 2010 2:42 pm

Re: Spotify

Post by hanspettersson »

Jostein wrote:
Maby one that will update also when change is done from Spotify.

Best regards, Jostein.
Anyone got a solution for this?
prostetnic
Posts: 28
Joined: Fri Apr 18, 2008 6:52 pm
Location: Sweden

Re: Spotify

Post by prostetnic »

I just started to use this plug-in, it┬┤s great so thanks a lot Walter. But I have a problem, it only works if I have Spotify open before I start EG. If I start EG before I start spotify only Terminate and Start command works properly. The minimize and stop playing only minimizes but doesn't stop playback, show and start playing command only shows etc.

Is this a common problem or is it only me?
I have the following setup.
Win 7 ultimate (32)
EG 0.3.7.r1462
Spotify plugin 1.0.7
Spotify 0.4.8.255
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Spotify

Post by krambriw »

Yes, you are correct. I think Spotify changed something in there GUI. This feature uses a windows function to emulate keystrokes and it is not my favourite for maintenace of course since a simple change in the GUI will break the function.

To fix it, I have added an additional tab command to the action used in "Go to playlists tree view and start playing the last one" and now it works ok I think.

When you start EG and want Spotify to be started as well, just add the action "Start Spotify" to the autostart folder

Also added actions for Up/Down to easy navigation in tree and playlists

Download new version from first post

Best regards, Walter
hanspettersson
Posts: 42
Joined: Sat Feb 20, 2010 2:42 pm

Re: Spotify

Post by hanspettersson »

Can I get the info about the "Album art" from spotify?
Jostein
Experienced User
Posts: 108
Joined: Sun Feb 15, 2009 12:59 pm

Re: Spotify

Post by Jostein »

Hi.

Maybe someone are intrested to know how to get the fanart from spotify to a .jpg file.

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1462">
    <Macro Name="Fanart Spotify" Expanded="True">
        <Action>
            Window.FindWindow(u'spotify.exe', None, u'SpotifyMainWindow', None, None, None, False, 0.0, 0)
        </Action>
        <Action>
            Window.BringToFront()
        </Action>
        <Action>
            EventGhost.PythonScript(u'import ImageGrab\nbox = (1,745,233,980)\nImageGrab.grab().crop(box).save("c:\\Spotify playing.jpg", "JPEG")\n')
        </Action>
    </Macro>
</EventGhost>
Not the best way to do it but it works and saves the file Spotify playing.jpg to C:\.

I run it on screen resolution 1920 x 1080 with the windows xp taskbar doubled. IF you have a diferent resolution you need to change the pixel map for the imagegrab in the phyton script.

Regards Jostein
GalnastAvAlla
Posts: 2
Joined: Sat Mar 05, 2011 10:47 pm

Re: Spotify

Post by GalnastAvAlla »

Hi guys!

First I'd like to thank your for your effort in this awesome plugin!
I'm using my Philips sru 8015 to control my HTPC, with an old "xbox dvd kit" ir receiver.

Now, my problem is that spotify wont play or change songs.
I can move selection using the tabulation, up and down, just everything but the most important works :P
In EG when i choose to run play or next track, nothing happens either.

So, remote is working cause in the log it says (for example):

XBCDRC.PLAY
Play
XBMCRepeat #2: Play
Play
Spotify: Play
Spotify running! Not playing anything...

And Spotify doesn't respond.
Tried to activate context folder, inactivate xbmc's folder etc.

The strange thing is, when I first started to add the macros/actions, play/pause and next song, worked.
It just didn't work when everything was done, deleted it and tried again but with no luck :S.

The problem seems to be the plugin or Spotify itself, do you have any idea??

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

Re: Spotify

Post by krambriw »

Hello,

Difficult to say, the plugin works here for me (without XBMC then because I do not use it). It might be an application conflict issue maybe.

Try to isolate the problem. Try to make it work again with Spotify only

Best regards, Walter
GalnastAvAlla
Posts: 2
Joined: Sat Mar 05, 2011 10:47 pm

Re: Spotify

Post by GalnastAvAlla »

I got it to work..
Erased everything and started over..
The most annoying thing right now is that I can't play selected song.
I can go up/down etc but there's no macro for select/play (like the action of "enter" on the keyboard)??
Regular play doesn't work.
I must start a song with the mouse or KB.

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

Re: Spotify

Post by krambriw »

Yes, I also had to solve this in a special way. See the picture, create a macro and add the items in similar way. Maybe you want to have another button on your remote that triggers "enter"

Best regards, Walter
Image1.jpg
Image1.jpg (3.62 KiB) Viewed 8808 times
zkab
Posts: 17
Joined: Tue Apr 26, 2011 5:43 pm

Re: Spotify

Post by zkab »

Volume up/down changes master volume for the PC instead of Spotify's internal volume level.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Spotify

Post by krambriw »

Hi, thanks for the suggestion,

- Added new actions for Volume Up/Down for Spotify volume control
- Added also an action to emulate the enter/return key

New version uploaded, see first post

Best regards, Walter
Post Reply