Open peterstory opened 6 years ago
My best guess at the moment is that this while loop is causing a large number of requests to be issued, which is causing Google to rate-limit me:
@matlink and @NoMore201: I've made two changes.
27d9cb4 is a fix for a genuine bug I discovered, where an infinite loop of requests could be generated.
7af8359 is an implementation of exponential backoff for when Google responds with 400 and 429 response codes (https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429).
Should I create separate pull requests, or a single pull request for both?
@NoMore201 Any updates? Without this raise RequestError
, the code throws up when the token expires, like so:
[27-Mar-2018 18:27:57 UTC] Traceback (most recent call last):
File "gplaycli.py", line 761, in <module>
main()
File "gplaycli.py", line 752, in main
cli.download(args.packages_to_download)
File "hooks.py", line 8, in check_connection
self.connect()
File "gplaycli.py", line 457, in connect
gsfId=gsfid)
File "gpapi/googleplay.py", line 205, in login
self.search('firefox', 1, None)
File "gpapi/googleplay.py", line 317, in search
data = self.executeRequestApi2(currentPath)
File "gpapi/googleplay.py", line 273, in executeRequestApi2
headers = self.getDefaultHeaders()
File "gpapi/googleplay.py", line 101, in getDefaultHeaders
"User-Agent": self.deviceBuilder.getUserAgent()}
File "gpapi/config.py", line 94, in getUserAgent
supported_abis=self.device.get('platforms').replace(',', ';'))
RuntimeWarning: Unexpected end-group tag: Not all data was converted
As described in my PR (https://github.com/NoMore201/googleplay-api/pull/41), the current implementation of the code doesn't handle Google's rate-limiting gracefully.
However, there is also the question of why I'm encountering rate-limiting in the first place. I've created this issue to track my investigations into that problem.