gplaycli icon indicating copy to clipboard operation
gplaycli copied to clipboard

token dispenser error.

Open nerd190 opened this issue 5 years ago • 14 comments

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

nerd190 avatar Jul 11 '20 07:07 nerd190

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

LXQBer avatar Aug 12 '20 08:08 LXQBer

Happening currently again. :cry:

cherusk avatar Aug 26 '20 14:08 cherusk

I confirm the same.

nobicycle avatar Aug 26 '20 14:08 nobicycle

Yeah still not working for me either

nerd190 avatar Aug 30 '20 21:08 nerd190

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

cherusk avatar Aug 31 '20 04:08 cherusk

It still doesn't work for me either.

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

lamanux avatar Oct 08 '20 07:10 lamanux

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

mrjwolf91 avatar Feb 11 '21 01:02 mrjwolf91

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 avatar Feb 11 '21 01:02 mrjwolf91

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 avatar Feb 11 '21 01:02 mrjwolf91

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 avatar Feb 11 '21 01:02 mrjwolf91

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 avatar Feb 11 '21 01:02 mrjwolf91

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 avatar Feb 11 '21 02:02 mrjwolf91

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.

mrjwolf91 avatar Feb 11 '21 02:02 mrjwolf91

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.

nerd190 avatar Feb 23 '21 22:02 nerd190

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.

Janed89 avatar Mar 02 '21 12:03 Janed89

@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 😄

nerd190 avatar Mar 04 '21 01:03 nerd190

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 avatar Mar 31 '21 17:03 Janed89

@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: https://github.com/NoMore201/googleplay-api/issues/141

Janed89 avatar Mar 31 '21 17:03 Janed89

@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.

nerd190 avatar Mar 31 '21 17:03 nerd190

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.

Janed89 avatar Mar 31 '21 17:03 Janed89

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.

matlink avatar Jun 28 '21 20:06 matlink