matlink / gplaycli

Google Play Downloader via Command line
Other
1.01k stars 178 forks source link

[ERROR] Cannot retrieve email address from token dispenser #292

Closed pitsi closed 1 year ago

pitsi commented 2 years ago

Please provide those informations:

Here is the full verbose output that shows all the above, e.g. when trying to download brave

$ gplaycli -v -d com.brave.browser
[INFO] GPlayCli version 3.29 [Python3.9.11] 
[INFO] Configuration file is /etc/gplaycli/gplaycli.conf
[INFO] Device is bacon
[Errno 2] No such file or directory: '/home/user/.cache/gplaycli/token'
[INFO] Cache file does not exists or is corrupted
[INFO] Retrieving token ...
[INFO] Token URL is https://matlink.fr/token
[ERROR] Cannot retrieve email address from token dispenser
Traceback (most recent call last):
  File "/usr/bin/gplaycli", line 33, in <module>
    sys.exit(load_entry_point('gplaycli==3.29', 'console_scripts', 'gplaycli')())
  File "/usr/lib/python3/dist-packages/gplaycli/gplaycli.py", line 666, in main
    cli.download(args.download)
  File "/usr/lib/python3/dist-packages/gplaycli/hooks.py", line 8, in check_connection
    ok, err = self.connect()
  File "/usr/lib/python3/dist-packages/gplaycli/gplaycli.py", line 413, in connect
    self.retrieve_token()
  File "/usr/lib/python3/dist-packages/gplaycli/gplaycli.py", line 194, in retrieve_token
    raise ERRORS.TOKEN_DISPENSER_SERVER_ERROR
TypeError: exceptions must derive from BaseException

Opening the token url in a browser results to a 502 error, so I assume this is the reason everything else fails. I do not have an own token, neither I want to use credentials.

pitsi commented 2 years ago

Could this be related to #263?

pitsi commented 2 years ago

Adding to the issue, I copied /etc/gplaycli/gplaycli.conf to my home directory, changed the dispenser url to goolag.store:1337 which supposedly works, and launched gplay cli with -c gplaycli.conf. But it gets stuck at the token retrieval forever

$ gplaycli -v -d com.brave.browser -c gplaycli.conf 
[INFO] GPlayCli version 3.29 [Python3.9.11] 
[INFO] Configuration file is ['gplaycli.conf']
[INFO] Device is bacon
[Errno 2] No such file or directory: '/home/user/.cache/gplaycli/token'
[INFO] Cache file does not exists or is corrupted
[INFO] Retrieving token ...
[INFO] Token URL is https://goolag.store:1337/

---edit Any previous and following posts related to 89z's app were deleted and he is now blocked on my end.

pitsi commented 2 years ago

Adding some insult to the injury. Leaving the token aside, I decided to use gplaycli with my own google credentials. And it fails to authenticate, saying that my username and/or password may be incorrect!

$ gplaycli -v -d com.brave.browser -c gplaycli.conf 
[INFO] GPlayCli version 3.29 [Python3.9.12] 
[INFO] Configuration file is ['gplaycli.conf']
[INFO] Device is bacon
[INFO] Using credentials to connect to API
[INFO] Using plaintext password
[ERROR] Bad authentication, login or password incorrect ('server says: BadAuthentication')

Obviously, there is nothing wrong with the credentials. I tried them in a browser and they worked with zero issues. And it makes no difference whether I enable access to less secure apps or not.

pabs3 commented 2 years ago

I expect they require non-password authentication (probably OAuth2) when logging in for non-browser situations and gplaycli uses passwds.

-- bye, pabs

https://bonedaddy.net/pabs3/

pitsi commented 2 years ago

And how am I supposed to do that? There is no popup asking credentials so as to generate oauth password. Does it work for you when using password in playtext? I have no one near me using debian, at the very least, so as to cross-test.

pabs3 commented 2 years ago

I'm assuming gplaycli simply does not support OAuth yet, which is why the login via browser works but via gplaycli does not.

-- bye, pabs

https://bonedaddy.net/pabs3/

pitsi commented 2 years ago

So, with the token way not working because of server issues and the credentials way not working because of (probably) oauth issues, the app is practically useless?

pabs3 commented 2 years ago

Until someone either implements OAuth or fixes the token server issues, yes.

-- bye, pabs

https://bonedaddy.net/pabs3/

matlink commented 2 years ago

I fixed some password-related issues on my token dispenser server. Apparently, application passwords had been removed by Google. Hope it helps.

pabs3 commented 2 years ago

I just tried with the version of gplaycli in Debian, got this error:

$ gplaycli --log -d com.skype.raider [ERROR] Multiple attempts to fetch anonymous token failed. [ERROR] Try setting 'token=False' and adding Google credentials to gplaycli.conf [ERROR] A few packages could not be downloaded : com.skype.raider 'Error retrieving information from server. DF-DFERH-01'

-- bye, pabs

https://bonedaddy.net/pabs3/

pitsi commented 2 years ago

Do you also have the recommended packages installed, i.e. dummydroid, which pulls up A LOT of (mostly java related) dependencies, and frdoidserver, which pulls even more like android sdk? On my end, the output is smaller with the --log parameter, compared with the verbose one. I get the same error like you with the stock settings that need a token

$ gplaycli --log -d com.skype.raider
[ERROR] Multiple attempts to fetch anonymous token failed.
[ERROR] Try setting 'token=False' and adding Google credentials to gplaycli.conf
[ERROR] A few packages could not be downloaded :
com.skype.raider
'Error retrieving information from server. DF-DFERH-01'

and with the credentials way

$ gplaycli --log -d com.skype.raider -c gplaycli.conf 
[ERROR] Bad authentication, login or password incorrect ('server says: BadAuthentication')

So, there is no difference from what I have already mentioned.

---edit I just saw @matlink 's post above for the change in the token server, so ignore the part that I said about the credentials way. Is the url still correct though? https://matlink.fr/token

pitsi commented 2 years ago

I want to add that the output of gplaycli -v -d something is now different than before, e.g.

$ gplaycli -v -d com.brave.browser
[INFO] GPlayCli version 3.29 [Python3.9.12] 
[INFO] Configuration file is /etc/gplaycli/gplaycli.conf
[INFO] Device is bacon
----------
[INFO] Using cached token.
[INFO] Using auto retrieved token to connect to API
[INFO] Token has expired or is invalid. Retrieving a new one...
[INFO] Retrieving token ...
[INFO] Token URL is https://matlink.fr/token
[INFO] Email: gplaycli5@gmail.com
[INFO] Token: aas_et/AKppINa0dg8bp3EiM-zYoXUzgzKVrglY41LTX1T-LsL4P1afvg-zCtv88BwRKCt3bHorP6ums6edKuqQFH-g_9j9TG6a4nEY6EsQ77NCI5_cacibhoTzVJ-R1t8j_7MUNsJKQZvVBHONImD4m9_6B0bHXll2dVN2HIl_pa9Xckb8mwU6lOV5rAZccVYirJoum9G6BxGKPmHEnwLZkvn3zzQ=
[INFO] GsfId: 3e440fdeeabd3f56
----------
[ERROR] Multiple attempts to fetch anonymous token failed.
[ERROR] Try setting 'token=False' and adding Google credentials to gplaycli.conf
[ERROR] A few packages could not be downloaded :
com.brave.browser
'Error retrieving information from server. DF-DFERH-01'

The lines in the middle of the output are repeated 4 times, each time with a different gsfid and token strings.

pitsi commented 2 years ago

And today I am getting a different output that looks like a mixed version of the above

$ gplaycli -v -d com.brave.browser
[INFO] GPlayCli version 3.29 [Python3.9.12] 
[INFO] Configuration file is /etc/gplaycli/gplaycli.conf
[INFO] Device is bacon
[INFO] Using cached token.
[INFO] Using auto retrieved token to connect to API
[INFO] Token has expired or is invalid. Retrieving a new one...
[INFO] Retrieving token ...
[INFO] Token URL is https://matlink.fr/token
[ERROR] Token dispenser server error: 502
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gplaycli/gplaycli.py", line 429, in connect_token
    self.api.login(authSubToken=self.token, gsfId=int(self.gsfid, 16))
  File "/usr/lib/python3/dist-packages/gpapi/googleplay.py", line 250, in login
    self.search('drv')
  File "/usr/lib/python3/dist-packages/gpapi/googleplay.py", line 362, in search
    data = self.executeRequestApi2(path)
  File "/usr/lib/python3/dist-packages/gpapi/googleplay.py", line 336, in executeRequestApi2
    raise RequestError(message.commands.displayErrorMessage)
gpapi.googleplay.RequestError: 'Error while retrieving information from server. DF-DFERH-01'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/gplaycli", line 33, in <module>
    sys.exit(load_entry_point('gplaycli==3.29', 'console_scripts', 'gplaycli')())
  File "/usr/lib/python3/dist-packages/gplaycli/gplaycli.py", line 666, in main
    cli.download(args.download)
  File "/usr/lib/python3/dist-packages/gplaycli/hooks.py", line 8, in check_connection
    ok, err = self.connect()
  File "/usr/lib/python3/dist-packages/gplaycli/gplaycli.py", line 414, in connect
    return self.connect_token()
  File "/usr/lib/python3/dist-packages/gplaycli/gplaycli.py", line 433, in connect_token
    self.retrieve_token(force_new=True)
  File "/usr/lib/python3/dist-packages/gplaycli/gplaycli.py", line 208, in retrieve_token
    raise ERRORS.TOKEN_DISPENSER_SERVER_ERROR
TypeError: exceptions must derive from BaseException

The process stops for some seconds at [INFO] Token URL is https://matlink.fr/token before continuing to the 502 error, so I assume that is the reason of the second part of the error.

pitsi commented 2 years ago

Is there ANY way to get ANY similar key from somewhere so as to get it working? If the default key server did go online again for sometime those 3 weeks that I have opened the issue, then I have probably missed it.

adtimizer commented 2 years ago

@pitsi did you manage to come up with a workaround? would love to hear about it

pitsi commented 2 years ago

Sadly, no. In fact, I have not tried anything else for weeks now. I tried again when I saw your post earlier, but the error is the same.

adtimizer commented 2 years ago

@89z in the spirit of collaboration between projects, maybe it will be good to share how you perform the login to google and fetch the token from there so someone can fix it on the python projects. eventually we are all keen to make things work

pitsi commented 2 years ago

I am pretty sure he can not see your comment here because I blocked him for his attitude, spam and comment deletion. And blocked users can not see or comment on issues. I just made sure his remaining comment is left there to prove my point.

adtimizer commented 2 years ago

@pitsi I wasn't aware of it. my bad

MolotovCherry commented 1 year ago

This is sad. This app is not updated and doesn't even work with the latest python, let alone, can't login or use a token.

ghost commented 1 year ago

@MolotovCherry I have an alternate module and tool if it helps:

https://github.com/4cq2/googleplay

pitsi commented 1 year ago

@4cq2 Aren't you 89z that I blocked last year for spamming? Thank you for keeping the same name on your project while creating a new user name. You are now blocked again.

---edit Also, well done for deleting your old account. It also deleted that one message that I tried to keep here as a proof of your idiotic attitude.

pitsi commented 1 year ago

One day after my comment here, gplaycli was removed from the debian repo. https://tracker.debian.org/news/1431562/removed-329dfsg-4-from-unstable/

It is really sad to see the reasons, although they are all true :'(