NoMore201 / googleplay-api

Google Play Unofficial Python API
Other
409 stars 208 forks source link

List from subcategory "too many results requested" #136

Open noahbald opened 3 years ago

noahbald commented 3 years ago

I've found that when nb_results + offset > 512 in api.list() then there will be a RequestError in executeRequestApi2 stating that "too many results requested"

I haven't found any way to get past this so far.

The following code will throw the error

def download_category(category: str, n: int=1000):
  LIMIT_DL = 100
  sub_categories = api.list(category)
  for sub_category in sub_categories:
    for i in range(n//LIMIT_DL):
      apks = api.list(category, ctr=sub_category, nb_results=min(LIMIT_DL, n - i*LIMIT_DL), offset=i*LIMIT_DL)
      # TODO: download the apks
cstayyab commented 3 years ago

As far as I have checked, max limit for nb_results is 100

noahbald commented 3 years ago

This is true, what I mean is that if nb_results + offset > 512 (or 513?) there is an error. So, for example, if nb_results == 50 and offset == 500 then the error will be thrown