dweinstein / node-google-play

Get details and download apps from https://play.google.com by emulating an Android (Nexus 5X) device by default. For a rust version of this library check out https://github.com/dweinstein/rs-google-play

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

completeDownloadInfo return AssertionError: require downloadUrl

liranay opened this issue · comments

Hi,

Api suddenly stopped working -

calling gpapi.GooglePlayAPI(gpAccount) to get the API
and then calling api.completeDownloadInfo(packageName,versionCode)
throws an error - AssertionError: require downloadUrl

chain of calls - completeDownloadInfo-> getCompleteDownloadInfo-> getDownloadInfo() - result return empty with no data, and then the following row:
assert(res.downloadUrl, 'require downloadUrl');
causing an error to be thrown

Did anyone else encountered the problem?
Can someone help?

Thanks

Hi
Now request download url doesn't work at all.

Retruned response:
{"downloadSize":null,"signature":null,"downloadUrl":null,"additionalFile":[],"downloadAuthCookie":[],"forwardLocked":null,"refundTimeout":null,"serverInitiated":null,"postInstallRefundWindowMillis":null,"immediateStartNeeded":null,"patchData":null,"encryptionParams":null,"gzippedDownloadUrl":null,"gzippedDownloadSize":null,"splitDeliveryData":[],"installLocation":null}

please help.

same problem

Hi
It seems now the "purchase" api response with a "encodedDeliveryToken" which will be used in "delivery" api to get download url.
However, the "delivery" api requires a "st" parameter, any idea how to get it?

Thanks.

Same problem.

same for me too

same here

commented

I made a pull request that could fix the issue:
#69

you can use the fork untill the fix get pushed to the main repo if you'd like..
https://github.com/snirad/node-google-play

@snirad
i'm getting the following error
AssertionError: expected appDeliveryData

commented

I tested about 10 different apk's and it seem to be working.

could it be that the apk you are trying to get is not available on play store ?

@snirad
First of all thank you.
After change api to your code, sometimes downloadUrl request show error: expected appDeliveryData but sometimes work correctly!

Complete Error:

{ AssertionError: expected appDeliveryData
    at C:\Program Files\nodejs\node_modules\gpapi\lib\api.js:419:9
    at tryCatcher (C:\Program Files\nodejs\node_modules\bluebird\js\release\util
.js:16:23)
    at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\b
luebird\js\release\promise.js:512:31)
    at Promise._settlePromise (C:\Program Files\nodejs\node_modules\bluebird\js\
release\promise.js:569:18)
    at Promise._settlePromise0 (C:\Program Files\nodejs\node_modules\bluebird\js
\release\promise.js:614:10)
    at Promise._settlePromises (C:\Program Files\nodejs\node_modules\bluebird\js
\release\promise.js:693:18)
    at Promise._fulfill (C:\Program Files\nodejs\node_modules\bluebird\js\releas
e\promise.js:638:18)
    at Promise._resolveCallback (C:\Program Files\nodejs\node_modules\bluebird\j
s\release\promise.js:432:57)
    at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\b
luebird\js\release\promise.js:524:17)
    at Promise._settlePromise (C:\Program Files\nodejs\node_modules\bluebird\js\
release\promise.js:569:18)
    at Promise._settlePromise0 (C:\Program Files\nodejs\node_modules\bluebird\js
\release\promise.js:614:10)
    at Promise._settlePromises (C:\Program Files\nodejs\node_modules\bluebird\js
\release\promise.js:693:18)
    at Promise._fulfill (C:\Program Files\nodejs\node_modules\bluebird\js\releas
e\promise.js:638:18)
    at Promise._resolveCallback (C:\Program Files\nodejs\node_modules\bluebird\j
s\release\promise.js:432:57)
    at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\b
luebird\js\release\promise.js:524:17)
    at Promise._settlePromise (C:\Program Files\nodejs\node_modules\bluebird\js\
release\promise.js:569:18)
  name: 'AssertionError',
  actual: null,
  expected: true,
  operator: '==',
  message: 'expected appDeliveryData',
  generatedMessage: false } 

@snirad
hi :)
i've tried package: com.facebook.katana and the version code 70506845

commented

@snirad
i tested your version, and get errors.

on app id: com.symudolcreadigol.prosiectx - errors

➜  gp-get-sha1 com.symudolcreadigol.prosiectx
AssertionError [ERR_ASSERTION]: expected appDeliveryData
➜  gp-download-info com.symudolcreadigol.prosiectx
AssertionError [ERR_ASSERTION]: expected appDeliveryData
➜  gp-download-meta com.symudolcreadigol.prosiectx
AssertionError [ERR_ASSERTION]: expected appDeliveryData

on app id: com.facebook.katana - working

➜  gp-download-meta com.facebook.katana

{
  "appCategory": [],
  "certificateHash": [],
  "certificateSet": [
    "8a3c4b262d721acd49a4bf97d5213199c86fa2b9"
  ],
  "email": "android-support@fb.com",
  "minDownloadCount": 1000000000,
  "name": "Facebook",
  "packageName": "com.facebook.katana",
  "price": [
    "Free"
  ],
  "vendor": "Facebook",
  "website": "https://www.facebook.com/facebook",
  "sha1": "66c690c1e77d778d6291f7041412eaf563a0219e",
  "versionCode": 70897377,
  "size": 90384755
}
➜  gp-download-info com.facebook.katana
{"downloadSize":{"low":90384755,"high":0,"unsigned":false},"signature":"xxxxxxxxxxx","downloadUrl":"https://android.clients.google.com/market/download/Download?packageName=com.facebook.katana&versionCode=70897377&ssl=1&token=xxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxx&did=0&cpn=A4PXntthyAq_IBix","additionalFile":[],"downloadAuthCookie":[{"name":"a","value":"42"}],"forwardLocked":false,"refundTimeout":null,"serverInitiated":true,"postInstallRefundWindowMillis":null,"immediateStartNeeded":null,"patchData":null,"encryptionParams":null,"gzippedDownloadUrl":"https://android.clients.google.com/market/download/Download?packageName=com.facebook.katana&versionCode=70897377&ssl=1&token=xxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxx-xxxxxxxxxxx&cf=2&did=0&cpn=8muKr1OfimaQbwsj","gzippedDownloadSize":{"low":75982020,"high":0,"unsigned":false},"splitDeliveryData":[],"installLocation":2}
➜  gp-get-sha1 com.facebook.katana
66c690c1e77d778d6291f7041412eaf563a0219e
commented

@imKota Looks like a problem with the apk in google store,
https://play.google.com/store/apps/details?id=com.symudolcreadigol.prosiectx
Dont think the device we are using to simulate the request for this apk is supported by this app.

commented

@snirad Thanks for the quick response!
Tomorrow I'll try to register an account via VPN, and try to download the application. The results will be reported:)

same issue here, @snirad 's PR fixes it

I am also getting the 'expected appDeliveryData' error, on some packages:

Download error:
{ AssertionError: expected appDeliveryData
at /home/ubuntu/gpapi-server/node_modules/gpapi/lib/api.js:419:9
at tryCatcher (/home/ubuntu/gpapi-server/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/ubuntu/gpapi-server/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/home/ubuntu/gpapi-server/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/home/ubuntu/gpapi-server/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/home/ubuntu/gpapi-server/node_modules/bluebird/js/release/promise.js:693:18)
at Promise._fulfill (/home/ubuntu/gpapi-server/node_modules/bluebird/js/release/promise.js:638:18)
at Promise._resolveCallback (/home/ubuntu/gpapi-server/node_modules/bluebird/js/release/promise.js:432:57)
at Promise._settlePromiseFromHandler (/home/ubuntu/gpapi-server/node_modules/bluebird/js/release/promise.js:524:17)
at Promise._settlePromise (/home/ubuntu/gpapi-server/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/home/ubuntu/gpapi-server/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/home/ubuntu/gpapi-server/node_modules/bluebird/js/release/promise.js:693:18)
at Promise._fulfill (/home/ubuntu/gpapi-server/node_modules/bluebird/js/release/promise.js:638:18)
at Promise._resolveCallback (/home/ubuntu/gpapi-server/node_modules/bluebird/js/release/promise.js:432:57)
at Promise._settlePromiseFromHandler (/home/ubuntu/gpapi-server/node_modules/bluebird/js/release/promise.js:524:17)
at Promise._settlePromise (/home/ubuntu/gpapi-server/node_modules/bluebird/js/release/promise.js:569:18)
name: 'AssertionError',

commented

@jacobhub I've seen it happen mostly when application is not supported either by geo or device.

commented

Hi,

I changed the flow for getDownloadInfo, looks like if your account trying to download a new apk
getting downloadInfo from delivery url will fail. however, if you try to get purchase url, and then delivery, it should succeed.

try and see if it works for you.

now getting this error ( package 'com.facebook.lite' ):

Download error:
{ Error
at handleErr (/home/ubuntu/gpapiserv/node_modules/gpapi/lib/api.js:248:39)
at /home/ubuntu/gpapiserv/node_modules/gpapi/lib/api.js:253:28
at tryCatcher (/home/ubuntu/gpapiserv/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/ubuntu/gpapiserv/node_modules/bluebird/js/release/promise.js:509:35)
at Promise._settlePromise (/home/ubuntu/gpapiserv/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/home/ubuntu/gpapiserv/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/home/ubuntu/gpapiserv/node_modules/bluebird/js/release/promise.js:693:18)
at Promise._fulfill (/home/ubuntu/gpapiserv/node_modules/bluebird/js/release/promise.js:638:18)
at PromiseArray._resolve (/home/ubuntu/gpapiserv/node_modules/bluebird/js/release/promise_array.js:126:19)
at PromiseArray._promiseFulfilled (/home/ubuntu/gpapiserv/node_modules/bluebird/js/release/promise_array.js:144:14)
at PromiseArray._iterate (/home/ubuntu/gpapiserv/node_modules/bluebird/js/release/promise_array.js:114:31)
at PromiseArray.init [as _init] (/home/ubuntu/gpapiserv/node_modules/bluebird/js/release/promise_array.js:78:10)
at Promise._settlePromise (/home/ubuntu/gpapiserv/node_modules/bluebird/js/release/promise.js:566:21)
at Promise._settlePromise0 (/home/ubuntu/gpapiserv/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/home/ubuntu/gpapiserv/node_modules/bluebird/js/release/promise.js:693:18)
at Promise._fulfill (/home/ubuntu/gpapiserv/node_modules/bluebird/js/release/promise.js:638:18)
message: 'Google Play purchases are not supported in your country. Unfortunately you will not be able to complete purchases.',
name: 'RequestError',
statusCode: 403,

commented

@jacobhub doing this using the previous patch worked for you ?
-it worked for me using a new account. so i think its expected behavior, seeing the message you got

message: 'Google Play purchases are not supported in your country. Unfortunately you will not be able to complete purchases.',

@dweinstein, where are we at with the pull? Is there something blocking it?

I don't think the PR maintains API compatibility and I haven't had the time to sort thru it yet.

@snirad, any idea why i'm getting AssertionError [ERR_ASSERTION]: expected appDeliveryData for com.facebook.katana ? if i'm running the details function it works as expected just download is broken

is there any progress on this issue?

try v4.3.2

Thank you @dweinstein but doesn't work!

Double check that your login information is for a recent device such as nexus on 6.0.1 and that you are getting the android ID as described in the README

@dweinstein thank you,
I updated google-play-cli to 4.5.0 and gpapi to 4.4.0 and all working awesome

I update gpapi to 4.4.0 and use GSFID of Android 6.1 but when use api.deliveryData(pkg, vc). get the error

expected appDeliveryData

I fixed it by using completeDownloadInfo instead of deliveryData.
Thank You @dweinstein .