hechtus / squeezebox-googlemusic

Squeezebox (Logitech Media Server) Plugin for Google Play Music
103 stars 24 forks source link

Login error #84

Open flo2587 opened 9 years ago

flo2587 commented 9 years ago

Hello,

Plugin can't connect to my Google account. I have this error in the /var/log/squeezeboxserver/server.log : [15-05-20 22:28:24.0094] Plugins::GoogleMusic::Plugin::initPlugin (94) Not able to login to Google Play Music: exceptions.TypeError: login() takes exactly 4 arguments (3 given) at (eval 883) line 182. Any idea ? Thank you Regard

nick7634 commented 9 years ago

The unofficial google api has a new login method that breaks this plugin. I have fixed the problem in the plugin.pm file and made a merge request, but it has not be approved yet. https://github.com/hechtus/squeezebox-googlemusic/pull/83/files

nick7634 commented 9 years ago

If you dont know how to edit the plugin.pm file. You can try changing the repo from http://hechtus.github.io/squeezebox-googlemusic/repository/repo.xml to http://nick7634.github.io/squeezebox-googlemusic/repository/repo.xml Until hechtus updates the main branch

flo2587 commented 9 years ago

It works ! Thank you ! :)

mikeybs commented 9 years ago

much appreciated, thank you

I was trying to figure this out myself, where did you track this change in the unofficial google music api?

I was referencing the docs

http://unofficial-google-music-api.readthedocs.org/en/latest/reference/mobileclient.html#setup-and-login

but I didn't notice any change there

was there anywhere this API change was published?

nick7634 commented 9 years ago

The change doesn't seem to be posted in the docs, I saw the change in the login method in the commit made on the 14th for the mobileclient found here. https://github.com/simon-weber/Unofficial-Google-Music-API/commit/18492674494cdd12e6e3bef718c569506391d53a

noname4835 commented 9 years ago

I tried to upgrade to your modified version, but I got a "digest does not match" message in the server log.

How to get it work?

nick7634 commented 9 years ago

That was my fault, I was rushing the github repo setup and made a few mistakes in changing the version number and hash. Everything should be up and working now.

ghost commented 9 years ago

Thanks for fixing this! It's good to have this project supported by more people!

noname4835 commented 9 years ago

Mercí! :+1:

madattack commented 9 years ago

Hi, I installed the plug-in from your repo but it still isn't connecting. Version displayed in Plugin list says 0.4.2 Log file says: Plugins::GoogleMusic::Plugin::initPlugin (95) Not able to login to Google Play Music: exceptions.TypeError: login() takes exactly 3 arguments (4 given) at (eval 930) line 176. Thanks for some help in advance.

nick7634 commented 9 years ago

You have to update to the latest unofficial google music api from the develop branch.

pip install git+https://github.com/simon-weber/Unofficial-Google-Music-API.git@develop

madattack commented 9 years ago

awesome, now it works !!! thank you very much

davein2it commented 9 years ago

Hi, I installed the plug-in from your repo but it still isn't connecting. Version displayed in Plugin list says 0.4.2 Log file says: Plugins::GoogleMusic::Plugin::initPlugin (95) Not able to login to Google Play Music: exceptions.TypeError: login() takes exactly 3 arguments (4 given) at (eval 930) line 176. Thanks for some help in advance.

Installed the development API also not sure what to do next.

sudo pip install git+https://github.com/simon-weber/Unofficial-Google-Music-API.git@develop sudo: unable to resolve host max2play Collecting git+https://github.com/simon-weber/Unofficial-Google-Music-API.git@develop Cloning https://github.com/simon-weber/Unofficial-Google-Music-API.git (to develop) to /tmp/pip-ntS9RI-build /usr/lib/python2.7/dist-packages/setuptools/command/install_scripts.py:3: UserWarning: Module pip was already imported from /usr/local/lib/python2.7/dist-packages/pip/init.pyc, but /usr/lib/python2.7/dist-packages is being added to sys.path from pkg_resources import Distribution, PathMetadata, ensure_directory Requirement already satisfied (use --upgrade to upgrade): gmusicapi==5.0.0-dev from git+https://github.com/simon-weber/Unofficial-Google-Music-API.git@develop in ./local/lib/python2.7/dist-packages Requirement already satisfied (use --upgrade to upgrade): validictory!=0.9.2,>=0.8.0 in ./local/lib/python2.7/dist-packages (from gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): decorator>=3.3.1 in ./local/lib/python2.7/dist-packages (from gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): mutagen>=1.18 in ./local/lib/python2.7/dist-packages (from gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): protobuf>=2.4.1 in ./local/lib/python2.7/dist-packages (from gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): requests!=1.2.0,!=2.2.1,>=1.1.0 in ./local/lib/python2.7/dist-packages (from gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): python-dateutil!=2.0,>=1.3 in ./local/lib/python2.7/dist-packages (from gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): proboscis>=1.2.5.1 in ./local/lib/python2.7/dist-packages (from gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): oauth2client>=1.1 in ./local/lib/python2.7/dist-packages (from gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): mock>=0.7.0 in ./local/lib/python2.7/dist-packages (from gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): appdirs>=1.1.0 in ./local/lib/python2.7/dist-packages (from gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): gpsoauth>=0.0.2 in ./local/lib/python2.7/dist-packages (from gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): setuptools in ./lib/python2.7/dist-packages (from protobuf>=2.4.1->gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in ./local/lib/python2.7/dist-packages (from python-dateutil!=2.0,>=1.3->gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): httplib2>=0.8 in ./local/lib/python2.7/dist-packages (from oauth2client>=1.1->gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): pyasn1==0.1.7 in ./local/lib/python2.7/dist-packages (from oauth2client>=1.1->gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): pyasn1-modules==0.0.5 in ./local/lib/python2.7/dist-packages (from oauth2client>=1.1->gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): rsa==3.1.4 in ./local/lib/python2.7/dist-packages (from oauth2client>=1.1->gmusicapi==5.0.0-dev) Requirement already satisfied (use --upgrade to upgrade): pycrypto in ./local/lib/python2.7/dist-packages (from gpsoauth>=0.0.2->gmusicapi==5.0.0-dev)

davein2it commented 9 years ago

Post script the plugin seem to be working just stuck at the authentication layer. Going to uninstall pip and python then reinstall.

Tbower commented 9 years ago

davein2it...

Will you please post back and let us know if that worked for you?

I'm having the same issue....have upgraded pip, and actually uninstalled/reinstalled gmusic api from dev branch (5.0.0-dev), but still no joy. Have not tried reinstalling python.

Continue to get the authentication error:

[15-06-04 11:11:56.7879] Plugins::GoogleMusic::Plugin::initPlugin (95) Not able to login to Google Play Music: exceptions.TypeError: login() takes exactly 3 arguments (4 given) at (eval 1016) line 176.

Thanks in advance...

chrisd53 commented 9 years ago

Same experience with not working. Worked fine till I rebooted LMS yesterday and now no login. Followed all above fixes - no login. Signed up to Spotify to keep the music coming. Thank you to all with knowledge working on a solution.

nick7634 commented 9 years ago

The latest version of the Unofficial-Google-Music-API as of June 1st, no longer requires the device id to login. My version of the plug in should be removed and reverted back to hechtus' original repo as it is function again.

chrisd53 commented 9 years ago

Thanks nick7634 Did original repo but still no login. Uninstalled plugin, then rebooted. Then: pip uninstall gmusicapi Then: pip install git+https://github.com/simon-weber/Unofficial-Google-Music-API.git@develop Reboot Original repo Reboot Working! Thank you

Tbower commented 9 years ago

Well OK then.

Followed same basic steps as chrisd53, and all is well for me now!

Thanks!

asplundj commented 9 years ago

I followed chrisd53 steps but it still doesn't work. It says that I have v 0.41 of the plugin.When I try to enter my username/password I get this: "Not logged in to Google Play Music. Set your username and password. No mobile device (phone or tablet) registered for Google Play Music. Not able to obtain the mobile device ID automatically."

ghost commented 9 years ago

You should have 0.4.2 from the forked repo...

asplundj commented 9 years ago

With the forked repo do you mean http://nick7634.github.io/squeezebox-googlemusic/repository/repo.xml ?

I've tried that and it gives me v. 0.42 but I still can't login. However, the steps outlined by chrisd53 says that one should use the original repo.

ghost commented 9 years ago

Sorry, I missed the last few messages...

I'll check whether mine still works.

calipoop commented 9 years ago

I also have the same issue - has there been any update/progress? I'm running gmusicapi 5.0 and google music plugin 4.1. Getting the "Plugin failed to load" error. Thanks for your help!

asplundj commented 9 years ago

calipoop: that seems to be a different issue. For me the plugin loads but I can't log in

srasher commented 9 years ago

Hi all,

I am sorry if I am just mixing up stuff but so far I could not reproduce the solution reported by chrisd53.

I have done several iterations with uninstalling and re-installing everything from scratch, with both, the original and nick7634's repos. But I always got the originally reported error message about the number of arguments in the login() method.

Currently I am on nick7634's repo and the latest develop branch gmusicapi ("7.0.0-dev0", just in case someone can point me to something even newer).

This also doesn't work, UNLESS I activate the "No SSL verification" button in the plugin settings. After doing that, I got access to GPM-All Access and "My Music" again (sorry if the terms are not 100% correct, I am German and don't actually know the exact English terms for the settings).

This is OK as a workaround but somehow unsatisfying/worrying. To be honest, I don't know how dangerous it is to use the plugin without SSL verification (at first glance sounds like a no-go to me), so if someone can shed some light on this for me, I would be extremely thankful.

As an additional info, I never had trouble with this before the problem discussed in this issue here occured, so it always worked with SSL verification before.

Thanks for any help/hint on this in advance!

Cheers, Seb

mikeybs commented 9 years ago

Doing a fresh install things do not work as hoped. It seems the latest version of dev gmusicapi 5.0 still requires the changes made by nick7634

If I do not modify Plugin.pm and Settings.pm then I get: Not able to login to Google Play Music: exceptions.TypeError: login() takes exactly 4 arguments (3 given) at (eval 883) line 182.

If I make the changes then the plugin is not able to retrieve the mobile device ID on its own and I get: Plugins::GoogleMusic::Plugin::initPlugin (95) Not able to login to Google Play Music: exceptions.ValueError: android_id cannot be None. at line 51

If I manually put in the correct mobile device ID then I am able to get things working properly

UltraSalem commented 9 years ago

Just trying this out for the first time today. What worked for me was: Repo: http://nick7634.github.io/squeezebox-googlemusic/repository/repo.xml gmusic api: sudo pip install git+https://github.com/simon-weber/Unofficial-Google-Music-API.git@develop

Plug in settings: gmail addy one-time password using two-factor password generation entered mobile device ID taken from an app on my android phone called Device ID by redphx Disable SSL was ticked.

Thanks to all in this thread for the various bits of the puzzle.

Prindle19 commented 9 years ago

I have the forked Repo and the latest gmusic api built.

I can now see my library, see All Access, etc, but when I try to play. Nothing.

Logs say: lugins::GoogleMusic::ProtocolHandler::getNextTrack (103) Looking up stream url for url googlemusic:track:5b867b96-4a36-3490-b1f3-0af2eddf2c69 failed: CallFailure: GetStreamUrl: 403 Client Error: Forbidden

DaBurgi commented 9 years ago

Same here (like Prindle19): i see the library, all stations etc. When i try to play, all titles will be shown in the queue with cover and metainfo. But "streaming" the song is denied with:

(requests kwargs: {'url': 'https://android.clients.google.com/music/mplay', 'headers': {'X-Device-ID': 'C611E97CFACXXXXX, 'Authorization': ''}, 'allow_redirects': False, 'params': {'opt': 'hi', 'mjck': u'Tmliejlfvah33yvpdwhq6jfs3um', 'pt': 'e', 'slt': '1436282607484', 'sig': '20KcvIL_T2ZJUOmuQhWy-E8VTpQ', 'net': 'mob'}, 'method': 'GET'}) (response was: '\n\nForbidden</T I T L E>\n</H E A D>\n\n<H 1>Forbidden</H 1>\n<H 2>Error 403</H 2>\n</B O D Y>\n</H T M L>\n') at line 2 [15-07-07 17:23:27.6230] Plugins::GoogleMusic::ProtocolHandler::getNextTrack (103) Looking up stream url for url googlemusic:track:Tc4qfw27tvgvy7lqezsxolq4oyq failed: CallFailure: GetStreamUrl: 403 Client Error: Forbidden"

Checked my android device id twice... any ideas?

DaBurgi commented 9 years ago

Got it solved now! The Android Mobile Device ID (which was shown by playstore app "DeviceID" was NOT working. I copied the DeviceID out of the HTML code from the play.google.com/music, account settings, device list: looking like this: data-device-id="0x36cf712345678901" and removed the leading 0x. So, using 36cf712345678901 works again.

Prindle19 commented 9 years ago

Tried with a bunch of different device-ids, still not working for me.

dickwall commented 9 years ago

Hey - I notice in the update that the login call in Login has been updated to include the device ID, but there is a second one in Settings (for the settings page) that also needs to be updated and has not. Since my device ID was also out of date I was unable to update it because of this being wrong. Correcting the problem in the Settings perl file got it to save and then work correctly.

asplundj commented 9 years ago

Where do I find the settings perl file?

Skickat från min Sony Xperia™-smartphone

---- Dick Wall skrev ----

Hey - I notice in the update that the login call in Login has been updated to include the device ID, but there is a second one in Settings (for the settings page) that also needs to be updated and has not. Since my device ID was also out of date I was unable to update it because of this being wrong. Correcting the problem in the Settings perl file got it to save and then work correctly.

— Reply to this email directly or view it on GitHub.

MaestroZ commented 9 years ago

Hi, I modifiedsettings.pm too (handler sub calls login method too without device id) I don't have the wrong number of parameters error anymore But I get this now : Plugins::GoogleMusic::Plugin::initPlugin (95) Not able to login to Google Play Music: SSLError: hostname 'android.clients.google.com' doesn't match either of '.google.com', '.android.com', '.appengine.google.com', '.cloud.google.com', '.google-analytics.com', '.google.ca', '.google.cl', '.google.co.in', '.google.co.jp', '.google.co.uk', '.google.com.ar', '.google.com.au', '.google.com.br', '.google.com.co', '.google.com.mx', '.google.com.tr', '.google.com.vn', '.google.de', '.google.es', '.google.fr', '.google.hu', '.google.it', '.google.nl', '.google.pl', '.google.pt', '.googleadapis.com', '.googleapis.cn', '.googlecommerce.com', '.googlevideo.com', '.gstatic.cn', '.gstatic.com', '.gvt1.com', '.gvt2.com', '.metric.gstatic.com', '.urchin.com', '.url.google.com', '.youtube-nocookie.com', '.youtube.com', '.youtubeeducation.com', '.ytimg.com', 'android.com', 'g.co', 'goo.gl', 'google-analytics.com', 'google.com', 'googlecommerce.com', 'urchin.com', 'youtu.be', 'youtube.com', 'youtubeeducation.com' at line 64

The hostname used for authentication is not correct I don't know how to solve this.

MaestroZ

samkarpluk commented 9 years ago

I'm getting the same error @MaestroZ reported 5 days ago: SSLError...

dustinsterk commented 8 years ago

I got mine working!

Run in order: yum install gcc libffi-devel python-devel openssl-devel pip install cryptography pip install pyopenssl ndg-httpsclient pyasn1

No more SSLError and successful google music on vortexbox 2.3 LMS 7.9! More info here: http://forums.slimdevices.com/showthread.php?98526-Google-Music-Plugin/page11

hechtus commented 8 years ago

I'm really sorry, not being able to respond for such a long time. I'm swamped with other things. So, if someone one to take over and continue to work on this plugin, please let me know. I'd like to give full access to this project.

askvictor commented 8 years ago

@hechtus @nick7634 I'm interested in updating this to the latest API; I'm quite proficient in python and used to work in perl. However, I have no idea where to start with debugging a squeezebox setup. Can you point me to how I'd get started?

askvictor commented 8 years ago

@nick7634 - are you still working on this? I'm interested in making this work properly (including fixing documentation)

nick7634 commented 8 years ago

@askvictor - I haven't had any free time to keep up with this plugin due to work. I've also don't have much experience in python. I was originally able to fix this plugin quickly by looking through the GMusicAPI commits to see how the login and other methods were updated. If you want a good place to start, I would look at the commits/changes made to the GMusicAPI repo to figure out what needs updating in this plugin. I know there were a lot of methods I never updated when I worked on it, I was mainly concerned with quickly getting the login to work again.

My work is finally starting to wind down over the next few weeks, so I may be able to look over the code soon.

askvictor commented 8 years ago

@nick7634 @hechtus I've started a github team https://github.com/squeezebox-googlemusic where I hope development can take place - I figure a few part-time devs might keep this rolling better. @hechtus - are you interested in transferring ownership of this repo to the team? @nick7634 - do you want to join this team and perform further dev work off that?