Skip to content

Commit

Permalink
Revert "Make deliver return a dict instead of response"
Browse files Browse the repository at this point in the history
This reverts commit 43ecdca.
  • Loading branch information
matt668 committed May 12, 2022
1 parent 4ed9d1a commit d862c4a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions gpapi/googleplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -559,17 +559,16 @@ 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'] = {"url": downloadUrl, "cookies": cookies, "size": downloadSize}
result['file'] = self._deliver_data(downloadUrl, cookies)

for split in response.payload.deliveryResponse.appDeliveryData.split:
a = {}
a['name'] = split.name
a['file'] = {"url": split.downloadUrl, "cookies": None, "size": split.size}
a['file'] = self._deliver_data(split.downloadUrl, None)
result['splits'].append(a)

if not expansion_files:
Expand All @@ -584,7 +583,7 @@ def delivery(self, packageName, versionCode=None, offerType=1,
obbType = 'patch'
a['type'] = obbType
a['versionCode'] = obb.versionCode
a['file'] = {"url": obb.downloadUrl, "cookies": None, "size": obb.size}
a['file'] = self._deliver_data(obb.downloadUrl, None)
result['additionalData'].append(a)
return result

Expand Down

0 comments on commit d862c4a

Please sign in to comment.