Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Login failed. Ensure that correct credentials are provided. #3

Closed
PacoH opened this issue Jul 1, 2019 · 16 comments
Closed

Login failed. Ensure that correct credentials are provided. #3

PacoH opened this issue Jul 1, 2019 · 16 comments

Comments

@PacoH
Copy link

PacoH commented Jul 1, 2019

This used to work. Now it doesn't, even with valid credentials.

$ gplaydl -id com.whatsapp
Login failed. Ensure that correct credentials are provided.

@mysticaltech
Copy link

Same here! What could be happening?

@worldofprasanna
Copy link

Yes. For me too !!

@arbitraryrw
Copy link

arbitraryrw commented Jan 19, 2020

Looks like the response from the GooglePlayAPI.login has changed for one reason or another. This means the token key referenced for login will be None. I imagine this is why your logins are failing.

The snippet below is what the current dictionary response looks like from GooglePlayAPI.login:

{
'authSubToken': None, 
'gsfId': None, 
'device_config_token': None, 
'deviceCheckinConsistencyToken': None, 
'dfeCookie': None, 
'proxies_config': None, 
'deviceBuilder'None
}

Update:
gplaydl/blob/master/gplaydl/gplaydl.py actually does correctly reference authSubToken, this shouldn't be a problem.

@PacoH
Copy link
Author

PacoH commented Jan 19, 2020

the token key referenced for login will be None. I imagine this is why your logins are failing.

So what can we, the users, do about it?

@arbitraryrw
Copy link

Just looked through the source a bit more thoroughly, it is correctly referencing authSubToken. I'm building something on top of the googleplay-api which this tool is built on, if I find any issues I'll make sure to update.

@PacoH
Copy link
Author

PacoH commented Jan 19, 2020

I'm building something on top of the googleplay-api which this tool is built on, if I find any issues I'll make sure to update.

Oh. that would be great. Thanks a lot.

@rehmatworks
Copy link
Owner

Are you using app passwords? Regular passwords will trigger a security challenge at Google's end. I ran a test and all looks fine for me. It works pretty well. Ensure that you are using app passwords. I'll do more testing and I'll release an upgrade if something needs a rewrite.

@PacoH
Copy link
Author

PacoH commented Apr 21, 2020

What 'app passwords' are you talking about? You mean API keys? That would be ridiculous since getting one isn't free.

The gplaydl help clearly states:

gplaydl
usage: gplaydl [-h] [-c] [-id PACKAGEID] [-e EMAIL] [-p PASSWORD]
			   [-d STORAGEPATH] [-dc DEVICECODE] [-ex]
-e EMAIL, --email EMAIL
						Google username
-p PASSWORD, --password PASSWORD
						Google password

I tried both without and with single and double quotes (not specified in help), and username alone and email address, which I always use to log in to Google, and still, nothing works.

You need to be very specific when answering a question and give an actual example of what worked for you in order for your answer to be of help.

@PacoH
Copy link
Author

PacoH commented Apr 21, 2020

I even uninstalled and reinstalled the app

Successfully uninstalled gplaydl-1.0.3
Successfully installed gplaydl-1.0.3

and added credentials to config file

gplaydl --configure -e email@gmail.com -p passwordOrAppPassword
Configuration file created successfully! Try downloading an APK file now.

Still getting:

Login failed. Ensure that correct credentials are provided.

I am even already logged in to my account in Chrome.

@rehmatworks
Copy link
Owner

@PacoH I've released a major upgrade. Even the old version was working fine for me (on Ubuntu servers and on my Macbook Pro), but that was using an older version of gpapi. Now I've published a custom version of gpapi and I'm using it for gplaydl.

To upgrade to the latest version, execute this in your terminal:

pip3 install --upgrade --force-reinstall gplaydl

In terms of app passwords, they aren't like the API keys. Would you kindly do a Google search? You should be able to set up an application-specific password within 5 minutes. If you can't find help from Google, follow these instructions:

  1. Go to your Google account settings
  2. Go to "Security Settings" & and then enable 2-factor auth on your account
  3. Once 2-factor auth is enabled, create an app password here

And then use that app password in place of your regular account password. Once you have your login info, write the following command in terminal:

gplaydl configure

And hit enter. You will be asked for your Google email and password. Provide your Google email and app password. If all goes well, your auth config will be configured.

Now try downloading an app:

gplaydl download --packageId com.twitter

And please check the readme in the main repo for complete documentation. To improve the code and overall functionality of the package, I have rewritten a major part of it and commands are changed too. I hope you will love the new version.

I hope this explanation addresses the issues for all of you.

@PacoH
Copy link
Author

PacoH commented Apr 24, 2020

OK. Thanks. I upgraded and now it doesn't even run.

gplaydl
Traceback (most recent call last):
  File "/usr/local/bin/gplaydl", line 7, in <module>
	from gplaydl.gplaydl import main
  File "/usr/local/lib/python3.6/site-packages/gplaydl/gplaydl.py", line 9, in <module>
	import validators
ModuleNotFoundError: No module named 'validators'

@rehmatworks
Copy link
Owner

pip3 install validators

BTW this module should get installed itself. I don't know what went wrong. Please run pip3 install validators and that should fix your issue.

@rehmatworks
Copy link
Owner

Strangely, the requirements were removed from setup.py file. Thank you for reporting this issue. I've added the requirements in setup.py file as well as have included a requirements.txt file too. Now installing the package from PyPi forcing a reinstall i.e. pip3 install --upgrade --force-reinstall gplaydl should work.

@PacoH
Copy link
Author

PacoH commented Apr 24, 2020

Thanks! pip3 install validators worked with existing and uninstalling/reinstalling worked as well. I see syntax has changed and creating config file is easier. I only added gmail and password, no app password. This is great. Good support.

@rehmatworks
Copy link
Owner

That's great. I'm closing this issue for now considering that the issue should be addressed for all users by the latest upgrade.

@nazarwaheed
Copy link

That's great. I'm closing this issue for now considering that the issue should be addressed for all users by the latest upgrade.

AoA Rehmat

I am trying to use this api but unfortunately, the 'server says: BadAuthentication' error keeps coming up - I have generated app password and using it but still does not work - any help will be appreciated - I need to Download APKs from Google Play directly. Thanks

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

No branches or pull requests

6 participants