mirror of
https://github.com/FliegendeWurst/googleplay-api.git
synced 2024-11-22 04:44:59 +00:00
test.py: fixed wrong method + added progressbar
Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
This commit is contained in:
parent
73906b104e
commit
cb2dc79344
6
test.py
6
test.py
@ -36,7 +36,7 @@ docid = apps[0]['docId']
|
||||
version = apps[0]['versionCode']
|
||||
print('\nTermux docid is: %s\n' % docid)
|
||||
print('\nAttempting to download %s\n' % docid)
|
||||
fl = server.download(docid, version)
|
||||
fl = server.download(docid, version, progress_bar=True)
|
||||
with open(docid + '.apk', 'wb') as f:
|
||||
f.write(fl)
|
||||
print('\nDownload successful\n')
|
||||
@ -46,18 +46,20 @@ with open(docid + '.apk', 'wb') as f:
|
||||
# Attempting to download Nova Launcher Prime
|
||||
# it should throw an error 'App Not Purchased'
|
||||
|
||||
print('\nAttempting to download "com.teslacoilsw.launcher.prime"\n')
|
||||
errorThrown = False
|
||||
try:
|
||||
app = server.search('nova launcher prime', 3, None)
|
||||
app = filter(lambda x: x['docId'] == 'com.teslacoilsw.launcher.prime', app)
|
||||
app = list(app)[0]
|
||||
fl = server.download(app['docId'], app['versionCode'])
|
||||
fl = server.delivery(app['docId'], app['versionCode'], progress_bar=True)
|
||||
with open(docid + '.apk', 'wb') as f:
|
||||
f.write(fl)
|
||||
print('\nDownload successful\n')
|
||||
f.close()
|
||||
except RequestError as e:
|
||||
errorThrown = True
|
||||
print(e)
|
||||
|
||||
if not errorThrown:
|
||||
print('Download of previous app should have failed')
|
||||
|
Loading…
Reference in New Issue
Block a user