A more detailed test.py

Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
This commit is contained in:
Domenico Iezzi 2017-09-16 19:13:01 +02:00
parent 8d39d03304
commit 2a8ec84fc7

42
test.py
View File

@ -2,24 +2,28 @@ from googleplay import GooglePlayAPI
EMAIL = "" EMAIL = ""
PASSWD = "" PASSWD = ""
AC2DM = ""
GSFID = 0
testApps = ['com.cpuid.cpu_z']
server = GooglePlayAPI(True) server = GooglePlayAPI(True)
if AC2DM == "":
server.login(EMAIL, PASSWD, None, None) print('\nLogging in with email and password\n')
print(server.search('firefox', 1, None).child[0]) server.login(EMAIL, PASSWD, None, None)
print(server.bulkDetails(['com.mozilla.firefox'])) ac2dmToken = server.ac2dmToken
fl = server.download('com.cpuid.cpu_z', 23) gsfId = server.gsfId
with open('com.cpuid.cpu_z.apk', 'wb') as f:
f.write(fl) print('\nNow trying secondary login with ac2dm token and gsfId saved\n')
f.close() server.login(EMAIL, PASSWD, ac2dmToken, gsfId)
else:
server.gsfId = GSFID app = server.search('telegram', 1, None).child[0]
server.login(EMAIL, PASSWD, AC2DM, GSFID) docid = app.docid
print(server.search('firefox', 1, None).child[0]) version = app.details.appDetails.versionCode
print(server.bulkDetails(['com.mozilla.firefox'])) print('\nFirefox docid is: %s\n' % docid)
fl = server.download('com.cpuid.cpu_z', 23) print('\nAttempting to download %s\n' % docid)
with open('com.cpuid.cpu_z.apk', 'wb') as f: fl = server.download(docid, version)
f.write(fl) with open(docid + '.apk', 'wb') as f:
f.close() f.write(fl)
print('\nDownload successful\n')
f.close()
print('\nGetting details for %s\n' % testApps[0])
bulk = server.bulkDetails(testApps)
print(bulk)