From 43ecdcaa96aec16ec7c27e65fe135c58c716bb68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Sat, 27 Feb 2021 21:20:51 +0100 Subject: [PATCH] Make deliver return a dict instead of response --- gpapi/googleplay.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gpapi/googleplay.py b/gpapi/googleplay.py index 6982a02..adb1b67 100644 --- a/gpapi/googleplay.py +++ b/gpapi/googleplay.py @@ -498,7 +498,7 @@ def reviews(self, packageName, filterByDevice=False, sort=2, output.append(utils.parseProtobufObj(review)) return output - def _deliver_data(self, url, cookies): + def deliver_data(self, url, cookies): headers = self.getHeaders() response = requests.get(url, headers=headers, cookies=cookies, verify=ssl_verify, @@ -559,16 +559,17 @@ def delivery(self, packageName, versionCode=None, offerType=1, result['additionalData'] = [] result['splits'] = [] downloadUrl = response.payload.deliveryResponse.appDeliveryData.downloadUrl + downloadSize = response.payload.deliveryResponse.appDeliveryData.downloadSize cookie = response.payload.deliveryResponse.appDeliveryData.downloadAuthCookie[0] cookies = { str(cookie.name): str(cookie.value) } - result['file'] = self._deliver_data(downloadUrl, cookies) + result['file'] = {"url": downloadUrl, "cookies": cookies, "size": downloadSize} for split in response.payload.deliveryResponse.appDeliveryData.split: a = {} a['name'] = split.name - a['file'] = self._deliver_data(split.downloadUrl, None) + a['file'] = {"url": split.downloadUrl, "cookies": None, "size": split.size} result['splits'].append(a) if not expansion_files: @@ -583,7 +584,7 @@ def delivery(self, packageName, versionCode=None, offerType=1, obbType = 'patch' a['type'] = obbType a['versionCode'] = obb.versionCode - a['file'] = self._deliver_data(obb.downloadUrl, None) + a['file'] = {"url": obb.downloadUrl, "cookies": None, "size": obb.size} result['additionalData'].append(a) return result