egirault / googleplay-api

Google Play Unofficial Python API - This project was a PoC and is not maintained anymore. Please feel free to fork it and improve it in any way.
878 stars 373 forks source link

Error when download apk #11

Open androidcom opened 11 years ago

androidcom commented 11 years ago

Hello,

I use the API and when I ran the command: python download.py com.google.android.gm I got the following error message:

Downloading 2.3MB... Traceback (most recent call last): File "download.py", line 38, in data = api.download(packagename, vc, ot) File "/Users/guest/Desktop/googleplay2/googleplay.py", line 252, in download cookie = message.payload.buyResponse.purchaseStatusResponse.appDeliveryData.downloadAuthCookie[0] File "/Users/guest/Desktop/googleplay2/google/protobuf/internal/containers.py", line 67, in getitem return self._values[key] IndexError: list index out of range

Any idea how i can resolve this issue? Thanks.

egirault commented 11 years ago

Hi, It seems that the API can't find the authentication cookie, which is pretty strange. I don't have this problem here... Can you try to edit googleplay.py and add this on line 250:

print self.toStr(message)

Please paste here the output of python download.py com.google.android.gm .

androidcom commented 11 years ago

Hi egirault,

thanks for you reply. Below is the output:

python download.py com.google.android.gm

Downloading 2.3MB... commands { displayErrorMessage: "Error retrieving information from server. [RPC:S-5:AEC-0]" }

Traceback (most recent call last): File "download.py", line 38, in data = api.download(packagename, vc, ot) File "/Users/guest/Desktop/googleplay2/googleplay.py", line 252, in download cookie = message.payload.buyResponse.purchaseStatusResponse.appDeliveryData.downloadAuthCookie[0] File "/Users/guest/Desktop/googleplay2/google/protobuf/internal/containers.py", line 67, in getitem return self._values[key] IndexError: list index out of range

egirault commented 11 years ago

Well that's really strange. I've never seen this error before. Are your sure about your AndroidID in config.py? Is it the only app/method that triggers this error?

androidcom commented 11 years ago

Yes this is the only method that trigger this error. All other methods such as search.py , list.py , categories.py are all working fine ... :(

egirault commented 11 years ago

Do you have this error only with Gmail, or other apps as well? Le 5 déc. 2012 04:18, "androidcom" notifications@github.com a écrit :

Yes this is the only method that trigger this error. All other methods such as search.py , list.py , categories.py are all working fine ... :(

— Reply to this email directly or view it on GitHubhttps://github.com/egirault/googleplay-api/issues/11#issuecomment-11026698.

androidcom commented 11 years ago

i got error on all apps that i tried to download using download.py command

androidcom commented 11 years ago

in the config.py i set only the device id, google account and password. I don't have authentication token. Could that be the problem or not?

egirault commented 11 years ago

No, I don't think so; if the provided credentials were incorrect you wouldn't be able to log in. To troubleshoot the issue it could be interesting to dump the HTTPS traffic of your phone when downloading an APK, and diff with what the Python API sends and receives.

2012/12/5 androidcom notifications@github.com

in the config.py i set only the device id, google account and password. I don't have authentication token. Could that be the problem or not?

— Reply to this email directly or view it on GitHubhttps://github.com/egirault/googleplay-api/issues/11#issuecomment-11044350.

androidcom commented 11 years ago

Thanks for your comment. I will try that.

mohsinjuni commented 11 years ago

I am having the same problem with Downloading. In my case, error is little more strange. Any idea?

Downloading 0.0bytes... Traceback (most recent call last): File "download.py", line 40, in data = api.download(packagename, vc, ot) File "E:\googleplay-crawler-py\googleplay-api-master\googleplay.py", line 267, in download cookie = message.payload.buyResponse.purchaseStatusResponse.appDeliveryData.downloadAuthCookie[0] File "build\bdist.win-amd64\egg\google\protobuf\internal\containers.py", line 64, in getitem IndexError: list index out of range

egirault commented 11 years ago

Strange indeed... Can you print the detail of the server response ? You can insert print self.toStr(message) in googleplay.py in the download() method.

2012/12/13 mohsinjuni notifications@github.com

I am having the same problem with Downloading. In my case, error is little more strange. Any idea?

Downloading 0.0bytes...

Traceback (most recent call last): File "download.py", line 40, in data = api.download(packagename, vc, ot) File "E:\googleplay-crawler-py\googleplay-api-master\googleplay.py", line 267, in download cookie = message.payload.buyResponse.purchaseStatusResponse.appDeliveryData.downloadAuthCookie[0] File "build\bdist.win-amd64\egg\google\protobuf\internal\containers.py", line 64, in getitem

IndexError: list index out of range

Reply to this email directly or view it on GitHubhttps://github.com/egirault/googleplay-api/issues/11#issuecomment-11331626.

mohsinjuni commented 11 years ago

Thanks for your reply. I inserted this line. I have downloaded this package many times through Java API but it's not allowing me to do so here. And problem with Java API was that it was throwing some exceptions on some package names, so I moved to Python. Anyway, here is the output.

E:\googleplay-crawler-py\googleplay-api-master>python download.py com.mobulasoft.criticker Downloading 0.0bytes... commands { displayErrorMessage: "The item you were attempting to purchase could not be found." }

Traceback (most recent call last): File "download.py", line 38, in data = api.download(packagename, vc, ot) File "E:\googleplay-crawler-py\googleplay-api-master\googleplay.py", line 265, in download cookie = message.payload.buyResponse.purchaseStatusResponse.appDeliveryData.downloadAuthCookie[0] File "build\bdist.win-amd64\egg\google\protobuf\internal\containers.py", line 64, in getitem IndexError: list index out of range

mohsinjuni commented 11 years ago

Since Java API is also built upon this project, I have just checked, it also throws the same exception. Though Java API can download above package but it throws error for some other package.

Downloading...com.indiagames.cricketfever : 0 bytes Exception in thread "main" com.akdeniz.googleplaycrawler.GooglePlayException: ><The item you were attempting to purchase could not be found. at com.akdeniz.googleplaycrawler.GooglePlayAPI.executeHttpRequest(GooglePlayAPI.java:291) at com.akdeniz.googleplaycrawler.GooglePlayAPI.executePost(GooglePlayAPI.java:243) at com.akdeniz.googleplaycrawler.GooglePlayAPI.executePost(GooglePlayAPI.java:227) at com.akdeniz.googleplaycrawler.GooglePlayAPI.executePOSTRequest(GooglePlayAPI.java:426) at com.akdeniz.googleplaycrawler.GooglePlayAPI.purchase(GooglePlayAPI.java:395) at com.akdeniz.googleplaycrawler.GooglePlayAPI.download(GooglePlayAPI.java:406) at com.akdeniz.googleplaycrawler.test.TestGooglePlay.testDownload(TestGooglePlay.java:172) at com.akdeniz.googleplaycrawler.test.TestGooglePlay.main(TestGooglePlay.java:52)

congling commented 11 years ago

Hi mohsinjuni, Maybe device id you entered is not correct. I met the same problem when the device id was not correct.

Hi egirault, I have the same problem as androidcom, is that possible for google to change the protocols and get rid of the purchase API recently?

mohsinjuni commented 11 years ago

Hi Congling,

I was trying both Python and Java Crawler project when I faced the same problem in both project. However, in Java crawler, which is developed by someone else on github here, I was able to download all apps with exception of a few ones but using Python, I was not able to download any. By now, I got Java crawler working because developer made some changes in the code as it was allowing to download apps only compatible with Samsung Galaxy SIII earlier. So you can use Java Crawler from here (https://github.com/Akdeniz/google-play-crawler).

tracer0tong commented 11 years ago

I have same problem with downloading: Downloading 2.1MB... commands { displayErrorMessage: "Error retrieving information from server. [RPC:S-5:AEC-0]" }

richardg867 commented 10 years ago

For future reference: I also had a RPC:S-5 error. It happens when you're trying to download an app using an Android ID that is not associated to the Google account. The only solution is to sign in to the Google account using the device you took the Android ID from.

seoyoonm commented 10 years ago

Yeah, @richardg867 is right. You should match the device ID and google account ID which you signed in within the device. When I checked the device, the google account ID was different in the config file.

iktyrrell commented 9 years ago

For those who are having "The item you were attempting to purchase could not be found." related issues, I discovered that this can be caused by play store's filtering:

http://developer.android.com/google/play/filters.html

When a request to the API is made, the User-Agent header seems to be used as a basis for filtering. Many apps will have a minimum supported profile for an app (e.g. sdk [Android] version, screen size, etc) - the UA string that is hard-coded in googleplay.py L150 is quite out-of-date.

I've been able to search for / download an app that didn't work previously by changing the UA string to:

"Android-Finsky/5.3.6 (api=3,versionCode=80330600,sdk=18,device=vbox86p,hardware=vbox86,product=vbox86p,platformVersionRelease=4.3,model=Google%20Galaxy%20Nexus%20-%204.3%20-%20API%2018%20-%20720x1280,buildId=JLS36G,isWideScreen=0)"

delijati commented 9 years ago

response.status code is 500 internal server error ... somehow the java crawler is doing something different because there it works