APKfetch icon indicating copy to clipboard operation
APKfetch copied to clipboard

Return value of apk.get_download_url is an empty string

Open noahbald opened this issue 5 years ago • 5 comments

Hello, I want to use this package to crawl through various apps and download them for a research project. Right now I'm trying to set it up just to download chrome, however, when I run the code (shown below) the return value of apk.get_download_url is an empty string, causing apk.fetch to fail

from apkfetch import APKfetch

def main():
  apk = APKfetch()
  apk.login('[email protected]', 'password', 'abcd1234efgh5678')
  package = 'com.android.chrome'
  version = apk.version(package)
  url = apk.get_download_url(package, version)
  apk.fetch(package, version)

if __name__ == '__main__':
    main()

Is there something wrong with the way I've set this up, or is it a bug which needs to be resolved.

FYI the value of response.text after line 172 in apkfetch.py is '\n\x05�\x01\x02\x08\x03*\x02\x08dJ\x1c\x08\x12�\x01\x17\n\x13\x08ε㨀Ϊ�λ\x02\x15F�h\n\x1d\x03Ξ\tΛ\x10\x01' and the status code is 200

noahbald avatar Aug 16 '20 02:08 noahbald

Has anyone found a workaround to this?

iDuronto avatar Oct 23 '20 17:10 iDuronto

I would also appreciate a fix

yotamgod avatar Nov 08 '20 13:11 yotamgod

Well I figured out the reason for the blank url - it seems the app you are downloading needs to be "purchased". I found a similar case in gpapi and just assumed it is for the same reason.

yotamgod avatar Nov 08 '20 14:11 yotamgod

Did you get it to work @yotamgod? I was testing with downloading Chrome at the time, which is free, and I was still getting this issue.

noahbald avatar Nov 11 '20 00:11 noahbald

I did. Try making an additional request to the "purchase" endpoint of the google api before the delivery request (replace "/delivery"). Play around with it and check out some other similar projects for inspiration. Good luck!

yotamgod avatar Nov 11 '20 11:11 yotamgod