Open tbwolfe opened 9 years ago
Hey @tbwolfe , Any Update on this? I've facing the same problem.
@egirault Any fix for this?
Same problem here. Google changed API?
Yeah, I'm also experiencing the same problem.
I'm also facing the same problem. I can see the URL with offset configured has a field "&o=xxx". But it won't work. Does anyone know what the parameter could be?
Looks like google added a new parameter named "ctntkn" into query string. But you shouldn't guess its value, just use nextPageUrl returned from top page request result and any subsequent result:
containerMetadata {
browseUrl: "browse?bt=4&c=3&ctr=apps_topselling_free&cat=GAME"
nextPageUrl: "list?bt=4&c=3&ctr=apps_topselling_free&cat=GAME&n=20&ctntkn=CBQ%3D&o=20"
analyticsCookie: "578096662"
ordered: true
}
someone fix this problem?
I have somehow figured out (through trial and error) how to get the correct "ctntkn" value without using nextPageUrl:
import string
import requests
code="AEIMQUYcgkosw048"
code_suffix="=BCDEFGHIJKLMNOPQRSTUVWXYZ"
def get_token(offset):
if offset >= 254:
offset += 1
i = offset // 16
j = offset % 16
s = offset // 128
if s > 0:
i -= 8 * (s-1)
key = string.ascii_uppercase[i] + code[j]
token = "C" + key + requests.utils.quote(code_suffix[s])
return token
So inserting the function in googleplay.py and appending path += "&ctntkn=" + get_token(int(offset))
after this line should make it work again.
@P-Sc This approach does not work anymore. It gets stuck at page 5. You have to call the value of "nextPageUrl:" and make sure to use this url as path.
You get stuck at page 5 either way because there is no "nextPageUrl" after 500 apps. Google simply doesn't allow more than that to be queried (per category).
The offset seems to be broken in the list.py functionality. See snippets below for example:
The first request should return results 1-5 of the app selling free apps in the business category:
Title;Package name;Creator;Super Dev;Price;Offer Type;Version Code;Size;Rating;Num Downloads
Job Search;com.indeed.android.jobsearch;Indeed Jobs;0;Free;1;19;1.7MB;4.02;10,000,000+
Facebook Pages Manager;com.facebook.pages.app;Facebook;1;Free;1;9490210;27.1MB;4.13;10,000,000+
ADP Mobile Solutions;com.adpmobile.android;ADP, LLC;0;Free;1;47;6.1MB;3.97;1,000,000+
Square Register;com.squareup;Square, Inc.;0;Free;1;365;26.1MB;4.52;5,000,000+
Job Search - Snagajob;com.snagajob.jobseeker;Snagajob;0;Free;1;42;9.1MB;3.90;1,000,000+
The second request should return apps 6-10 of the same category, but the results are identical.
Title;Package name;Creator;Super Dev;Price;Offer Type;Version Code;Size;Rating;Num Downloads Job Search;com.indeed.android.jobsearch;Indeed Jobs;0;Free;1;19;1.7MB;4.02;10,000,000+
Facebook Pages Manager;com.facebook.pages.app;Facebook;1;Free;1;9490210;27.1MB;4.13;10,000,000+
ADP Mobile Solutions;com.adpmobile.android;ADP, LLC;0;Free;1;47;6.1MB;3.97;1,000,000+
Square Register;com.squareup;Square, Inc.;0;Free;1;365;26.1MB;4.52;5,000,000+ Job Search - Snagajob;com.snagajob.jobseeker;Snagajob;0;Free;1;42;9.1MB;3.90;1,000,000+
This query was constructed from the documentation presented in the project wiki (https://github.com/egirault/googleplay-api/blob/master/README.md).