NoMore201 / googleplay-api

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

Fewer results return when using googleplay.list() #106

Open rscmendes opened 4 years ago

rscmendes commented 4 years ago

I've been noticing that sometimes googleplay.list() returns fewer apps than the requested number. This doesn't always occur and I still haven't figured out why this happens at all. It might be possible that the apps that are missing are not compatible with the device.

Here's an example of this bug: (running this code from the uk, it might change the results depending on where you are)

server = GooglePlayAPI(locale="en_GB", timezone="utf", device_codename="bacon")
server.login(...)
server.list("BUSINESS", "apps_topselling_free", 10)

This returns a list of 9 items instead of the requested 10. For me, the workaround is to increment the number of results (nb_results) and issue the request again, but this is far from optimal. Edit: note that incrementing nb_resultsto 11, results in 10 apps returned, so the problem is still there.

Anyone else facing this issue? Any insights on how to fix this?

NoMore201 commented 4 years ago

You need to analyze the protobuf response and see what is going on. Maybe the API returns the URL to fetch the next bunch of results like happened before with the search API. Right now I don't have access to a google account for testing, can you upload the protobuf response in a text file here?

bellalm commented 4 years ago

same problem

rscmendes commented 4 years ago

Sorry for the delay. Here's the output (using the DATING group): test_output.txt

It does seem like fewer results are returned and the next page URL has offset of 9 instead of 10 as requested.

Also tried the same request after allowing less secure apps and it didn't make any difference.

I also tried using a different device (was previously using "bacon" and changed to "walleye") and with this device I got 10 apps in all categories (and 15 in a second test). So, is it possible that the problem lies with apks that target SDK higher than the phone SDK?