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

token dispenser error. #263

Open
nerd190 opened this issue Jul 11, 2020 · 14 comments
Open

token dispenser error. #263

nerd190 opened this issue Jul 11, 2020 · 14 comments
Labels

Comments

@nerd190
Copy link

nerd190 commented Jul 11, 2020

Please provide those informations:

  • Android 10: Termux
  • python: 3.8.3
  • gplaycli: 3.29
  • command used: python3 -m pip install gplaycli
  • authentication: default method

(Do i have to make a token? Thought it done it automatically? If so, the link to the default tokenizer didnt work for me)
Thank you for helping! Here is the error: (probably my fault!)

$ gplaycli -s viper
[WARNING] No configuration file gplaycli.conf found at ['/data/data/com.termux/files/home', '/data/data/com.termux/files/home/.local/etc/gplaycli', '/data/data/com.termux/files/usr/local/etc/gplaycli', '/etc/gplaycli'], using default values
[Errno 2] No such file or directory: 'token.cache'
[ERROR] Cannot retrieve email address from token dispenser
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/bin/gplaycli", line 11, in <module>
    load_entry_point('gplaycli==3.29', 'console_scripts', 'gplaycli')()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 651, in main
    cli.search(args.search, not args.paid)
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/hooks.py", line 8, in check_connection
    ok, err = self.connect()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 412, in connect
    self.retrieve_token()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 193, in retrieve_token
    raise ERRORS.TOKEN_DISPENSER_SERVER_ERROR
TypeError: exceptions must derive from BaseException

$ gplaycli -v
[WARNING] No configuration file gplaycli.conf found at ['/data/data/com.termux/files/home', '/data/data/com.termux/files/home/.local/etc/gplaycli', '/data/data/com.termux/files/usr/local/etc/gplaycli', '/etc/gplaycli'], using default values
[INFO] GPlayCli version 3.29 [Python3.8.3]
[INFO] Configuration file is None
[INFO] Device is bacon
@LXQBer
Copy link

LXQBer commented Aug 12, 2020

I also encountered a situation where the status code returned by the url of the token is 502, is it resolved?

@cherusk
Copy link

cherusk commented Aug 26, 2020

Happening currently again. 😢

@nobicycle
Copy link

I confirm the same.

@nerd190
Copy link
Author

nerd190 commented Aug 30, 2020

Yeah still not working for me either

@cherusk
Copy link

cherusk commented Aug 31, 2020

If you looked at the repo commit spree, last update few years ago. 👁️. I hold one of us has to take it up.

@lamanux
Copy link

lamanux commented Oct 8, 2020

It still doesn't work for me either.

  • Operating System :
    Linux 4.19.0-8-amd64 Does not work with google authenticator #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64 GNU/Linux
  • Python version when running gplaycli (should be 3+) :
    Python 3.7.3
  • GPlayCli version via gplaycli -v
    [INFO] GPlayCli version 3.29 [Python3.7.3]
  • The way you installed gplaycli: git clone, git clone and setup.py, pip install gplaycli, apt install gplaycli, ...
    apt install gplaycli
  • The authentication method: (own) credentials or (own) token.
    default method

@mrjwolf91
Copy link

Android 10.termux/python3.8.3 -m pip install gplaycli

@mrjwolf91
Copy link

Please provide those informations:

  • Android 10: Termux
  • python: 3.8.3
  • gplaycli: 3.29
  • command used: python3 -m pip install gplaycli
  • authentication: default method

(Do i have to make a token? Thought it done it automatically? If so, the link to the default tokenizer didnt work for me)
Thank you for helping! Here is the error: (probably my fault!)

$ gplaycli -s viper
[WARNING] No configuration file gplaycli.conf found at ['/data/data/com.termux/files/home', '/data/data/com.termux/files/home/.local/etc/gplaycli', '/data/data/com.termux/files/usr/local/etc/gplaycli', '/etc/gplaycli'], using default values
[Errno 2] No such file or directory: 'token.cache'
[ERROR] Cannot retrieve email address from token dispenser
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/bin/gplaycli", line 11, in <module>
    load_entry_point('gplaycli==3.29', 'console_scripts', 'gplaycli')()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 651, in main
    cli.search(args.search, not args.paid)
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/hooks.py", line 8, in check_connection
    ok, err = self.connect()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 412, in connect
    self.retrieve_token()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 193, in retrieve_token
    raise ERRORS.TOKEN_DISPENSER_SERVER_ERROR
TypeError: exceptions must derive from BaseException

$ gplaycli -v
[WARNING] No configuration file gplaycli.conf found at ['/data/data/com.termux/files/home', '/data/data/com.termux/files/home/.local/etc/gplaycli', '/data/data/com.termux/files/usr/local/etc/gplaycli', '/etc/gplaycli'], using default values
[INFO] GPlayCli version 3.29 [Python3.8.3]
[INFO] Configuration file is None
[INFO] Device is bacon

Andriod10.termux/python3.8.3 -m pop install gplaycli

@mrjwolf91
Copy link

Please provide those informations:

  • Android 10: Termux
  • python: 3.8.3
  • gplaycli: 3.29
  • command used: python3 -m pip install gplaycli
  • authentication: default method

(Do i have to make a token? Thought it done it automatically? If so, the link to the default tokenizer didnt work for me)
Thank you for helping! Here is the error: (probably my fault!)

$ gplaycli -s viper
[WARNING] No configuration file gplaycli.conf found at ['/data/data/com.termux/files/home', '/data/data/com.termux/files/home/.local/etc/gplaycli', '/data/data/com.termux/files/usr/local/etc/gplaycli', '/etc/gplaycli'], using default values
[Errno 2] No such file or directory: 'token.cache'
[ERROR] Cannot retrieve email address from token dispenser
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/bin/gplaycli", line 11, in <module>
    load_entry_point('gplaycli==3.29', 'console_scripts', 'gplaycli')()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 651, in main
    cli.search(args.search, not args.paid)
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/hooks.py", line 8, in check_connection
    ok, err = self.connect()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 412, in connect
    self.retrieve_token()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 193, in retrieve_token
    raise ERRORS.TOKEN_DISPENSER_SERVER_ERROR
TypeError: exceptions must derive from BaseException

$ gplaycli -v
[WARNING] No configuration file gplaycli.conf found at ['/data/data/com.termux/files/home', '/data/data/com.termux/files/home/.local/etc/gplaycli', '/data/data/com.termux/files/usr/local/etc/gplaycli', '/etc/gplaycli'], using default values
[INFO] GPlayCli version 3.29 [Python3.8.3]
[INFO] Configuration file is None
[INFO] Device is bacon
android 10: termux python 3 -m install gplaucli version 3.20

@mrjwolf91
Copy link

Please provide those informations:

  • Android 10: Termux
  • python: 3.8.3
  • gplaycli: 3.29
  • command used: python3 -m pip install gplaycli
  • authentication: default method

(Do i have to make a token? Thought it done it automatically? If so, the link to the default tokenizer didnt work for me)
Thank you for helping! Here is the error: (probably my fault!)

$ gplaycli -s viper
[WARNING] No configuration file gplaycli.conf found at ['/data/data/com.termux/files/home', '/data/data/com.termux/files/home/.local/etc/gplaycli', '/data/data/com.termux/files/usr/local/etc/gplaycli', '/etc/gplaycli'], using default values
[Errno 2] No such file or directory: 'token.cache'
[ERROR] Cannot retrieve email address from token dispenser
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/bin/gplaycli", line 11, in <module>
    load_entry_point('gplaycli==3.29', 'console_scripts', 'gplaycli')()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 651, in main
    cli.search(args.search, not args.paid)
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/hooks.py", line 8, in check_connection
    ok, err = self.connect()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 412, in connect
    self.retrieve_token()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 193, in retrieve_token
    raise ERRORS.TOKEN_DISPENSER_SERVER_ERROR
TypeError: exceptions must derive from BaseException

$ gplaycli -v
[WARNING] No configuration file gplaycli.conf found at ['/data/data/com.termux/files/home', '/data/data/com.termux/files/home/.local/etc/gplaycli', '/data/data/com.termux/files/usr/local/etc/gplaycli', '/etc/gplaycli'], using default values
[INFO] GPlayCli version 3.29 [Python3.8.3]
[INFO] Configuration file is None
[INFO] Device is bacon

/data/data/com.termux/files/home -m pip/ install/ gplaycli version 3.29

@mrjwolf91
Copy link

Please provide those informations:

  • Android 10: Termux
  • python: 3.8.3
  • gplaycli: 3.29
  • command used: python3 -m pip install gplaycli
  • authentication: default method

(Do i have to make a token? Thought it done it automatically? If so, the link to the default tokenizer didnt work for me)
Thank you for helping! Here is the error: (probably my fault!)

$ gplaycli -s viper
[WARNING] No configuration file gplaycli.conf found at ['/data/data/com.termux/files/home', '/data/data/com.termux/files/home/.local/etc/gplaycli', '/data/data/com.termux/files/usr/local/etc/gplaycli', '/etc/gplaycli'], using default values
[Errno 2] No such file or directory: 'token.cache'
[ERROR] Cannot retrieve email address from token dispenser
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/bin/gplaycli", line 11, in <module>
    load_entry_point('gplaycli==3.29', 'console_scripts', 'gplaycli')()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 651, in main
    cli.search(args.search, not args.paid)
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/hooks.py", line 8, in check_connection
    ok, err = self.connect()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 412, in connect
    self.retrieve_token()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 193, in retrieve_token
    raise ERRORS.TOKEN_DISPENSER_SERVER_ERROR
TypeError: exceptions must derive from BaseException

$ gplaycli -v
[WARNING] No configuration file gplaycli.conf found at ['/data/data/com.termux/files/home', '/data/data/com.termux/files/home/.local/etc/gplaycli', '/data/data/com.termux/files/usr/local/etc/gplaycli', '/etc/gplaycli'], using default values
[INFO] GPlayCli version 3.29 [Python3.8.3] 
[INFO] Configuration file is None
[INFO] Device is bacon

Configure/ device/ gplaycli version 3.29 files/ user[ python 3.8.3] - m

@mrjwolf91
Copy link

Please provide those informations:

  • Android 10: Termux
  • python: 3.8.3
  • gplaycli: 3.29
  • command used: python3 -m pip install gplaycli
  • authentication: default method

(Do i have to make a token? Thought it done it automatically? If so, the link to the default tokenizer didnt work for me)
Thank you for helping! Here is the error: (probably my fault!)

$ gplaycli -s viper
[WARNING] No configuration file gplaycli.conf found at ['/data/data/com.termux/files/home', '/data/data/com.termux/files/home/.local/etc/gplaycli', '/data/data/com.termux/files/usr/local/etc/gplaycli', '/etc/gplaycli'], using default values
[Errno 2] No such file or directory: 'token.cache'
[ERROR] Cannot retrieve email address from token dispenser
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/bin/gplaycli", line 11, in <module>
    load_entry_point('gplaycli==3.29', 'console_scripts', 'gplaycli')()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 651, in main
    cli.search(args.search, not args.paid)
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/hooks.py", line 8, in check_connection
    ok, err = self.connect()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 412, in connect
    self.retrieve_token()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 193, in retrieve_token
    raise ERRORS.TOKEN_DISPENSER_SERVER_ERROR
TypeError: exceptions must derive from BaseException

$ gplaycli -v
[WARNING] No configuration file gplaycli.conf found at ['/data/data/com.termux/files/home', '/data/data/com.termux/files/home/.local/etc/gplaycli', '/data/data/com.termux/files/usr/local/etc/gplaycli', '/etc/gplaycli'], using default values
[INFO] GPlayCli version 3.29 [Python3.8.3]
[INFO] Configuration file is None
[INFO] Device is bacon

Error: configuration file missing/ user/lib/ file/ termux 3.8.3 -m pip installation of gplaycli versio 3.29 required

@mrjwolf91
Copy link

Please provide those informations:

  • Android 10: Termux
  • python: 3.8.3
  • gplaycli: 3.29
  • command used: python3 -m pip install gplaycli
  • authentication: default method

(Do i have to make a token? Thought it done it automatically? If so, the link to the default tokenizer didnt work for me)
Thank you for helping! Here is the error: (probably my fault!)

$ gplaycli -s viper
[WARNING] No configuration file gplaycli.conf found at ['/data/data/com.termux/files/home', '/data/data/com.termux/files/home/.local/etc/gplaycli', '/data/data/com.termux/files/usr/local/etc/gplaycli', '/etc/gplaycli'], using default values
[Errno 2] No such file or directory: 'token.cache'
[ERROR] Cannot retrieve email address from token dispenser
Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/bin/gplaycli", line 11, in <module>
    load_entry_point('gplaycli==3.29', 'console_scripts', 'gplaycli')()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 651, in main
    cli.search(args.search, not args.paid)
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/hooks.py", line 8, in check_connection
    ok, err = self.connect()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 412, in connect
    self.retrieve_token()
  File "/data/data/com.termux/files/usr/lib/python3.8/site-packages/gplaycli/gplaycli.py", line 193, in retrieve_token
    raise ERRORS.TOKEN_DISPENSER_SERVER_ERROR
TypeError: exceptions must derive from BaseException

$ gplaycli -v
[WARNING] No configuration file gplaycli.conf found at ['/data/data/com.termux/files/home', '/data/data/com.termux/files/home/.local/etc/gplaycli', '/data/data/com.termux/files/usr/local/etc/gplaycli', '/etc/gplaycli'], using default valuesm
[INFO] GPlayCli version 3.29 [Python3.8.3]
[INFO] Configuration file is None
[INFO] Device is bacon

[Type Error:] (No configuration file found) Gplaycli conf located in [ data/data/com.termux/ file/ user/bin/ (retrieve and restore.

@nerd190
Copy link
Author

nerd190 commented Feb 23, 2021

Hi @matlink (and everyone else here!)
Just to let you know that I re-installed to see if anything was fixed but it wasnt, thats ok, this time I tried some other stuff...
Instead of installing then searching (that gives a token error which is the reason for this issue), this time I copied the gplaycli.conf here in the repo to my $HOME directory and it works! so to address this issue (and get it closed!) simply add some info to the readme stating that you will need a gplaycli.conf for this to work. Then you can close this! and as some thanks, here are two more reputable token dispensers that also work:

  • https://token-dispenser.calyxinstitute.org (an open source software org, they make "ungoogled chromium" etc for Android)
  • http://auroraoss.com:8080 ("AuroraStore", an open-source playstore client for Android)

EDIT!

Whilst you can search for apps, I am unable to download them :'(
gplaycli -d com.termux & gplaycli -d termux both fail.

@Janed89
Copy link

Janed89 commented Mar 2, 2021

Thanks for pointing out that a config file fixes the error. Downloads do work for me now. Here are the exact steps I used

# create new virtual env
python3 -m venv gplaycli

# activate venv
cd gplaycli
source ./bin/activate

# create config file
cat > ./local/etc/gplaycli/gplaycli.conf <<EOF
[Credentials]
token=True
token_url=http://auroraoss.com:8080
EOF

# install
pip3 install gplaycli

# download
gplaycli -pvd com.termux

BTW: No need to get Termux from Google. It's available in the way more trustworthy F-Droid store.

@nerd190
Copy link
Author

nerd190 commented Mar 4, 2021

@Janed89 thank you for the suggestion, it now connects to the api, but I still get an error:

[ERROR] Error while downloading com.termux : Unexpected end-group tag.
[ERROR] A few packages could not be downloaded :                      com.termux                                                            Unexpected end-group tag.

😢
P.S I get Termux from FDroid, but with the million shebangs I write, its the only pkg name I know off the top of my head 😄

@Janed89
Copy link

Janed89 commented Mar 31, 2021

The Aurora token dispenser changed its URL and format. The new URL is goolag.store:1337 and here's a small patch to support the new format:

diff --git a/gplaycli.py b/gplaycli.py
index 718906c..d4ddeef 100644
--- a/gplaycli.py
+++ b/gplaycli.py
@@ -184,19 +184,12 @@ class GPlaycli:
 
 		logger.info("Retrieving token ...")
 		logger.info("Token URL is %s", self.token_url)
-		email_url = '/'.join([self.token_url, 'email'])
-		response = requests.get(email_url)
+		url = '/'.join([self.token_url, 'api/auth'])
+		response = requests.get(url)
 		if response.status_code == 200:
-			self.gmail_address = response.text
-		else:
-			logger.error("Cannot retrieve email address from token dispenser")
-			raise ERRORS.TOKEN_DISPENSER_SERVER_ERROR
-
-		token_url = '/'.join([self.token_url, 'token/email', self.gmail_address])
-		response = requests.get(token_url)
-
-		if response.status_code == 200:
-			self.token = response.text
+			parsed = json.loads(response.text)
+			self.gmail_address = parsed['email']
+			self.token = parsed['auth']
 			self.gsfid = hex(self.api.checkin(self.gmail_address, self.token))[2:]
 			logger.info("Email: %s", self.gmail_address)
 			logger.info("Token: %s", self.token)

I would have attached a patch but the system will only accept weird file extension shrug

@Janed89
Copy link

Janed89 commented Mar 31, 2021

@5c0tt-b0t Now getting the same error you see. With verbose output it's

[INFO] 1 / 1 com.termux
…/gplaycli/lib/python3.9/site-packages/gpapi/googleplay.py:645: RuntimeWarning: Unexpected end-group tag: Not all data was converted
  response = googleplay_pb2.ResponseWrapper.FromString(response.content)
[ERROR] Error while downloading com.termux : 'Your device is not compatible with this item.'
[ERROR] A few packages could not be downloaded :
com.termux

So the error comes from gpapi/googleplay.py and already has an open issue there: NoMore201/googleplay-api#141

@nerd190
Copy link
Author

nerd190 commented Mar 31, 2021

@Janed89 thanks for letting me know!
And awesome work tracking down the api used and cross-referencing the issues! (and Aurora's changed token!)
I take it that all 3 token dispensers are failing because of gpapi?
Must be gpapi's problem because 'Aurora Store' is still working fine.
Thanks again.

@Janed89
Copy link

Janed89 commented Mar 31, 2021

https://token-dispenser.calyxinstitute.org never worked for me (certificate error) and http://auroraoss.com:8080 is down, with goolag.store:1337 probably being its successor. But that dispenser works fine with the patch. Searching with gplaycli, for example, has no problems.

Downloads seem to depend on gpapi which has some problem. Or maybe the tokens from the dispenser fake a device tht really is incompatible with the package. Hard to say.

@matlink
Copy link
Owner

matlink commented Jun 28, 2021

This raises 2 issues :

  1. config file which is not found and default settings in the code not up to date
  2. download issues due to misbehaving token dispenser

Please open another issue for the second one.
I am pinning the first one as a bug and I'll try to find a way to better handle pip installation of config file.

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

No branches or pull requests

8 participants