matlink / gplaycli

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

~/.cache/gplaycli/token had the string "Malformed Request" instead of a token #195

Closed detrout closed 5 years ago

detrout commented 6 years ago

(it's actually direct from git, so the HEAD commit is c5920db9c1df43d09d7f97f2a05d26a41443e294)

mkvirtualenv --python=/usr/bin/python3 git clone, python setup.py develop

Somehow I got unlucky and the contents of the tokencachefile was "Malformed Request".

Traceback (most recent call last):                                              
  File "/usr/lib/python3.6/pdb.py", line 1667, in main                          
    pdb._runscript(mainpyfile)                                                  
  File "/usr/lib/python3.6/pdb.py", line 1548, in _runscript                    
    self.run(statement)                                                           File "/usr/lib/python3.6/bdb.py", line 434, in run                        
    exec(cmd, globals, locals)                                                  
  File "<string>", line 1, in <module>
  File "/home/diane/.virtualenvs/gplaycli/bin/gplaycli", line 3, in <module>  
    __requires__ = 'GPlayCli'                                                   
  File "/home/diane/src/gplaycli/gplaycli/gplaycli.py", line 714, in main
    cli.search(args.search_string, nb_results, not args.paid)                  
  File "/home/diane/src/gplaycli/gplaycli/hooks.py", line 8, in check_connectio$
    self.connect()                  
  File "/home/diane/src/gplaycli/gplaycli/gplaycli.py", line 423, in connect
    gsfid = int(self.gsfid, 16)                                                 
ValueError: invalid literal for int() with base 16: 'request'    

I'm not sure how the Malformed Request got there, but it might be nice to have some kind of validation function in gplaycli.py::get_cached_token that gives an error message if the contents of the token cache is invalid.

Once I figured out that the cache file had bad data in it, I deleted ~/.cache/gplaycli/token and gplaycli downloaded a new valid token

matlink commented 5 years ago

There is a validation function, however it has not been released yet to a tagged version.

detrout commented 5 years ago

I fixed it by deleting the file. It was just annoying to find that so I wanted to leave a bug report to make easier for the next person it happens to. Thanks for letting me know there's a fix.

matlink commented 5 years ago

Fix is now in the latest release.