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
MIT License
271 stars 84 forks source link

Does not work, returns null values #66

Closed imKota closed 6 years ago

imKota commented 7 years ago

Hello! Your parser again stopped working. Works only: App details Do you plan to fix it?

➜  gp-download-info com.skype.raider | jq '.'
{ 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 }

Thanks!

dweinstein commented 7 years ago

it works for me and I cannot reproduce this. what version of the library are you using? also check your ANDROID_ID (device) is checked in properly to google play services.

imKota commented 7 years ago

@dweinstein

what version of the library are you using

latest 4.3.1

I checked my ANDROID_ID, it gives empty values with it if I use the "gp-download-info, gp-download-meta, gp-get-sha1" method. And if you use the method "gp-details" then the data is given.

I checked on the ANDROID_ID of the second device, on it all the methods worked. It turns out I got a ban? But after all on the phone everything is downloaded. Any ideas? p.s. If it's interesting to find out the reason, I can send data to the mail for input, as well as ANDROID_ID.

dweinstein commented 7 years ago

try setting DEBUG=gp:api

imKota commented 7 years ago

@dweinstein

use example:

➜  export GOOGLE_LOGIN=my mail GOOGLE_PASSWORD=my pass ANDROID_ID=my id DEBUG=gp:api

➜  gp-bulk-details com.viber.voip | jq '.'

return:

{ request: 
   { debugId: 1,
     uri: 'https://android.clients.google.com/auth',
     method: 'POST',
     headers: 
      { host: 'android.clients.google.com',
        'content-type': 'application/x-www-form-urlencoded',
        'accept-encoding': 'gzip, deflate',
        'content-length': 426 },
     body: 'Email=my mail&EncryptedPasswd=my pass&service=androidmarket&accountType=HOSTED_OR_GOOGLE&has_permission=1&source=android&androidId=my id&app=com.android.vending&device_country=us&operatorCountry=us&lang=us&sdk_version=23' } }
{ response: 
   { debugId: 1,
     headers: 
      { 'content-type': 'text/plain; charset=utf-8',
        'cache-control': 'no-cache, no-store, max-age=0, must-revalidate',
        pragma: 'no-cache',
        expires: 'Mon, 01 Jan 1990 00:00:00 GMT',
        date: 'Fri, 25 Aug 2017 18:20:02 GMT',
        'content-encoding': 'gzip',
        'x-content-type-options': 'nosniff',
        'x-frame-options': 'SAMEORIGIN',
        'x-xss-protection': '1; mode=block',
        server: 'GSE',
        'alt-svc': 'quic=":443"; ma=2592000; v="39,38,37,35"',
        connection: 'close',
        'transfer-encoding': 'chunked' },
     statusCode: 200,
     body: 'SID=BAD_COOKIE\nLSID=BAD_COOKIE\nAuth=my cookie\nToken=my token\nservices=blogger,ig,peoplesense,lbc,lso,sitemaps,talk,oz,cf,mail,youtube,android,cl,adwords,googleplay,doritos,googleme,esmobile,lh2,webupdates,multilogin,groups2,chromiumsync,omaha,friendview,adsense,jotspot,writely,hasacceptedpagestos,mapsengine,analytics,wise,sj,mymaps,sierra,cloudconsole,androidconsole,cprose' } }
{ request: 
   { debugId: 2,
     uri: 'https://android.clients.google.com/fdfe/bulkDetails',
     method: 'POST',
     headers: 
      { 'Accept-Language': 'en_US',
        Authorization: 'GoogleLogin auth=my cookie',
        'X-DFE-Enabled-Experiments': 'cl:billing.select_add_instrument_by_default',
        'X-DFE-Unsupported-Experiments': 'nocache:billing.use_charging_poller,market_emails,buyer_currency,prod_baseline,checkin.set_asset_paid_app_field,shekel_test,content_ratings,buyer_currency_in_app,nocache:encrypted_apk,recent_changes',
        'X-DFE-Device-Id': 'my id',
        'X-DFE-Client-Id': 'am-android-google',
        'User-Agent': 'Android-Finsky/6.8.44.F-all%20%5B0%5D%203087104 (api=3,versionCode=80684400,sdk=23,device=bullhead,hardware=bullhead,product=bullhead,platformVersionRelease=6.0.1,model=Nexus%205X,buildId=MHC19Q,isWideScreen=0)',
        'X-DFE-SmallestScreenWidthDp': '320',
        'X-DFE-Filter-Level': '3',
        Host: 'android.clients.google.com',
        'X-DFE-No-Prefetch': true,
        'Content-Type': 'application/x-protobuf',
        'content-length': 20 },
     body: '\n\u000ecom.viber.voip\u0010\u0001\u0018\u0001' } }
{ response: 
   { debugId: 2,
     headers: 
      { 'content-type': 'application/protobuf',
        'x-dfe-soft-ttl': '7200000',
        'x-dfe-hard-ttl': '7200000',
        expires: 'Fri, 25 Aug 2017 18:20:03 GMT',
        date: 'Fri, 25 Aug 2017 18:20:03 GMT',
        'cache-control': 'private, max-age=7200',
        'x-dfe-content-length': '4576',
        'x-content-type-options': 'nosniff',
        'x-frame-options': 'SAMEORIGIN',
        'x-xss-protection': '1; mode=block',
        server: 'GSE',
        'alt-svc': 'quic=":443"; ma=2592000; v="39,38,37,35"',
        'accept-ranges': 'none',
        vary: 'Accept-Encoding',
        connection: 'close' },
     statusCode: 200,
     body: <Buffer 0a fc 48 9a 01 f8 48 0a f5 48 0a f2 48 0a 0e 63 6f 6d 2e 76 69 62 65 72 2e 76 6f 69 70 12 0e 63 6f 6d 2e 76 69 62 65 72 2e 76 6f 69 70 18 01 20 03 2a ... > } }
[
  {
    "docid": "com.viber.voip",
    "backendDocid": "com.viber.voip",
    "docType": 1,
    "backendId": 3,
    "title": "Viber Messenger",
    "creator": "Viber Media S.à r.l.",

    ****

    "detailsUrl": "details?doc=com.viber.voip",
    "shareUrl": "https://play.google.com/store/apps/details?id=com.viber.voip",
    "reviewsUrl": "rev?doc=com.viber.voip&n=20&o=0",
    "backendUrl": null,
    "purchaseDetailsUrl": null,
    "detailsReusable": true,
    "subtitle": null,
    "translatedDescriptionHtml": null,
    "serverLogsCookie": "\b\u0002\u001a-\n\u0016\u0012\u0014\n\u000ecom.viber.voip\u0010\u0001\u0018\u00032\u0013\b������\u0002\u0015\u0013--\n\u001diL\fe",
    "productDetails": {
      "title": null,
      "section": [
        {
          "title": "In-app purchases",
          "description": [
            {
              "image": null,
              "description": "RUB30.00 - RUB1,689.02 per item"
            }
          ]
        },
        {
          "title": "Offered by",
          "description": [
            {
              "image": null,
              "description": "Viber Media S.à r.l."
            }
          ]
        },
        {
          "title": "Developer e-mail",
          "description": [
            {
              "image": null,
              "description": "support@viber.com"
            }
          ]
        },
        {
          "title": "Developer address",
          "description": [
            {
              "image": null,
              "description": "Viber Media, S.à r.l.,<br/>2, rue des Fossé, L-1536 Luxembourg, Grand Duchy of Luxembourg."
            }
          ]
        }
      ]
    },
    "mature": false,
    "promotionalDescription": "Viber Messenger: Text Messages, Free Phone Calls, Live Video Chats and more!",
    "availabileForPreregistration": null,
    "tip": [],
    "snippetsUrl": null,
    "forceShareability": null,
    "useWishlistAsPrimaryAction": null
  }
]
➜  export GOOGLE_LOGIN=my mail GOOGLE_PASSWORD=my pass ANDROID_ID=my id DEBUG=gp:api

➜  gp-download-info com.viber.voip | jq '.'                                                                               

return:

{ request: 
   { debugId: 1,
     uri: 'https://android.clients.google.com/auth',
     method: 'POST',
     headers: 
      { host: 'android.clients.google.com',
        'content-type': 'application/x-www-form-urlencoded',
        'accept-encoding': 'gzip, deflate',
        'content-length': 426 },
     body: 'Email=my mail&EncryptedPasswd=my pass&service=androidmarket&accountType=HOSTED_OR_GOOGLE&has_permission=1&source=android&androidId=my id&app=com.android.vending&device_country=us&operatorCountry=us&lang=us&sdk_version=23' } }
{ response: 
   { debugId: 1,
     headers: 
      { 'content-type': 'text/plain; charset=utf-8',
        'cache-control': 'no-cache, no-store, max-age=0, must-revalidate',
        pragma: 'no-cache',
        expires: 'Mon, 01 Jan 1990 00:00:00 GMT',
        date: 'Fri, 25 Aug 2017 18:25:27 GMT',
        'content-encoding': 'gzip',
        'x-content-type-options': 'nosniff',
        'x-frame-options': 'SAMEORIGIN',
        'x-xss-protection': '1; mode=block',
        server: 'GSE',
        'alt-svc': 'quic=":443"; ma=2592000; v="39,38,37,35"',
        connection: 'close',
        'transfer-encoding': 'chunked' },
     statusCode: 200,
     body: 'SID=BAD_COOKIE\nLSID=BAD_COOKIE\nAuth=my cookie\nToken=my token\nservices=blogger,ig,peoplesense,lbc,lso,sitemaps,talk,oz,cf,mail,youtube,android,cl,adwords,googleplay,doritos,googleme,esmobile,lh2,webupdates,multilogin,groups2,chromiumsync,omaha,friendview,adsense,jotspot,writely,hasacceptedpagestos,mapsengine,analytics,wise,sj,mymaps,sierra,cloudconsole,androidconsole,cprose' } }
{ request: 
   { debugId: 2,
     uri: 'https://android.clients.google.com/fdfe/details?doc=com.viber.voip',
     method: 'GET',
     headers: 
      { 'Accept-Language': 'en_US',
        Authorization: 'GoogleLogin auth=my cookie',
        'X-DFE-Enabled-Experiments': 'cl:billing.select_add_instrument_by_default',
        'X-DFE-Unsupported-Experiments': 'nocache:billing.use_charging_poller,market_emails,buyer_currency,prod_baseline,checkin.set_asset_paid_app_field,shekel_test,content_ratings,buyer_currency_in_app,nocache:encrypted_apk,recent_changes',
        'X-DFE-Device-Id': 'my id',
        'X-DFE-Client-Id': 'am-android-google',
        'User-Agent': 'Android-Finsky/6.8.44.F-all%20%5B0%5D%203087104 (api=3,versionCode=80684400,sdk=23,device=bullhead,hardware=bullhead,product=bullhead,platformVersionRelease=6.0.1,model=Nexus%205X,buildId=MHC19Q,isWideScreen=0)',
        'X-DFE-SmallestScreenWidthDp': '320',
        'X-DFE-Filter-Level': '3',
        Host: 'android.clients.google.com',
        'X-DFE-No-Prefetch': true } } }
{ response: 
   { debugId: 2,
     headers: 
      { 'content-type': 'application/protobuf',
        'x-dfe-soft-ttl': '600000',
        'x-dfe-hard-ttl': '604800000',
        expires: 'Fri, 25 Aug 2017 18:25:28 GMT',
        date: 'Fri, 25 Aug 2017 18:25:28 GMT',
        'cache-control': 'private, max-age=600',
        'x-dfe-content-length': '5416',
        'x-content-type-options': 'nosniff',
        'x-frame-options': 'SAMEORIGIN',
        'x-xss-protection': '1; mode=block',
        server: 'GSE',
        'alt-svc': 'quic=":443"; ma=2592000; v="39,38,37,35"',
        'accept-ranges': 'none',
        vary: 'Accept-Encoding',
        connection: 'close' },
     statusCode: 200,
     body: <Buffer 0a f8 58 12 f5 58 22 f1 4e 0a 0e 63 6f 6d 2e 76 69 62 65 72 2e 76 6f 69 70 12 0e 63 6f 6d 2e 76 69 62 65 72 2e 76 6f 69 70 18 01 20 03 2a 0f 56 69 62 ... > } }
{ request: 
   { debugId: 3,
     uri: 'https://android.clients.google.com/fdfe/purchase',
     method: 'POST',
     headers: 
      { 'Accept-Language': 'en_US',
        Authorization: 'GoogleLogin auth=my cookie.',
        'X-DFE-Enabled-Experiments': 'cl:billing.select_add_instrument_by_default',
        'X-DFE-Unsupported-Experiments': 'nocache:billing.use_charging_poller,market_emails,buyer_currency,prod_baseline,checkin.set_asset_paid_app_field,shekel_test,content_ratings,buyer_currency_in_app,nocache:encrypted_apk,recent_changes',
        'X-DFE-Device-Id': 'my id',
        'X-DFE-Client-Id': 'am-android-google',
        'User-Agent': 'Android-Finsky/6.8.44.F-all%20%5B0%5D%203087104 (api=3,versionCode=80684400,sdk=23,device=bullhead,hardware=bullhead,product=bullhead,platformVersionRelease=6.0.1,model=Nexus%205X,buildId=MHC19Q,isWideScreen=0)',
        'X-DFE-SmallestScreenWidthDp': '320',
        'X-DFE-Filter-Level': '3',
        Host: 'android.clients.google.com',
        'X-DFE-No-Prefetch': true,
        'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
        'content-length': 33 },
     body: 'ot=1&doc=com.viber.voip&vc=120284' } }
{ response: 
   { debugId: 3,
     headers: 
      { 'content-type': 'application/protobuf',
        'cache-control': 'no-cache, no-store, max-age=0, must-revalidate',
        pragma: 'no-cache',
        expires: 'Mon, 01 Jan 1990 00:00:00 GMT',
        date: 'Fri, 25 Aug 2017 18:25:29 GMT',
        'x-dfe-content-length': '324',
        'x-content-type-options': 'nosniff',
        'x-frame-options': 'SAMEORIGIN',
        'x-xss-protection': '1; mode=block',
        server: 'GSE',
        'alt-svc': 'quic=":443"; ma=2592000; v="39,38,37,35"',
        'accept-ranges': 'none',
        vary: 'Accept-Encoding',
        connection: 'close' },
     statusCode: 200,
     body: <Buffer 0a 9d 02 22 9a 02 0a 02 08 00 ba 02 69 08 01 32 63 08 02 10 03 1a 0f 10 99 d7 81 cd 05 19 fe d4 50 e6 1a 68 d6 41 22 49 0a 14 0a 0e 63 6f 6d 2e 76 69 ... > } }
{
  "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
}            
dweinstein commented 7 years ago

You ran with DEBUG= but you didn't run the gp-download-info command which is the one you said isn't working?

imKota commented 7 years ago

@dweinstein

You ran with DEBUG= but you didn't run the gp-download-info command which is the one you said isn't working?

I'm sorry, I was sealed. The last log from gp-download-info :)