Coder Social home page Coder Social logo

geemusic's Introduction

Hi there

I don't do too much public work on GitHub these days. If you want to stay up to date with what I'm up to, check out my website or SourceHut profile.

See ya on the other side! โœจ

geemusic's People

Contributors

adamdodev avatar aplocher avatar arimk avatar brandonjp avatar chrisnorman7 avatar danondso avatar digiltd avatar fergyfresh avatar huberf avatar kenmclennan avatar kuruoujou avatar laurilarjo avatar mehdydriouech avatar mikeage avatar msriram avatar nikp avatar rbowden91 avatar simonszu avatar stevenleeg avatar stridger avatar themoddersden avatar tiratatp avatar yamitzky avatar zhaostu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geemusic's Issues

[Errno 10054] An existing connection was forcibly closed by the remote host

I'm attempting to use geemusic routed through my own domain, and fundamentally, it works. I am able to stream music for some amount of time, but within 1-3 tracks, the stream dies with the following error:

127.0.0.1 - - [01/Mar/2017 09:10:53] "GET /geemusic/stream/Tbfdgorvksltrctbfj6ritwyw3a HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 42264)
Traceback (most recent call last):
  File "C:\Python27\lib\SocketServer.py", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File "C:\Python27\lib\SocketServer.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "C:\Python27\lib\SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Python27\lib\SocketServer.py", line 657, in __init__
    self.finish()
  File "C:\Python27\lib\SocketServer.py", line 716, in finish
    self.wfile.close()
  File "C:\Python27\lib\socket.py", line 279, in close
    self.flush()
  File "C:\Python27\lib\socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
  File "C:\Python27\lib\ssl.py", line 701, in sendall
    v = self.send(data[count:])
  File "C:\Python27\lib\ssl.py", line 667, in send
    v = self._sslobj.write(data)
error: [Errno 10054] An existing connection was forcibly closed by the remote host
----------------------------------------
{
  "context": {
    "AudioPlayer": {
      "offsetInMilliseconds": 0,
      "playerActivity": "PLAYING",
      "token": "56826"
    },
    "System": {
      "application": {
        "applicationId": "amzn1.ask.skill.XXX"
      },
      "device": {
        "supportedInterfaces": {
          "AudioPlayer": {}
        }
      },
      "user": {
        "userId": "amzn1.ask.account.XXX
      }
    }
  },
  "request": {
    "currentPlaybackState": {
      "offsetInMilliseconds": 0,
      "playerActivity": "PLAYING",
      "token": "56826"
    },
    "error": {
      "message": "Request timed out",
      "type": "MEDIA_ERROR_SERVICE_UNAVAILABLE"
    },
    "locale": "en-US",
    "requestId": "amzn1.echo-api.request.XXX",

    "timestamp": "2017-03-01T14:10:45Z",
    "token": "84360",
    "type": "AudioPlayer.PlaybackFailed"
  },
  "version": "1.0"
}
{
  "offsetInMilliseconds": 0,
  "playerActivity": "PLAYING",
  "token": "56826",
  "url": "https://[domain]/geemusic/stream/Twardvumg2vb3mtjbbkx3sjnluu"
}

This doesn't kill the server immediately, but is followed by something like:

127.0.0.1 - - [01/Mar/2017 09:36:47] "GET /geemusic/stream/Txvh7bappfxqbd5knqhakeidl7y HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 55772)
Traceback (most recent call last):
  File "C:\Python27\lib\SocketServer.py", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File "C:\Python27\lib\SocketServer.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "C:\Python27\lib\SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Python27\lib\SocketServer.py", line 657, in __init__
    self.finish()
  File "C:\Python27\lib\SocketServer.py", line 716, in finish
    self.wfile.close()
  File "C:\Python27\lib\socket.py", line 279, in close
    self.flush()
  File "C:\Python27\lib\socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
  File "C:\Python27\lib\ssl.py", line 701, in sendall
    v = self.send(data[count:])
  File "C:\Python27\lib\ssl.py", line 667, in send
    v = self._sslobj.write(data)
error: [Errno 10054] An existing connection was forcibly closed by the remote host
----------------------------------------
{
  "context": {
    "AudioPlayer": {
      "offsetInMilliseconds": 45550,
      "playerActivity": "STOPPED",
      "token": "26018"
    },
    "System": {
      "application": {
        "applicationId": "amzn1.ask.skill.XXX"
      },
      "device": {
        "supportedInterfaces": {
          "AudioPlayer": {}
        }
      },
      "user": {
        "userId": "amzn1.ask.account.XXX"
      }
    }
  },
  "request": {
    "locale": "en-US",
    "offsetInMilliseconds": 45550,
    "requestId": "amzn1.echo-api.request.XXX",

    "timestamp": "2017-03-01T14:36:41Z",
    "token": "26018",
    "type": "AudioPlayer.PlaybackStopped"
  },
  "version": "1.0"
}
{
  "offsetInMilliseconds": 45550,
  "playerActivity": "STOPPED",
  "token": "26018",
  "url": "https://vcr.host/geemusic/stream/Tbfdgorvksltrctbfj6ritwyw3a"
}
--------------------------------------------------------------------------------

DEBUG in playback [C:\GitHub\GeeMusic2\geemusic\intents\playback.py:12]:
Stopped at 45550
--------------------------------------------------------------------------------

127.0.0.1 - - [01/Mar/2017 09:36:49] "POST /geemusic HTTP/1.1" 400 -
{
  "context": {
    "AudioPlayer": {
      "offsetInMilliseconds": 45550,
      "playerActivity": "STOPPED",
      "token": "26018"
    },
    "System": {
      "application": {
        "applicationId": "amzn1.ask.skill.XXX"
      },
      "device": {
        "supportedInterfaces": {
          "AudioPlayer": {}
        }
      },
      "user": {
        "userId": "amzn1.ask.account.XXX"
      }
    }
  },
  "request": {
    "currentPlaybackState": {
      "offsetInMilliseconds": 45550,
      "playerActivity": "STOPPED",
      "token": "26018"
    },
    "error": {
      "message": "Seek call failed!, Response Code:200",
      "type": "MEDIA_ERROR_INVALID_REQUEST"
    },
    "locale": "en-US",
    "requestId": "amzn1.echo-api.request.XXX",

    "timestamp": "2017-03-01T14:36:43Z",
    "token": "26018",
    "type": "AudioPlayer.PlaybackFailed"
  },
  "version": "1.0"
}
{
  "offsetInMilliseconds": 45550,
  "playerActivity": "STOPPED",
  "token": "26018",
  "url": "https://[domain]/geemusic/stream/Tbfdgorvksltrctbfj6ritwyw3a"
}
127.0.0.1 - - [01/Mar/2017 09:36:50] "POST /geemusic HTTP/1.1" 400 -

To my understanding, @PostsDesert 's PR breaks the stream into chunks like so:

return Response(stream_with_context(req.iter_content(chunk_size=1024 * 1024)), content_type=req.headers['content-type'])

but it appears that occasionally, one of these chunks fails to stream. I've played with reducing and increasing the chunk size, but neither seem to prevent the failure from occurring.
I don't see anything in my Apache logs that would indicate an error coming from that end. Any ideas?

Can't get Heroku to run

I can't get the Heroku app to run without crashing. My log is below. It looks like it is a problem with the google account login, but I have edited and checked it multiple times in the Heroku Config Variables.

I don't have 2-step verification turned on on the google account, so just using my normal login credentials.

Any ideas?

2017-01-30T19:47:52.182937+00:00 heroku[web.1]: Starting process with command python server.py
2017-01-30T19:47:55.801681+00:00 app[web.1]: /app/.heroku/python/lib/python2.7/site-packages/Cryptodome/Math/_Numbers_gmp.py:230: UserWarning: implicit cast to 'char *' from a different pointer type: will be forbidden in the future (check that the types are as you expect; use an explicit ffi.cast() if they are correct)
2017-01-30T19:47:55.801701+00:00 app[web.1]: _gmp.gmp_snprintf(buf, c_size_t(buf_len), b("%Zd"), self._mpz_p)
2017-01-30T19:47:56.080598+00:00 app[web.1]: Traceback (most recent call last):
2017-01-30T19:47:56.080611+00:00 app[web.1]: File "server.py", line 1, in
2017-01-30T19:47:56.080612+00:00 app[web.1]: from geemusic import app
2017-01-30T19:47:56.080613+00:00 app[web.1]: File "/app/geemusic/init.py", line 10, in
2017-01-30T19:47:56.086875+00:00 app[web.1]: api = GMusicWrapper.generate_api(logger=app.logger)
2017-01-30T19:47:56.086901+00:00 app[web.1]: File "/app/geemusic/utils/music.py", line 129, in generate_api
2017-01-30T19:47:56.086953+00:00 app[web.1]: return cls(environ['GOOGLE_EMAIL'], environ['GOOGLE_PASSWORD'], **kwargs)
2017-01-30T19:47:56.086976+00:00 app[web.1]: File "/app/geemusic/utils/music.py", line 13, in init
2017-01-30T19:47:56.087299+00:00 app[web.1]: raise Exception("Unsuccessful login. Aborting!")
2017-01-30T19:47:56.087330+00:00 app[web.1]: Exception: Unsuccessful login. Aborting!
2017-01-30T19:47:56.364819+00:00 heroku[web.1]: State changed from starting to crashed
2017-01-30T19:47:56.348554+00:00 heroku[web.1]: Process exited with status 1

SSL Handshake fail (Heroku)

The app appears to be running on heroku, however the test phase fails and using Alexa generates a SSL handshake fail.

Music not playing

I've been trying to get the skill to work and it's driving me a bit mad. I've got it set up using the UK English instructions, I am starting using foreman, in a virtual environment, and using ngrok. Everything works as expected. The skill responds saying "Playing album x by y" or whatever is relevant, it appears to have found a streaming link, but the music just won't play. I have checked the .env values several times, I don't have the trailing '/' or '/alexa'. I've checked through the instructions carefully multiple times and everything appear to be correct.

The only things I could see that could perhaps be a problem are the server is running on port 5000 rather than 4000, but I've had a look around some of the other issues posted and that doesn't seem to be unusual. Also I am getting a 400 after every request. e.g.

07:53:12 web.1 | 127.0.0.1 - - [16/Feb/2017 07:53:12] "GET /stream/Thcn3dx45gqvphgmb2j65umeo3i HTTP/1.1" 302 - 07:53:13 web.1 | 127.0.0.1 - - [16/Feb/2017 07:53:13] "POST /alexa HTTP/1.1" 400 -

I'm running Arch Linux on a raspberry pi 3, everything is up to date.

Any help would be appreciated. :) Cheers.

edit: interestingly I just noticed even though no music is playing I can ask "what is currently playing" and get the response consistent with the track/album/artist I was looking for.

Heroku not starting

Just pulled the last version that should have fixed the not working music bug, but instead I have now in the logs:

2017-02-22T21:02:35.024974+00:00 heroku[web.1]: Starting process with command python3 server.py
2017-02-22T21:02:36.978075+00:00 app[web.1]: Fatal Python error: Py_Initialize: Unable to get the locale encoding
2017-02-22T21:02:36.978103+00:00 app[web.1]: ImportError: No module named 'encodings'
2017-02-22T21:02:37.043637+00:00 heroku[web.1]: Process exited with status 134
2017-02-22T21:02:37.053966+00:00 heroku[web.1]: State changed from starting to crashed

Seemed ok when I built :/

remote: Building source:
remote:
remote: -----> Python app detected
remote: $ pip install -r requirements.txt
remote: Collecting Flask-Ask==0.8.7 (from -r /tmp/build_4b61312cbf8d848f0b869fba166dc3f3/requirements.txt (line 10))
remote: Downloading Flask-Ask-0.8.7.tar.gz
remote: Collecting gmusicapi==10.1.1 (from -r /tmp/build_4b61312cbf8d848f0b869fba166dc3f3/requirements.txt (line 13))
remote: Downloading gmusicapi-10.1.1.tar.gz (165kB)
remote: Installing collected packages: Flask-Ask, gmusicapi
remote: Found existing installation: Flask-Ask 0.8.4
remote: Uninstalling Flask-Ask-0.8.4:
remote: Successfully uninstalled Flask-Ask-0.8.4
remote: Running setup.py install for Flask-Ask: started
remote: Running setup.py install for Flask-Ask: finished with status 'done'
remote: Found existing installation: gmusicapi 10.1.0
remote: Uninstalling gmusicapi-10.1.0:
remote: Successfully uninstalled gmusicapi-10.1.0
remote: Running setup.py install for gmusicapi: started
remote: Running setup.py install for gmusicapi: finished with status 'done'
remote: Successfully installed Flask-Ask-0.8.7 gmusicapi-10.1.1
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 51M
remote: -----> Launching...
remote: Released v12

Alexa isn't playing music with error message: "Store tracks require a subscription to stream."

Hey!

If I try to play my I'm Feeling Lucky playlist, Gee Music thinks it's playing something (if I ask "what song is this?" it'll give me an answer), but no audio is being played. So, I've gone through the error logs and have traced this back to the "get_stream_url" method. Is it possible that Gee Music is not searching through my uploaded songs, but rather it's going straight to store tracks?

Separately, I'm unable to play tracks from my own library because the search method is coming up blank, although the index_library function is working fine. I found a potentially relevant issue here: simon-weber/gmusicapi#474.

For reference, I'm on a free tier account in the US and have been unable to get any audio to play.

Thanks!

API always returns "sorry, I couldn't find that..."

I have the connection working and see requests coming into the server. The requests show up correctly in the test panel but the response is always, "sorry, I couldn't find that..." It looks like there is something wrong with my G API connection. I played around with the username and password and it makes the connection fail, so i think I have it input correctly. I also see this in the terminal window:
13:38:33 web.1 | DEBUG in music [/home/pi/geemusic/geemusic/utils/music.py:54]:
13:38:33 web.1 | Done! Discovered 6198 tracks.

Struggling to figure out what to try next. Is it because I have a free google music account?

What I see from a successful call in the terminal window:
14:09:03 web.1 | DEBUG in selection [/home/pi/geemusic/geemusic/intents/selection.py:68]:
14:09:03 web.1 | Fetching song it's 5 o'clock somewhere by None
14:09:03 web.1 | --------------------------------------------------------------------------------
14:09:04 web.1 | 127.0.0.1 - - [20/Jan/2017 14:09:04] "POST /alexa HTTP/1.1" 200 -

It's not showing the GET request.

"Unrecognized Device" from Heroku

Upon startup of your Heroku server, it's likely to be flagged as an "Unrecognized Device" by Google. From the logs, it appears to be a sign-in failure. You can fix this issue by adding the device here https://myaccount.google.com/device-activity .

I was thinking it might be a good idea to update the Heroku section in the README with this information.

Queue Support

It would be nice to have support to add a song to the end of the queue so you could say next play {song_name} or queue {song_name}.

Python Socket Error

I am struggling with starting the server. When I run Foreman, I get the following error:

pi@raspberrypi:~/geemusic $ foreman start
13:27:36 web.1 | started with pid 4504
13:27:45 web.1 | /usr/local/lib/python3.4/dist-packages/Cryptodome/Math/_Numbers_gmp.py:230: UserWarning: implicit cast to 'char *' from a different pointer type: will be forbidden in the future (check that the types are as you expect; use an explicit ffi.cast() if they are correct)
13:27:45 web.1 | _gmp.gmp_snprintf(buf, c_size_t(buf_len), b("%Zd"), self._mpz_p)
13:27:45 web.1 | Traceback (most recent call last):
13:27:45 web.1 | File "server.py", line 6, in
13:27:45 web.1 | app.run(host='0.0.0.0', port=port, debug=True)
13:27:45 web.1 | File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 841, in run
13:27:45 web.1 | run_simple(host, port, self, **options)
13:27:45 web.1 | File "/usr/local/lib/python3.4/dist-packages/werkzeug/serving.py", line 677, in run_simple
13:27:45 web.1 | s.bind((hostname, port))
13:27:45 web.1 | OSError: [Errno 98] Address already in use
13:27:45 web.1 | --------------------------------------------------------------------------------
13:27:45 web.1 | DEBUG in music [/home/pi/geemusic/geemusic/utils/music.py:57]:
13:27:45 web.1 | Done! Discovered 39 tracks.
13:27:45 web.1 | --------------------------------------------------------------------------------
13:27:46 web.1 | exited with code 1
13:27:46 system | sending SIGTERM to all processes

Please help.
Thanks in advance

Unable to start web server

When I run foreman start, I get the following:
pi@raspberrypi:~/geemusic $ foreman start
15:15:12 web.1 | started with pid 1819
15:15:18 web.1 | /usr/local/lib/python3.4/dist-packages/Cryptodome/Math/_Numbers_gmp.py:230: UserWarning: implicit cast to 'char *' from a different pointer type: will be forbidden in the future (check that the types are as you expect; use an explicit ffi.cast() if they are correct)
15:15:18 web.1 | _gmp.gmp_snprintf(buf, c_size_t(buf_len), b("%Zd"), self._mpz_p)
15:15:18 web.1 | Traceback (most recent call last):
15:15:18 web.1 | File "server.py", line 1, in
15:15:18 web.1 | from geemusic import app
15:15:18 web.1 | File "/home/pi/geemusic/geemusic/init.py", line 13, in
15:15:18 web.1 | api = GMusicWrapper.generate_api(logger=app.logger)
15:15:18 web.1 | File "/home/pi/geemusic/geemusic/utils/music.py", line 247, in generate_api
15:15:18 web.1 | **kwargs)
15:15:18 web.1 | File "/home/pi/geemusic/geemusic/utils/music.py", line 16, in init
15:15:18 web.1 | raise Exception("Unsuccessful login. Aborting!")
15:15:18 web.1 | Exception: Unsuccessful login. Aborting!
15:15:19 web.1 | exited with code 1
15:15:19 system | sending SIGTERM to all processes

I am stuck, please help

Heroku Setup

I have successfully set this up on Heroku, and think it could be valuable to add a description of how to do this in the README. It only took adding my Google account information to the Heroku environment variables dashboard instead of my local environment file and modifying the server.py file to include this modified line: app.run(host="0.0.0.0", port=int(os.environ["PORT"]), debug=True)

This could be a simple but valuable addition, as the barrier to contributors entry would likely be reduced.

If this sounds like it would be useful, I can open a PR for the README addition.

Code 400/HTTP 0.9 Bad Request Error

I am running this on a fresh installation and ports are forwarded. I am getting these errors and it is not working at all. Installed on Ubuntu 16.04 LTS Server.

mstsc_2017-02-03_20-04-51

chrome_2017-02-03_20-05-13

Play/ Pause restarts the current song

Danondso on his repo had been working on fixing this issue. He was using the offset key to start the song close to where you pause it. I was wondering if that would be something we could merge into Gee Music.

Skip to the # song in this album

For this feature should it skip to the # song in the original album, or skip to the # song in the shuffled album say if shuffle is on?

Question regarding Google Authentication

First off, thank you very much for creating this project! I got an echo dot for Christmas and really wanted to make it work with Google Play Music so this is perfect!

However, I am having an issue with the server crashing when trying to authenticate with my Google credentials. I do have two step authentication turned on for my account so I suspect that is the culprit, but you seem to indicate that the server will still work with two-step in the readme. I was unsure what you mean by 'application specific password' so used my normal password, which might be the issue. Is there something I am missing here? Thanks!

Feature Request: Shuffle All Songs

Hey man! As a newbie to Alexa skills, this is a SUPER cool skill to mess around with. Can you make an intent to shuffle all uploaded/purchased songs?

Thanks :)

Shuffle Song Support

I have shuffle song support working on my branch. Is this something that would fit for Gee Music?

No music after request is answered unless using ngrok

Has anyone got this to work with out using a service like ngrok?

I got this service running with foreman on port 4000
The alexa skill requires HTTPS not sure if it requires the SSL cert.
so i setup nginx to listen on port 443 and serve up a self signed cert that i created per Amazon's guide:

https://developer.amazon.com/appsandservices/solutions/alexa/alexa-skills-kit/docs/testing-an-alexa-skill#create-a-private-key-and-self-signed-certificate-for-testing

so i'm forwarding port 443 in my router to my linux server to nginx which uses proxy pass to serve up the Python Flask application on port 4000 (which i also forwarded in my router for kicks)

https://i.imgur.com/ahsiPdf.png
you can see in this imgur screenshot that the test from amazon alexa skill page is working.
also in the image is my .env (last two lines so i don't show my pass) and you'll see the foreman output as well as netstat showing the ports 443 (for https, NGINX) and port 4000 (geemusic application, Python,flask,foreman whatever)

Everything works except audio does not play.
I have control over my firewall (ubiquiti) and i changed it to accept any requests in or out as a test to see if the firewall was playing tough.

With out any luck, i decided to test the ngrok and got that working pretty easily. but it isn't really a long term solution is it?

any thoughts on how i could get this working natively without using the ngrok service?

free google music tier

Same issue as #50 where everything seems to be connected ok, but as soon as I try and play a song or album I know I have in my library I get the dreaded "Sorry, I couldn't find that artist". Which I gather is down to me using the free Google Music tier.

The PR in #50 leads to a 404, but I installed the branch and there seem to be the following sample utterances :

GeeMusicPlayLibraryIntent play songs from my library
GeeMusicPlayLibraryIntent play tracks from my library
GeeMusicPlayLibraryIntent play my library
GeeMusicPlayLibraryIntent start playing tracks from my library
GeeMusicPlayLibraryIntent play songs from library

So would I be right in saying, at this time, there's no way of playing specific songs from your library if you have the free tier?

Feature Request: List albums

I might be the only one who has this problem but I rarely remember album names anymore. But sometimes I still want to listen to a specific album but don't remember the name (but I know it when I hear it). It would be a nice feature if I could ask Alexa to list out the albums of a particular artist so I can figure out which one is the one I want to listen to.

If I find the time I might look into doing this myself but it would be a pretty steep learning curve for me as I am not super familiar with most of the packages this project uses.

Would we want to add a feature for a setlist.fm wrapper I made last year?

https://github.com/fergyfresh/setlist-on-a-playlist/blob/master/setlistfm.py

Basically it would require some clean-up but I know people that would want to use it.

I could add an intent to play a bands most recent setlist which I like to do sometimes because they are usually pretty good playlists. My friend REALLY likes it cause he likes to know exactly which portion of which albums they have been playing recently and he will only listen to setlist playlists that he makes manually. This would do it for you!!!!

Troubleshooting guide?

I've set it up, and it appears to work until I play something. There's a warning message after the initial request, and then it appears to work properly. When I ask echo to play, I see the connection to the server process and echo reports that it is playing music from my personalized station, but no music actually plays.

I am running the server on an AWS image. ngnix is set to proxy requests to /alexa over to port localhost:4000 and it does connect properly.

APP_URL=https:///alexa

 * Running on http://127.0.0.1:4000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger pin code: 103-857-125
/usr/local/lib64/python2.7/site-packages/Cryptodome/Math/_Numbers_gmp.py:230: UserWarning: implicit cast to 'char *' from a different pointer type: will be forbidden in the future (check that the types are as you expect; use an explicit ffi.cast() if they are correct)
  _gmp.gmp_snprintf(buf, c_size_t(buf_len), b("%Zd"), self._mpz_p)
127.0.0.1 - - [14/Jan/2017 18:03:43] "POST /alexa HTTP/1.0" 200 -
127.0.0.1 - - [14/Jan/2017 18:04:38] "POST /alexa HTTP/1.0" 200 -
127.0.0.1 - - [14/Jan/2017 18:04:38] "GET /alexa/stream/Tkhmsodqmlo74qsujirn4obuzj4 HTTP/1.0" 404 -
127.0.0.1 - - [14/Jan/2017 18:04:38] "POST /alexa HTTP/1.0" 400 -
127.0.0.1 - - [14/Jan/2017 18:05:01] "POST /alexa HTTP/1.0" 200 -
127.0.0.1 - - [14/Jan/2017 18:05:15] "POST /alexa HTTP/1.0" 200 -
127.0.0.1 - - [14/Jan/2017 18:05:15] "GET /alexa/stream/T4qej3geoetgltexgwpyt4ftktm HTTP/1.0" 404 -
127.0.0.1 - - [14/Jan/2017 18:05:16] "POST /alexa HTTP/1.0" 400 -

Card Support

It would be nice to have card support with images now that we have reliable track metadata. I would be happy to implement this once my current PR get worked out.

When Alexa wakes up, music pauses instead of going to background.

Whenever I wake Alexa up to issue a command and music is playing, the music just pauses.

Steps to reproduce:
1.- Start playing music from geemusic
2.- Call "Alexa" or whatever your wake word is.

Expected result: Alexa will start listening, but the music will still play in the background, with a lower volume.

Actual result: Alexa starts listening, but music pauses. Music resumes from where it was as soon as Alexa goes back to sleep.

Won't actually stream music

I have it up and running on Heroku, and can plan songs, but it doesn't respond to any of the playlist commands.

In the Amazon Service Simulator I enter the utterance: play milestones playlist

The service request that is generated is:
{
"session": {
"sessionId": "SessionId.4c775bf1-bbd8-4f02-a3a7-c7aff8361aab",
"application": {
"applicationId": "amzn1.ask.skill.b6862dda-2788-4fb8-a580-934cee354fae"
},
"attributes": {},
"user": {
"userId": "amzn1.ask.account.AFFCDRWCHKPCIAWCM24SZZSHJG6HL5TRNPODBNKBOVMMAPE3QHRM2NF6X2I7OJPMED42PTWVMWB2TGCY7NU3H3JUCROSC625J7A6UGKUYTPJIHVFNUKJKEHPGDICHQ2PMIQDAVJQZCDD2BGQHR5XYGCRKU44JGMQWKO7N4QOSTL2TXMME26EOUVIMJSV2JMILHJ5O223SUSIY5Y"
},
"new": true
},
"request": {
"type": "IntentRequest",
"requestId": "EdwRequestId.6d3e0f97-6276-4e6a-87af-91d7f00be4a5",
"locale": "en-US",
"timestamp": "2017-01-31T00:06:04Z",
"intent": {
"name": "GeeMusicPlayPlaylistIntent",
"slots": {
"playlist_name": {
"name": "playlist_name",
"value": "milestones"
}
}
}
},
"version": "1.0"
}

The service response is:
The remote endpoint could not be called, or the response it returned was invalid.

I do see an entry in the Heroku log:
2017-01-31T00:06:20.488195+00:00 heroku[router]: at=info method=POST path="/alexa" host=fathomless-refuge-71971.herokuapp.com request_id=19584810-858d-4759-91de-b0cf7ebde093 fwd="72.21.217.70" dyno=web.1 connect=1ms service=16158ms status=200 bytes=344
2017-01-31T00:06:20.487062+00:00 app[web.1]: 10.81.172.78 - - [31/Jan/2017 00:06:20] "POST /alexa HTTP/1.1" 200 -

And that log happens on every attempt, but it appears like it isn't responding.

ImportError: No module named 'flask.debughelpers'

I'm getting the following error after setting up geemusic. Sometimes it works and plays my music, but other times, I get the following output. Is there something I need to do to add flask.debughelpers so I can see what the problem is?

192.xxx.xxx.xxx - - [13/Apr/2017 22:43:46] "POST /alexa HTTP/1.1" 500 - Traceback (most recent call last):
  File "/home/x/.local/lib/python3.5/site-packages/flask/app.py", line 1994, in __call__
  File "/home/x/.local/lib/python3.5/site-packages/flask/app.py", line 1985, in wsgi_app
  File "/home/x/.local/lib/python3.5/site-packages/flask/app.py", line 1540, in handle_exception
  File "/home/x/.local/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
  File "/home/x/.local/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app
  File "/home/x/.local/lib/python3.5/site-packages/flask/app.py", line 1614, in full_dispatch_request
  File "/home/x/.local/lib/python3.5/site-packages/flask/app.py", line 1517, in handle_user_exception
  File "/home/x/.local/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
  File "/home/x/.local/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request
  File "/home/x/.local/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request
  File "/home/x/.local/lib/python3.5/site-packages/flask_ask/core.py", line 530, in _flask_view_func
  File "/home/x/.local/lib/python3.5/site-packages/flask_ask/core.py", line 480, in _alexa_request
  File "/home/x/.local/lib/python3.5/site-packages/werkzeug/local.py", line 343, in __getattr__
  File "/home/x/.local/lib/python3.5/site-packages/werkzeug/utils.py", line 73, in __get__
  File "/home/x/.local/lib/python3.5/site-packages/werkzeug/wrappers.py", line 446, in data
  File "/home/x/.local/lib/python3.5/site-packages/werkzeug/wrappers.py", line 476, in get_data
  File "/home/x/.local/lib/python3.5/site-packages/flask/wrappers.py", line 192, in _load_form_data

ImportError: No module named 'flask.debughelpers'
192.xxx.xxx.xxx - - [13/Apr/2017 22:43:46] "POST /alexa HTTP/1.1" 500 -

Thanks!
Paul

libssl-dev

On a fresh Ubuntu install, I think you will also need to do:

sudo apt-get install libssl-dev

In order for pip to successfully install the cryptography package (or at least, I had to).

Dynamic DNS issue

Good day

I am using a dynu.com DNS and can access my pi from another pc outside my network. When I go to [my_addr].dynu.com:4000 I can see on the geemusic server that it was accessed. But when I do the Ask Gee Music test on amazon, It says the server is unavailable. My port forwarding is on.

I tried ngrok and it works, but I would prefer using my DDNS.

Any idea where I have gone wrong?

Skill taking too long to respond

I am running into an issue where the skill is taking too long to respond and so it only works about 50% of the time. Unfortunately, there doesn't appear to be any way to increase the timeout value for alexa skills.

I am using a raspberry pi as my server and running ngrok and foreman as per the readme. I was thinking that the raspberry pi might be too slow but from watching the server when I give a request to alexa it appears that the request itself is taking quite a long time to even get to the pi.

Does anyone have tips on anything I could do on my end to fix this?

Bad Remote Endpoint in Amazon Developer Console

I'm trying to build the service behind a firewall and am receiving The remote endpoint could not be called, or the response it returned was invalid. from amazon. Here are the steps I've taken so far:

  • I signed up for ngrok so I could have a stable URL to give amazon, but was unable to get it to run as a daemon. It does work if I spin it up as a foreground instance but I would rather not pay for the service anyways.

  • Attempted to use a self-signed cert and then modified the server.py file to use the following config. I was able to hit this end point through the browser and received the expected warning message. I also see the GET request in the server log.

from geemusic import app
import os

if __name__ == '__main__':
    port = int(os.environ.get("PORT", 4000))

context = ('[path]/certificate.pem', '[path]/private-key.pem')
app.run(host='0.0.0.0', port=port, debug=True) #, ssl_context=context).
  • Then I tried using letsencrypt to add a trusted cert to my server and am able to hit the endpoint in the browser but only on http. Then I forced the certificate path using the above configuration which allowed it to work over https. Now in my server log I'm getting 192.168.1.1 - - [11/Jan/2017 15:08:37] "GET /alexa HTTP/1.1" 405 - However I'm still returning the original error when I attempt to call the same endpoint from amazon

I'm also curious what the point is of running the server through foreman since all it does is call the server. Is there an advantage to doing it this way? I've been spinning up the server directly through python.

Any ideas are appreciated, thanks!

"Can't find that song"

It says that it can't find the song/artist/playlist, even if I use the examples.

12:05:59 web.1 | 127.0.0.1 - - [08/Apr/2017 12:05:59] "POST /alexa HTTP/1.1" 200 -
12:09:08 web.1 | 127.0.0.1 - - [08/Apr/2017 12:09:08] "POST /alexa HTTP/1.1" 200 -
12:09:18 web.1 | 127.0.0.1 - - [08/Apr/2017 12:09:18] "POST /alexa HTTP/1.1" 200 -
12:09:57 web.1 | 127.0.0.1 - - [08/Apr/2017 12:09:57] "POST /alexa HTTP/1.1" 200 -
12:10:09 web.1 | --------------------------------------------------------------------------------
12:10:09 web.1 | DEBUG in selection [/home/pi/geemusic/geemusic/intents/selection.py:85]:
12:10:09 web.1 | Fetching song hello by Adele
12:10:09 web.1 | --------------------------------------------------------------------------------
12:10:09 web.1 | 127.0.0.1 - - [08/Apr/2017 12:10:09] "POST /alexa HTTP/1.1" 200 -

Error starting Foreman

I'm sure it's something simple, but following your instructions I have this problem:

(.venv) pi@raspberrypi:~/Development$ foreman start
ERROR: Procfile does not exist.

This is a brand new raspbian install with nothing else installed.

Heroku: Music stops playing

After a while, music stops playing. Using Heroku here. Logs:

2017-03-11T06:49:54.440933+00:00 app[web.1]: --------------------------------------------------------------------------------
2017-03-11T06:49:56.022380+00:00 heroku[router]: sock=client at=warning code=H27 desc="Client Request Interrupted" method=GET path="/alexa/stream/[stream]" host=[herokuname].herokuapp.com request_id=347b4781-3473-4324-a271-8f6f14a09389 fwd="[myip]" dyno=web.1 connect=0ms service=2157ms status=499 bytes= protocol=https
2017-03-11T06:49:55.913477+00:00 app[web.1]: 10.179.109.26 - - [11/Mar/2017 06:49:55] "GET /alexa/stream/[stream] HTTP/1.1" 200 -
2017-03-11T06:49:56.692293+00:00 heroku[router]: at=info method=POST path="/alexa" host=[herokuname].herokuapp.com request_id=65361854-156b-4b64-b773-5ebecc89f3a9 fwd="72.21.217.161" dyno=web.1 connect=1ms service=27ms status=400 bytes=163 protocol=https
2017-03-11T06:49:56.616898+00:00 heroku[router]: at=info method=POST path="/alexa" host=[herokuname].herokuapp.com request_id=3a86088d-5411-40f3-8eeb-60c5437fac7f fwd="72.21.217.161" dyno=web.1 connect=2ms service=70ms status=400 bytes=163 protocol=https
2017-03-11T06:49:56.610652+00:00 app[web.1]: --------------------------------------------------------------------------------
2017-03-11T06:49:56.610669+00:00 app[web.1]: DEBUG in playback [/app/geemusic/intents/playback.py:12]:
2017-03-11T06:49:56.610670+00:00 app[web.1]: Stopped at 78654
2017-03-11T06:49:56.610675+00:00 app[web.1]: --------------------------------------------------------------------------------
2017-03-11T06:49:56.610962+00:00 app[web.1]: 10.13.194.229 - - [11/Mar/2017 06:49:56] "POST /alexa HTTP/1.1" 400 -
2017-03-11T06:49:56.689788+00:00 app[web.1]: 10.81.172.78 - - [11/Mar/2017 06:49:56] "POST /alexa HTTP/1.1" 400 -

Heroku fails to login to Google Account

I have to correct email and password entered, but the app fails to log in to Google...

2017-02-02T03:18:12.147886+00:00 app[web.1]: File "server.py", line 1, in
2017-02-02T03:18:12.147891+00:00 app[web.1]: from geemusic import app
2017-02-02T03:18:12.151452+00:00 app[web.1]: File "/app/geemusic/init.py", line 10, in
2017-02-02T03:18:12.151455+00:00 app[web.1]: api = GMusicWrapper.generate_api(logger=app.logger)
2017-02-02T03:18:12.151456+00:00 app[web.1]: File "/app/geemusic/utils/music.py", line 132, in generate_api
2017-02-02T03:18:12.151457+00:00 app[web.1]: return cls(environ['GOOGLE_EMAIL'], environ['GOOGLE_PASSWORD'], **kwargs)
2017-02-02T03:18:12.151458+00:00 app[web.1]: File "/app/geemusic/utils/music.py", line 13, in init
2017-02-02T03:18:12.151458+00:00 app[web.1]: raise Exception("Unsuccessful login. Aborting!")
2017-02-02T03:18:12.151459+00:00 app[web.1]: Exception: Unsuccessful login. Aborting!
2017-02-02T03:18:12.326384+00:00 heroku[web.1]: State changed from starting to crashed
2017-02-02T03:18:12.307307+00:00 heroku[web.1]: Process exited with status 1

Accidental triggering of Alexa

I find Alexa is sometimes triggered accidentally by similar words, so I say 'Never mind' to dismiss her. Geemusic has no way to deal with this. It just needs a AMAZON.CancelIntent in the intent schema and a corresponding function in intents/selection.py.

Last.fm Integration

I use the last.fm service to keep a record of every song I play and this could be a valuable addition to the Alexa skill for users of this site. I am currently working on an integration on my local fork, and it would only rely on the requests library to carry out this functionality. Currently, I plan to have the integration be activated by the inclusion of an environment variable so people who don't use the service have to take no action to keep it disabled. Does this sound like a useful addition to the GeeMusic skill? I want to ensure the code base doesn't become cluttered with functionality, so wanted to ensure this would be a worthwhile addition.

It would make one request to the last.fm API to "scrobble" the currently playing song, and so the code would only be activated when a new song starts streaming.

Loop Support

I have loop support working on my branch. This seems like it would be a great addition to Gee Music.

Deploying on Heroku with the free Google Music

I've managed to set this up on my Echo Dot following the (UK English) instructions to deploy it to Heroku but I can't get it to play any music.

When I ask it to "play artist x" that I know is in my library of uploaded music I just get "Sorry, I couldn't find that artist" with the following couple of lines in the Heroku log:

2017-03-18T09:30:26.140721+00:00 heroku[router]: at=info method=POST path="/alexa" host=xxx.herokuapp.com request_id=f93d31ec-9785-46f4-9f40-dbdef4458626 fwd="72.21.217.152" dyno=web.1 connect=1ms service=389ms status=200 bytes=324 protocol=https
2017-03-18T09:30:26.140632+00:00 app[web.1]: 10.158.177.57 - - [18/Mar/2017 09:30:26] "POST /alexa HTTP/1.1" 200 -

Similarly for "play album by artist" I just get "Sorry, I couldn't find that album" with the following log:

2017-03-18T09:35:24.171038+00:00 app[web.1]: --------------------------------------------------------------------------------
2017-03-18T09:35:24.171051+00:00 app[web.1]: DEBUG in selection [/app/geemusic/intents/selection.py:59]:
2017-03-18T09:35:24.171053+00:00 app[web.1]: Fetching album x by x
2017-03-18T09:35:24.171057+00:00 app[web.1]: --------------------------------------------------------------------------------
2017-03-18T09:35:24.588372+00:00 heroku[router]: at=info method=POST path="/alexa" host=xxx.herokuapp.com request_id=c2e32f46-b340-46b5-9dab-4d79618e8f83 fwd="72.21.217.130" dyno=web.1 connect=1ms service=525ms status=200 bytes=323 protocol=https
2017-03-18T09:35:24.586878+00:00 app[web.1]: 10.63.231.107 - - [18/Mar/2017 09:35:24] "POST /alexa HTTP/1.1" 200 -

I saw #70 so tried just "play my library" and got the response "Playing music from your library" with the following in the Heroku logs but nothing played:

2017-03-18T09:44:53.829490+00:00 heroku[router]: at=info method=POST path="/alexa" host=xxx.herokuapp.com request_id=21c25813-c4dc-42dd-b7ef-d9e45bf78aaa fwd="54.240.197.74" dyno=web.1 connect=0ms service=31ms status=200 bytes=565 protocol=https
2017-03-18T09:44:53.828238+00:00 app[web.1]: 10.30.24.121 - - [18/Mar/2017 09:44:53] "POST /alexa HTTP/1.1" 200 -
2017-03-18T09:44:54.905617+00:00 heroku[router]: at=info method=GET path="/alexa/stream/Tazlwyae6couyno5qs5aum6jsty" host=xxx.herokuapp.com request_id=a108b2c3-0f46-4b43-b3df-d301edc986f1 fwd="81.147.64.54" dyno=web.1 connect=1ms service=20ms status=500 bytes=25870 protocol=https
2017-03-18T09:44:54.900730+00:00 app[web.1]: 10.179.235.253 - - [18/Mar/2017 09:44:54] "GET /alexa/stream/Tazlwyae6couyno5qs5aum6jsty HTTP/1.1" 500 -
2017-03-18T09:44:54.901182+00:00 app[web.1]: Traceback (most recent call last):
2017-03-18T09:44:54.901183+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1994, in call
2017-03-18T09:44:54.901184+00:00 app[web.1]: return self.wsgi_app(environ, start_response)
2017-03-18T09:44:54.901185+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
2017-03-18T09:44:54.901185+00:00 app[web.1]: response = self.handle_exception(e)
2017-03-18T09:44:54.901186+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
2017-03-18T09:44:54.901187+00:00 app[web.1]: reraise(exc_type, exc_value, tb)
2017-03-18T09:44:54.901187+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
2017-03-18T09:44:54.901188+00:00 app[web.1]: raise value
2017-03-18T09:44:54.901189+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
2017-03-18T09:44:54.901190+00:00 app[web.1]: response = self.full_dispatch_request()
2017-03-18T09:44:54.901190+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
2017-03-18T09:44:54.901191+00:00 app[web.1]: rv = self.handle_user_exception(e)
2017-03-18T09:44:54.901191+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
2017-03-18T09:44:54.901192+00:00 app[web.1]: reraise(exc_type, exc_value, tb)
2017-03-18T09:44:54.901192+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
2017-03-18T09:44:54.901193+00:00 app[web.1]: raise value
2017-03-18T09:44:54.901194+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
2017-03-18T09:44:54.901194+00:00 app[web.1]: rv = self.dispatch_request()
2017-03-18T09:44:54.901195+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
2017-03-18T09:44:54.901195+00:00 app[web.1]: return self.view_functionsrule.endpoint
2017-03-18T09:44:54.901196+00:00 app[web.1]: File "/app/geemusic/controllers.py", line 9, in redirect_to_stream
2017-03-18T09:44:54.901197+00:00 app[web.1]: stream_url = api.get_google_stream_url(song_id)
2017-03-18T09:44:54.901198+00:00 app[web.1]: File "/app/geemusic/utils/music.py", line 136, in get_google_stream_url
2017-03-18T09:44:54.901198+00:00 app[web.1]: return self._api.get_stream_url(song_id)
2017-03-18T09:44:54.901199+00:00 app[web.1]: File "", line 2, in get_stream_url
2017-03-18T09:44:54.901200+00:00 app[web.1]:
2017-03-18T09:44:54.901200+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gmusicapi/utils/utils.py", line 293, in wrapper
2017-03-18T09:44:54.901201+00:00 app[web.1]: return function(*args, **kw)
2017-03-18T09:44:54.901202+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gmusicapi/clients/mobileclient.py", line 367, in get_stream_url
2017-03-18T09:44:54.901202+00:00 app[web.1]: raise NotSubscribed("Store tracks require a subscription to stream.")
2017-03-18T09:44:54.901203+00:00 app[web.1]: gmusicapi.exceptions.NotSubscribed: Store tracks require a subscription to stream. (https://goo.gl/v1wVHT)
2017-03-18T09:44:55.269505+00:00 heroku[router]: at=info method=POST path="/alexa" host=xxx.herokuapp.com request_id=8bff1ed7-b8dd-4e80-897f-fbcbd4931c94 fwd="54.240.197.74" dyno=web.1 connect=1ms service=30ms status=400 bytes=163 protocol=https
2017-03-18T09:44:55.258811+00:00 app[web.1]: 10.37.191.73 - - [18/Mar/2017 09:44:55] "POST /alexa HTTP/1.1" 400 -

I've checked the APP_URL config is set correctly (without a trailing / or alexa).

Therefore, a couple of questions:

  1. What's actually meant to work when using the free Google Music?
  2. What else can I check to further debug this?

Thanks in advance.

setup-tools

You might want to add in the documentation, that if you have an older Python install, and it's erring out on setup-tools, to do the following in the virtualenv

pip install -U pip wheel setuptools

"There was a problem with the requested skills response"

I'm having an issue where I believe both foreman and ngrok are both working properly, but whenever I I ask Alexa "Tell geemusic to play artist radiohead" I get "There was a problem with the requested skills response". This goes for almost any other request. Here's the output from the console. It looks likes there's a problem with flask, but I don't have much experience with it. Thank you in advance!

`17:39:04 web.1 | 127.0.0.1 - - [18/Feb/2017 17:39:04] "POST /alexa HTTP/1.1" 200 -
17:39:05 web.1 | 127.0.0.1 - - [18/Feb/2017 17:39:05] "POST /alexa HTTP/1.1" 500 -
17:39:05 web.1 | Traceback (most recent call last):
17:39:05 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1994, in call
17:39:05 web.1 | return self.wsgi_app(environ, start_response)
17:39:05 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1985, in wsgi_app
17:39:05 web.1 | response = self.handle_exception(e)
17:39:05 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1540, in handle_exception
17:39:05 web.1 | reraise(exc_type, exc_value, tb)
17:39:05 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
17:39:05 web.1 | response = self.full_dispatch_request()
17:39:05 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
17:39:05 web.1 | rv = self.handle_user_exception(e)
17:39:05 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
17:39:05 web.1 | reraise(exc_type, exc_value, tb)
17:39:05 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
17:39:05 web.1 | rv = self.dispatch_request()
17:39:05 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
17:39:05 web.1 | return self.view_functionsrule.endpoint
17:39:05 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask_ask/core.py", line 499, in _flask_view_func
17:39:05 web.1 | self._update_stream()
17:39:05 web.1 | File "/usr/local/lib/python2.7/dist-packages/flask_ask/core.py", line 468, in _update_stream
17:39:05 web.1 | fresh_stream.dict.update(self._from_context())
17:39:05 web.1 | TypeError: 'NoneType' object is not iterable

`

Random songs in playlist/album

Hi,
Thanks for the great skill, installed it on heroku in a few minutes!
Would be great to be able to start a playlist in random mode, or an album.

Help with Troubleshooting link from Heroku install

Hello,
I have geemusic setup and running on Heroku, and i can ask Alexa to play a song, but no music actually starts playing. I don't know where to begin troubleshooting. It
Interaction:
Me: Alexa, tell geemusic to play the song with or without you
Alexa: Playing the song With or Without you by U2.
Alexa:

It seems like it is doing the lookup, but the streaming isn't kicking off.

Heroku instructions followed, Alexa skill test succeeds.

logs from Heroku

2017-01-02T15:56:46.236184+00:00 heroku[router]: at=info method=POST path="/alexa" host=whispering-depths-44089.herokuapp.com request_id=a665335e-163c-43ff-9989-b209a62c43d3 fwd="72.21.217.176" dyno=web.1 connect=1ms service=761ms status=200 bytes=570
2017-01-02T15:56:46.236090+00:00 app[web.1]: 10.13.211.115 - - [02/Jan/2017 15:56:46] "POST /alexa HTTP/1.1" 200 -
2017-01-02T16:01:36.767042+00:00 heroku[router]: at=info method=POST path="/alexa" host=whispering-depths-44089.herokuapp.com request_id=e90e13cd-71ee-46be-98a6-dfa8524eb2f0 fwd="72.21.217.100" dyno=web.1 connect=1ms service=1248ms status=200 bytes=558
2017-01-02T16:01:36.761304+00:00 app[web.1]: 2017-01-02 16:01:36,760 - gmusicapi.Mobileclient3 (shared:281) [ERROR]: the response format for GetArtist was not recognized.
2017-01-02T16:01:36.761312+00:00 app[web.1]:
2017-01-02T16:01:36.761313+00:00 app[web.1]: Value u'' for field '.albums[36].name' cannot be blank'
2017-01-02T16:01:36.761314+00:00 app[web.1]:
2017-01-02T16:01:36.761316+00:00 app[web.1]: First, try the develop branch. If you can recreate this error with the most recent code please create an issue that includes the above ValidationException and the following request/response:
2017-01-02T16:01:36.761317+00:00 app[web.1]: {u'method': u'GET', u'url': u'https://mclients.googleapis.com/sj/v2.5/fetchartist', u'headers': {u'Authorization': u''}, u'params': {u'nid': u'Ae3hkk6q7nm6zchy7ru4u5sxdle', u'dv': 0, u'hl': u'en_US', u'tier': u'aa', u'num-top-tracks': 5, u'include-albums': True, u'alt': u'json', u'num-related-artists': 5}}
2017-01-02T16:01:36.761318+00:00 app[web.1]:
2017-01-02T16:01:36.761338+00:00 app[web.1]: with the Passengers project, and U2 promised their next album, to be released in the fall of...'
2017-01-02T16:01:36.761339+00:00 app[web.1]: A traceback follows:
2017-01-02T16:01:36.761340+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gmusicapi/protocol/shared.py", line 249, in perform
2017-01-02T16:01:36.761340+00:00 app[web.1]: cls.validate(response, parsed_response)
2017-01-02T16:01:36.761338+00:00 app[web.1]: u'{"kind":"sj#artist","name":"U2","artistArtRef":"http://lh3.googleusercontent.com/M0RlqsUx4hULw61OlxljLLxi0wlA__RSMZzF8Qgo7VCAWLOKkJMS6jiP9a3Gy4kwR63vh2Te4w","artistArtRefs":[{"kind":"sj#imageRef","url":"http://lh3.googleusercontent.com/M0RlqsUx4hULw61OlxljLLxi0wlA__RSMZzF8Qgo7VCAWLOKkJMS6jiP9a3Gy4kwR63vh2Te4w","aspectRatio":"2","autogen":false}],"artistId":"Ae3hkk6q7nm6zchy7ru4u5sxdle","artistBio":"Through a combination of zealous righteousness and post-punk experimentalism, U2 became one of the most popular rock & roll bands of the '80s. They were rock & roll crusaders during an era of synthesized pop and heavy metal, equally known for their sweeping sound as for their grandiose statements about politics and religion. The Edge provided the group with a signature sound by creating sweeping sonic landscapes with his heavily processed, echoed guitars. Though the Edge's style wasn't conventional, the rhythm section of Larry Mullen, Jr. and Adam Clayton played the songs as driving hard rock, giving the band a forceful, powerful edge that was designed for arenas. And their lead singer, Bono, was a frontman with a knack of grand gestures that played better in stadiums than small clubs. It's no accident that footage of Bono parading with a white flag with \"Sunday Bloody Sunday\" blaring in the background became the defining moment of U2's early career -- there rarely was a band that believed so deeply in rock's potential for revolution as U2, and there rarely was a band whose members didn't care if they appeared foolish in the process.\n\nDuring the course of the early '80s, the group quickly built up a dedicated following through constant touring and a string of acclaimed records. By 1987, U2's following had grown large enough to propel them to the level of international superstardom with the release of The Joshua Tree. Unlike many of their contemporaries, they were able to sustain such popularity in the '90s by reinventing themselves as a postmodern, self-consciously ironic, dance-inflected pop/rock act, owing equally to the experimentalism of late-'70s Bowie and '90s electronic dance and techno. By performing such a successful reinvention, the band confirmed its status as one of the most popular bands in rock history, in addition to earning additional critical respect.\n\nWith its textured guitars, the band's sound was undeniably indebted to post-punk, so it's slightly ironic that U2 formed in 1976, before punk had even reached their hometown of Dublin, Ireland. Larry Mullen Jr. (born October 31, 1961; drums), posted a notice on a high-school bulletin board asking for fellow musicians to form a band. Bono (born Paul Hewson, May 10, 1960; vocals), the Edge (born David Evans, August 8, 1961; guitar, keyboards, vocals), Adam Clayton (born March 13, 1960; bass), and Dick Evans responded to the ad, and the teenagers banded together as a Beatles and Stones cover band called the Feedback. They then changed their name to the Hype in 1977. Shortly afterward, Dick Evans left the band to form the Virgin Prunes, and the group changed names once again, this time adopting the moniker of U2.\n\nU2's first big break arrived in 1978, during the members' final year of high school, when they won a talent contest sponsored by Guinness. By the end of the year, the Stranglers' manager, Paul McGuinness, had seen U2 play and offered to manage them. Even with a powerful manager in their corner, the band had trouble making much headway, and failed an audition with CBS Records at the end of the year. In the fall of 1979, U2 released their debut EP, U2 Three. The EP was available only in Ireland, where it topped the national charts. Shortly afterward, they began to play in England, but they failed to gain much attention away from home.\n\nU2 scored one more chart-topping single, \"Another Day,\" in early 1980 before Island Records offered the group a contract. Later that year, the band's full-length debut, Boy, was released. Produced by Steve Lillywhite, the album's sweeping, atmospheric but edgy sound was unlike most recordings by U2's post-punk contemporaries, and the band earned further attention for its public embrace of Christianity; only Clayton was not a practicing Christian. Through constant touring, including opening gigs for Talking Heads, U2 were able to take Boy into the American Top 70 in early 1981. October, also produced by Lillywhite, followed in the fall, and it became their British breakthrough, reaching number 11 on the charts. By early 1983, Boy's \"I Will Follow\" and October's \"Gloria\" had become staples on MTV, which, along with their touring, gave U2 a formidable cult following in the U.S. \n\nReleased in the spring of 1983, the Lillywhite-produced War became U2's breakthrough release, entering the U.K. charts at number one and elevating them into arenas in the United States, where the album peaked at number 12. War had a stronger political message than its predecessors, as evidenced by the international hits \"Sunday Bloody Sunday\" and \"New Year's Day.\" During the supporting tour, the band filmed its concert at Colorado's Red Rocks Amphitheater, releasing the show as an EP and video titled Under a Blood Red Sky. The EP entered in the U.K. charts at number two, becoming the most successful live recording in British history. U2 had become one of the most popular bands in the world, and their righteous political stance soon became replicated by many other bands, providing the impetus for the Band Aid and Live Aid projects in 1984 and 1985, respectively. \n\nFor the follow-up to War, U2 entered the studios with co-producers Brian Eno and Daniel Lanois, who helped give the resulting album an experimental, atmospheric tone. Released in the fall of 1984, The Unforgettable Fire replicated the chart status of War, entering the U.K. charts at number one and reaching number 12 in the U.S. The album also generated the group's first Top 40 hit in America with \"(Pride) In the Name of Love,\" a tribute to Martin Luther King Jr. U2 supported the album with a successful international tour, highlighted by a show-stealing performance at Live Aid. Following the tour, the band released the live EP Wide Awake in America in 1985.\n\nWhile U2 had become one of the most successful rock bands of the '80s, they didn't truly become superstars until the spring 1987 release of The Joshua Tree. Greeted with enthusiastic reviews, many of which proclaimed the album a masterpiece, The Joshua Tree became U2's first American number one hit and their third straight album to enter the U.K. charts at number one; in England, it set a record by going platinum within 28 hours. Generating the U.S. number one hits \"With or Without You\" and \"I Still Haven't Found What I'm Looking For,\" The Joshua Tree and the group's supporting tour became the biggest success story of 1987, earning U2 the cover of respected publications like Time magazine. U2 decided to film a documentary about their American tour, recording new material along the way. The project became \"Rattle & Hum\", a film that was supported by a double-album soundtrack that was divided between live tracks and new material. While the album Rattle & Hum was a hit, the record and film received the weakest reviews of U2's career, with many critics taking issue with the group's fascination with American roots music like blues, soul, country, and folk. Following the release of Rattle & Hum, the band took an extended hiatus.\n\nU2 reconvened in Berlin in 1990 to record a new album with Eno and Lanois. While the sessions for the album were difficult, the resulting record, Achtung Baby, represented a successful reinvention of the band's trademark sound. Where they had been inspired by post-punk in the early career and American music during their mid-career, U2 delved into electronic and dance music with Achtung Baby. Inspired equally by late-'70s Bowie and the Madchester scene in the U.K., Achtung Baby was sonically more eclectic and adventurous than U2's earlier work, and it didn't alienate their core audience. The album debuted at number one throughout the world and spawned Top Ten hits with \"Mysterious Ways\" and \"One.\" \n\nEarly in 1992, the group launched an elaborate tour to support Achtung Baby. Dubbed Zoo TV, the tour was an innovative blend of multimedia electronics, featuring a stage filled with televisions, suspended cars, and cellular phones. Bono devised an alter ego called the Fly, which was a knowing send-up of rock stardom. Even under the ironic guise of the Fly and Zoo TV, it was evident that U2 were looser and more fun than ever before, even though they had not abandoned their trademark righteous political anger. Following the completion of the American Zoo TV tour in late 1992 and preceding the launch of the tour's European leg, U2 entered the studio to complete an EP of new material that soon became the full-length Zooropa. Released in the summer of 1993 to coincide with the tour of the same name, Zooropa demonstrated a heavier techno and dance influence than Achtung Baby and received strong reviews. Nevertheless, the album stalled at sales of two million and failed to generate a big hit single. During the subsequent Zooropa tour, the Fly metamorphosed into the demonic MacPhisto, which dominated the remainder of the tour. Upon the completion of the Zooropa tour in late 1993, the band took another extended break.\n\nDuring 1995, U2 re-emerged with \"Hold Me, Thrill Me, Kiss Me, Kill Me,\" a glam rock theme to \"Batman Forever\" that was produced by Nellee Hooper (Bj\xf6rk, Soul II Soul). Later that year, they recorded the collaborative album Original Soundtracks, Vol. 1 with Brian Eno, releasing the record under the name the Passengers late in 1995. It was greeted with a muted reception, both critically and commercially. Many hardcore U2 fans (including drummer Larry Mullen Jr.) were unhappy
2017-01-02T16:01:36.761338+00:00 app[web.1]:
2017-01-02T16:01:36.761339+00:00 app[web.1]: Traceback (most recent call last):
2017-01-02T16:01:36.761341+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gmusicapi/protocol/mobileclient.py", line 627, in validate
2017-01-02T16:01:36.761341+00:00 app[web.1]: raise_from(ValidationException(str(e)), e)
2017-01-02T16:01:36.761342+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/six.py", line 718, in raise_from
2017-01-02T16:01:36.761343+00:00 app[web.1]: raise value
2017-01-02T16:01:36.761343+00:00 app[web.1]: ValidationException: Value u'' for field '.albums[36].name' cannot be blank'
2017-01-02T16:01:36.762915+00:00 app[web.1]: 10.158.160.96 - - [02/Jan/2017 16:01:36] "POST /alexa HTTP/1.1" 200 -
2017-01-02T16:01:37.735368+00:00 heroku[router]: at=info method=GET path="//stream/T6rrxaihpq3isrg6u6t53losasq" host=whispering-depths-44089.herokuapp.com request_id=087c6e72-5933-4b37-a589-bc092be619d1 fwd="96.35.47.222" dyno=web.1 connect=0ms service=2ms status=404 bytes=382
2017-01-02T16:01:37.735432+00:00 app[web.1]: 10.142.142.206 - - [02/Jan/2017 16:01:37] "GET //stream/T6rrxaihpq3isrg6u6t53losasq HTTP/1.1" 404 -
2017-01-02T16:01:37.944536+00:00 app[web.1]: 10.138.143.17 - - [02/Jan/2017 16:01:37] "POST /alexa HTTP/1.1" 400 -
2017-01-02T16:01:37.944654+00:00 heroku[router]: at=info method=POST path="/alexa" host=whispering-depths-44089.herokuapp.com request_id=03c55381-1a5b-4c80-b963-f894f0c83465 fwd="72.21.217.100" dyno=web.1 connect=1ms service=23ms status=400 bytes=164
2017-01-02T16:03:46.223341+00:00 app[web.1]: --------------------------------------------------------------------------------
2017-01-02T16:03:46.223359+00:00 app[web.1]: DEBUG in selection [/app/geemusic/intents/selection.py:52]:
2017-01-02T16:03:46.223361+00:00 app[web.1]: Fetching song with or without you by None
2017-01-02T16:03:46.223362+00:00 app[web.1]: --------------------------------------------------------------------------------
2017-01-02T16:03:46.674164+00:00 heroku[router]: at=info method=POST path="/alexa" host=whispering-depths-44089.herokuapp.com request_id=c34b9d4f-6a63-49eb-a301-8a37bbac5e03 fwd="72.21.217.100" dyno=web.1 connect=1ms service=960ms status=200 bytes=570
2017-01-02T16:03:46.673558+00:00 app[web.1]: 10.145.25.250 - - [02/Jan/2017 16:03:46] "POST /alexa HTTP/1.1" 200 -
2017-01-02T16:03:47.746303+00:00 heroku[router]: at=info method=GET path="//stream/Tygztregatldezon7h75hxeq77i" host=whispering-depths-44089.herokuapp.com request_id=97c723e9-41c6-4f90-86a5-28d83d3d9a88 fwd="96.35.47.222" dyno=web.1 connect=0ms service=1ms status=404 bytes=382
2017-01-02T16:03:47.745715+00:00 app[web.1]: 10.109.176.159 - - [02/Jan/2017 16:03:47] "GET //stream/Tygztregatldezon7h75hxeq77i HTTP/1.1" 404 -
2017-01-02T16:03:48.126530+00:00 heroku[router]: at=info method=POST path="/alexa" host=whispering-depths-44089.herokuapp.com request_id=cda173dc-b752-48c9-b7da-402dca5a28b1 fwd="72.21.217.100" dyno=web.1 connect=1ms service=30ms status=400 bytes=164
2017-01-02T16:03:48.121887+00:00 app[web.1]: 10.154.74.169 - - [02/Jan/2017 16:03:48] "POST /alexa HTTP/1.1" 400 -
2017-01-02T16:09:49.707811+00:00 app[web.1]: 10.238.25.185 - - [02/Jan/2017 16:09:49] "GET / HTTP/1.1" 404 -
2017-01-02T16:09:49.708951+00:00 heroku[router]: at=info method=GET path="/" host=whispering-depths-44089.herokuapp.com request_id=5eda6374-a15f-42ab-8b4a-2cd5bee230af fwd="96.35.47.222" dyno=web.1 connect=0ms service=2ms status=404 bytes=382
2017-01-02T16:09:50.038385+00:00 app[web.1]: 10.238.25.185 - - [02/Jan/2017 16:09:50] "GET /favicon.ico HTTP/1.1" 404 -
2017-01-02T16:09:50.039626+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=whispering-depths-44089.herokuapp.com request_id=aeecdb7c-771c-45ab-bc3c-5a5aa1adc120 fwd="96.35.47.222" dyno=web.1 connect=1ms service=2ms status=404 bytes=382
2017-01-02T16:15:00.281483+00:00 app[web.1]: --------------------------------------------------------------------------------
2017-01-02T16:15:00.281498+00:00 app[web.1]: DEBUG in selection [/app/geemusic/intents/selection.py:52]:
2017-01-02T16:15:00.281500+00:00 app[web.1]: Fetching song with or without you by None
2017-01-02T16:15:00.281501+00:00 app[web.1]: --------------------------------------------------------------------------------
2017-01-02T16:15:00.729836+00:00 heroku[router]: at=info method=POST path="/alexa" host=whispering-depths-44089.herokuapp.com request_id=db11922a-1172-4d53-913b-b37287387453 fwd="72.21.217.162" dyno=web.1 connect=1ms service=1158ms status=200 bytes=570
2017-01-02T16:15:00.731896+00:00 app[web.1]: 10.171.127.156 - - [02/Jan/2017 16:15:00] "POST /alexa HTTP/1.1" 200 -

Docker Support

If you're looking to implement a feature, please open an issue before creating a PR so I can review it and make sure it's something that should be added.

Okay!

I use containers to host individual servers I use locally, so I'd like to have this running in a container. I've already built this into a container locally, so I'd like to contribute the Dockerfile back upstream. It's written based on the instructions you have here.

Then, if you wanted to, you could create an account on the docker hub and have it run a DTR automatically on changes to the repository, so that it would always be up to date, and people could download it with "docker pull stevenleeg/geemusic:latest" or something similar.

If you'd like to see what I've written, I have it here: https://github.com/kuruoujou/geemusic/blob/docker/Dockerfile

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.