Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Seemingly random failed Mobileclient logins #584

Closed
christopher-dG opened this issue Oct 31, 2017 · 14 comments
Closed

Seemingly random failed Mobileclient logins #584

christopher-dG opened this issue Oct 31, 2017 · 14 comments

Comments

@christopher-dG
Copy link
Contributor

A couple people are seeing this here: christopher-dG/gpymusic#36

I figured I'd post a heads up while it's still developing in case you have any insights.

@simon-weber
Copy link
Owner

Huh. I haven't heard of any issues and CI seems to be working fine.

Best idea I've got is to look at the full output of gpsoauth here. That might give a hint as to what's going on.

@prestonconnors
Copy link

prestonconnors commented Nov 9, 2017

I just attempted to use gmusicapi and am not able to sign in either, here is the output of gpsoauth:

{u'Url': u'<redacted>', u'ErrorDetail': u'To access your account, you must sign in on the web. Touch Next to start browser sign-in.', u'Error': u'NeedsBrowser'}

The code I was running was:
api = Mobileclient()
logged_in = api.login(username, password, Mobileclient.FROM_MAC_ADDRESS)

@prestonconnors
Copy link

It looks like I had to enable 2 step authentication on my Google account and then create an app password! I'm now logged in. It would be helpful if enabling 2 step authentication / app password creation was noted somewhere in the gmusicapi documentation.

@christopher-dG
Copy link
Contributor Author

Very interesting. 2FA is definitely not a requirement for this, so there must be something weird going on.

@simon-weber
Copy link
Owner

Nice find. My bet would be that Google's ATO detection got a bit more sophisticated, and that app passwords are treated as more trustworthy than a normal login.

@ndtreviv
Copy link

I'm also struggling with this. I can authenticate via a docker container locally, but not when running python locally, or at all on heroku - all failed authentications. I'll try what @prestonconnors did.

@ndtreviv
Copy link

So enabling 2FA and adding an app password, then using that app password as my "ANDROID_ID" still didn't work for me. Sad times. How come the old Webclient used to work without the ANDROID_ID and now we need one? Can't the Mobileclient use the same system if there is no ANDROID_ID?

@ndtreviv
Copy link

I can confirm that the Webclient login works just fine for me, which makes me believe that it's related to the ANDROID_ID

@simon-weber
Copy link
Owner

Behind the scenes each client only accepts auth from their respective system: google play services oauth vs normal google SSO. Details are in https://github.com/simon-weber/gmusicapi/blob/develop/gmusicapi/session.py.

The app password is intended to be passed in place of your password rather than the android id: does that work for you?

@ndtreviv
Copy link

ndtreviv commented Dec 1, 2017

That works like a charm. Thanks!

@cmrace
Copy link

cmrace commented Dec 17, 2017

I had this problem as well. I got around it (by accident) without 2fa by replacing 'Mobileclient.FROM_MAC_ADDRESS' with my actual device id. To find that, run self.api.login(email, password, '1234567890abcdef'). It should return an error message saying that id is invalid (duh). It then lists valid device ids - choose the 16 digit one.

Be careful, only '1234567890abcdef' will work! Other bogus ids just return False.

@simon-weber
Copy link
Owner

More discussion on the client id angle in #589.

@jetk
Copy link

jetk commented Jan 16, 2018

Just in case anyone else finds this thread - I got gpymusic working after using the bodge from @cmrace to get my device ID (have 2FA, set up app password and used that along with my email for credentials, passing them into gmusicapi directly in an intepreter, 3.6 FWIW). I tried to oauth after that which failed but I assume that's because i have a full music account. After that python bin/gpymusic seems to do the trick.

@simon-weber
Copy link
Owner

Since this was related to device ids, I'm going to merge this with #590.

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

No branches or pull requests

6 participants