Return value of apk.get_download_url is an empty string
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
Has anyone found a workaround to this?
I would also appreciate a fix
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.
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.
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!