googleplay-api icon indicating copy to clipboard operation
googleplay-api copied to clipboard

Error when download apk

Open androidcom opened this issue 12 years ago • 20 comments

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.

androidcom avatar Dec 03 '12 18:12 androidcom

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 .

egirault avatar Dec 03 '12 18:12 egirault

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

androidcom avatar Dec 04 '12 03:12 androidcom

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?

egirault avatar Dec 04 '12 20:12 egirault

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 ... :(

androidcom avatar Dec 05 '12 03:12 androidcom

Do you have this error only with Gmail, or other apps as well? Le 5 déc. 2012 04:18, "androidcom" [email protected] 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.

egirault avatar Dec 05 '12 07:12 egirault

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

androidcom avatar Dec 05 '12 08:12 androidcom

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?

androidcom avatar Dec 05 '12 14:12 androidcom

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 [email protected]

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.

egirault avatar Dec 05 '12 16:12 egirault

Thanks for your comment. I will try that.

androidcom avatar Dec 05 '12 17:12 androidcom

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

mohsinjuni avatar Dec 13 '12 11:12 mohsinjuni

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 [email protected]

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.

egirault avatar Dec 13 '12 12:12 egirault

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 avatar Dec 13 '12 13:12 mohsinjuni

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)

mohsinjuni avatar Dec 13 '12 13:12 mohsinjuni

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?

congling avatar Dec 29 '12 03:12 congling

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).

mohsinjuni avatar Dec 29 '12 04:12 mohsinjuni

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

tracer0tong avatar Jun 07 '13 13:06 tracer0tong

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.

richardg867 avatar Jun 24 '14 00:06 richardg867

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.

seoyoonm avatar Jul 25 '14 09:07 seoyoonm

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)"

iktyrrell avatar Mar 30 '15 12:03 iktyrrell

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

delijati avatar May 22 '15 14:05 delijati