bjarneo / Pytify

A CLI application for controlling Spotify
MIT License
741 stars 40 forks source link

17:18: syntax error: Expected end of line but found unknown token. (-2741) #6

Closed niceperl closed 9 years ago

niceperl commented 9 years ago

I got this error every time I type a number in order to play a song. Example:

What artist / song are you searching for?
> sinatra
#   | Artist                    | Song                           | Album                         
--- | ------------------------- | ------------------------------ | ------------------------------
1.  | Frank Sinatra             | Let It Snow! Let It Snow! Let  | Christmas Songs By Sinatra    
2.  | Frank Sinatra             | Santa Claus Is Comin' to Town  | Christmas Songs By Sinatra   
...
15. | Frank Sinatra             | Have Yourself a Merry Little C | Christmas Songs By Sinatra    
Last five search results:
sinatra

Type song number and press <enter> to play. Press <enter> for new search.
> 1
17:18: syntax error: Expected end of line but found unknown token. (-2741)

Playing: Frank Sinatra - Let It Snow! Let It Snow! Let

I am running cly.py on virtualenv, python 2.7.8 and Mac OS X Yosemite. The song I selected didn't play

bjarneo commented 9 years ago

Seems to be some actionscript error.

I need someone using OS X to look at the problem.

http://stackoverflow.com/questions/2126291/bash-output-as-applescript-list-problems

niceperl commented 9 years ago

After this update, I got a new error:

22:32: syntax error: A identifier can’t go after this identifier. (-2740)

bjarneo commented 9 years ago

Same approach?

niceperl commented 9 years ago

Yes, but now the error message is different

joined commented 9 years ago

It works flawlessly for me, both with Python2 and Python3. What OS X version are you using? EDIT: Now I see, Yosemite. Really strange.

What happens if you type this in the Python REPL:

import subprocess
subprocess.call([
    'osascript',
    '-e',
    'tell app "Spotify" to play track "spotify:track:5amPczcUvAgcWR3iHQj2hu"'
])

?

niceperl commented 9 years ago

OS X Yosemite 10.10.1

joined commented 9 years ago

@niceperl See my updated question. Could you try executing that snippet?

niceperl commented 9 years ago

Sorry, it was my fault. I didn't have installed the spotify app. Perhaps this silly problem could help in the last term to improve the error messages... Thanks!

bjarneo commented 9 years ago

@niceperl No worries. Perhaps we should do a 'is spotify installed' check. Have fun!