Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spotify.current() throws blocking runtime error if Spotify is not playing #48

Open
Coolisbetter opened this issue Aug 16, 2022 · 2 comments

Comments

@Coolisbetter
Copy link

When running

from SwSpotify import spotify
try:
    title, artist = spotify.current()
except:
    print(f"Song lookup timed out")
    return

I get the below error message. Furthermore, the python script will hang until I send a Ctrl-C keyboard interrupt to the console.

Not sure why my try:except isn't catching the error, also not sure why I have to send Ctrl-C to let the python script continue.

[2022-08-16 18:08:53,054] ERROR in app: Exception on /shutdown [POST]
Traceback (most recent call last):
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\flask_cors\extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\SwSpotify\web_server.py", line 40, in shutdown_server
    shutdown()
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\SwSpotify\web_server.py", line 47, in shutdown
    raise RuntimeError('Not running with the Werkzeug Server')
RuntimeError: Not running with the Werkzeug Server
@aadibajpai
Copy link
Member

@Ace314159 is windows so your help would be appreciated

@SpamixOfficial
Copy link

I know this is an old issue but I'm having the exact same issue at the moment. I'm on linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants