dweinstein / node-google-play

Get details and download apps from https://play.google.com by emulating an Android (Nexus 5X) device by default. For a rust version of this library check out https://github.com/dweinstein/rs-google-play
MIT License
271 stars 84 forks source link

Login Error CaptchaRequired #107

Closed SpeedxPz closed 4 years ago

SpeedxPz commented 5 years ago

Here is the response

{ response: { debugId: 1, headers: { 'content-type': 'text/plain; charset=utf-8', 'cache-control': 'no-cache, no-store, max-age=0, must-revalidate', pragma: 'no-cache', expires: 'Mon, 01 Jan 1990 00:00:00 GMT', date: 'Fri, 01 Nov 2019 16:02:22 GMT', 'content-encoding': 'gzip', 'x-content-type-options': 'nosniff', 'x-frame-options': 'SAMEORIGIN', 'x-xss-protection': '1; mode=block', server: 'GSE', 'alt-svc': 'quic=":443"; ma=2592000; v="46,43",h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000', connection: 'close', 'transfer-encoding': 'chunked' }, statusCode: 403, body: 'Error=CaptchaRequired\nCaptchaToken=AAWk9lT_GvhoOVlceuOjWjLldIo6G00P4FCyNjAwBv5C-UWT1m-kXcCS3iRA77Erk4NlL5bEHsRHdbyBZ2IjH4UjruF1Vk9P01s9VbqZk3Qu_1I9gyWmNrDViTref0Tv8-HOCQ6QdBhADj9qkWGAjLruFkt4wSqAAdno2oWn50K-gt8H6tIGmoE\nCaptchaUrl=https://accounts.google.com/Captcha?ctoken=AAWk9lT_GvhoOVlceuOjWjLldIo6G00P4FCyNjAwBv5C-UWT1m-kXcCS3iRA77Erk4NlL5bEHsRHdbyBZ2IjH4UjruF1Vk9P01s9VbqZk3Qu_1I9gyWmNrDViTref0Tv8-HOCQ6QdBhADj9qkWGAjLruFkt4wSqAAdno2oWn50K-gt8H6tIGmoE&v=2' } }

dweinstein commented 5 years ago

yeah seems google stopped accepting the login we're using, so gonna have to update the procedure

keyofd commented 5 years ago

Update your node version, I will resume normal after updating to v8.11

keyofd commented 5 years ago

yeah seems google stopped accepting the login we're using, so gonna have to update the procedure

Why did the exception disappear after the node version was upgraded from V6 to V8.11?

orgoldfus commented 5 years ago

Update your node version, I will resume normal after updating to v8.11

I tried both node v10.16.0 and v8.11.4 and I get the same captcha error...

AviFix commented 5 years ago

I'm using node 11.12 and i still get the CaptchaRequired error

orgoldfus commented 5 years ago

I managed to get it work with node v8.16.2 (No idea why). Make sure you remove your node_modules and run npm install again (after changing the node version)

keyofd commented 4 years ago

I managed to get it work with node v8.16.2 (No idea why). Make sure you remove your node_modules and run npm install again (after changing the node version)

amazing

mmoksh commented 4 years ago

I managed to get it work with node v8.16.2 (No idea why). Make sure you remove your node_modules and run npm install again (after changing the node version)

This worked for me at first, but now the login script produces an error: {"message":"Error=UNKNOWN_ERR","name":"LoginError"}

Sometimes, the same script works after several attempts.

ShaunLWM commented 4 years ago

I managed to get it work with node v8.16.2 (No idea why). Make sure you remove your node_modules and run npm install again (after changing the node version)

This worked for me at first, but now the login script produces an error: {"message":"Error=UNKNOWN_ERR","name":"LoginError"}

Sometimes, the same script works after several attempts.

Having this error as well. No successful login till now. I wonder if something has changed.

{ response:
   { debugId: 1,
     headers:
      { 'content-type': 'text/plain; charset=utf-8',
        'cache-control': 'no-cache, no-store, max-age=0, must-revalidate',
        pragma: 'no-cache',
        expires: 'Mon, 01 Jan 1990 00:00:00 GMT',
        date: 'Sat, 09 Nov 2019 05:17:03 GMT',
        'content-encoding': 'gzip',
        'x-content-type-options': 'nosniff',
        'x-frame-options': 'SAMEORIGIN',
        'x-xss-protection': '1; mode=block',
        server: 'GSE',
        'alt-svc': 'quic=":443"; ma=2592000; v="46,43",h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000',
        connection: 'close',
        'transfer-encoding': 'chunked' },
     statusCode: 404,
     body: 'Error=UNKNOWN_ERR' } }

If you guys don't mind me quoting from another Python project, this line seems to be working well even with the basic parameters and headers.

aspdesigner commented 4 years ago

any progress? Could this error because of Nodejs?

aspdesigner commented 4 years ago

based on https://developers.google.com/identity/protocols/AuthForInstalledApps to overcome captcha, i add captcha text as value of parameter 'logincaptcha' and captcha token as value of parameter 'logintoken' but something seems wrong!

orgoldfus commented 4 years ago

The PR above should fix the UNKNOWN_ERR. Besides that, I think it worth mentioning in the README that this package doesn't work with node version > 9

archon810 commented 4 years ago

The sdk fix has been known for a while https://github.com/yeriomin/play-store-api/pull/40, but it doesn't fix the CaptchaRequired issue.

orgoldfus commented 4 years ago

@archon810 The CaptchaRequired is solved if you use node 8 or 9.

archon810 commented 4 years ago

How can this be possible - is there a technical explanation for why node version would affect captchas? Could it be related to it using a different user agent or something?

orgoldfus commented 4 years ago

Unfortunately, I still haven't found an explanation, but it's still working on Node 8 and 9 but doesn't on other versions...

ShaunLWM commented 4 years ago

Forcing the node version to be on 8.16.2 works for me as well. Using nvm to to change to 13.1.0 caused it to have the captcha error. Subsequently, swapping back to 8.16.2 just works. I really have no idea why this is happening.

mohammed-ali-1 commented 4 years ago

I just tried on Node version 8.16.2 and it's giving me the following error:

LoginError: Error=UNKNOWN_ERR
orgoldfus commented 4 years ago

@mohammed-ali-1 You can try working with my branch until it gets merged https://github.com/dweinstein/node-google-play/pull/114

mohammed-ali-1 commented 4 years ago

@orgoldfus Thanks a lot! Amazing.

hoffie commented 4 years ago

Forcing the node version to be on 8.16.2 works for me as well. Using nvm to to change to 13.1.0 caused it to have the captcha error. Subsequently, swapping back to 8.16.2 just works. I really have no idea why this is happening.

I have analyzed this issue in another project which uses the same API (Android App Aurora Store). My results so far are that Google seems to decide whether the require a Captcha by analyzing TLS protocol details. More specifically, I was able to make it work by forcing specific ciphers and disabling ALPN.

I have no idea if this is the key insight for NodeJS v8 vs. v9 as well, but it may be worth investigating as the Node Changelog shows differences in TLS and ALPN handling, from a quick glance.

I am detailing my results here: https://gitlab.com/AuroraOSS/AuroraStore/issues/217#note_249390026

orgoldfus commented 4 years ago

Forcing the node version to be on 8.16.2 works for me as well. Using nvm to to change to 13.1.0 caused it to have the captcha error. Subsequently, swapping back to 8.16.2 just works. I really have no idea why this is happening.

I have analyzed this issue in another project which uses the same API (Android App Aurora Store). My results so far are that Google seems to decide whether the require a Captcha by analyzing TLS protocol details. More specifically, I was able to make it work by forcing specific ciphers and disabling ALPN.

I have no idea if this is the key insight for NodeJS v8 vs. v9 as well, but it may be worth investigating as the Node Changelog shows differences in TLS and ALPN handling, from a quick glance.

I am detailing my results here: https://gitlab.com/AuroraOSS/AuroraStore/issues/217#note_249390026

I spent hours trying to find a difference between node 8 and node 10 requests and didn't find a thing. Great work @hoffie!