2017-09-21 09:19:48 +00:00
|
|
|
from gpapi.googleplay import GooglePlayAPI
|
2017-09-05 20:28:06 +00:00
|
|
|
|
2017-09-18 14:06:57 +00:00
|
|
|
import sys
|
|
|
|
|
2017-09-19 15:52:29 +00:00
|
|
|
EMAIL = "maracaiboez"
|
|
|
|
PASSWD = "fjgozwjmkwyvvutt"
|
2017-09-16 11:17:21 +00:00
|
|
|
|
2017-09-16 17:13:01 +00:00
|
|
|
testApps = ['com.cpuid.cpu_z']
|
2017-10-04 09:32:56 +00:00
|
|
|
server = GooglePlayAPI(debug=True)
|
2017-09-16 17:13:01 +00:00
|
|
|
|
2017-09-18 14:06:57 +00:00
|
|
|
try:
|
|
|
|
print('\nLogging in with email and password\n')
|
|
|
|
server.login(EMAIL, PASSWD, None, None)
|
|
|
|
gsfId = server.gsfId
|
2017-10-04 09:32:56 +00:00
|
|
|
authSubToken = server.authSubToken
|
2017-09-16 17:13:01 +00:00
|
|
|
|
2017-09-18 14:06:57 +00:00
|
|
|
print('\nNow trying secondary login with ac2dm token and gsfId saved\n')
|
2017-10-04 09:32:56 +00:00
|
|
|
server = GooglePlayAPI(debug=True)
|
|
|
|
server.login(None, None, gsfId, authSubToken)
|
2017-09-16 17:13:01 +00:00
|
|
|
|
2017-09-18 14:06:57 +00:00
|
|
|
apps = server.search('telegram', 1, None)
|
|
|
|
print('\nFound those apps:\n')
|
|
|
|
for a in apps:
|
|
|
|
print(a['docId'])
|
|
|
|
docid = apps[0]['docId']
|
|
|
|
version = apps[0]['versionCode']
|
|
|
|
print('\nTelegram docid is: %s\n' % docid)
|
|
|
|
print('\nAttempting to download %s\n' % docid)
|
|
|
|
fl = server.download(docid, version)
|
|
|
|
with open(docid + '.apk', 'wb') as f:
|
|
|
|
f.write(fl)
|
|
|
|
print('\nDownload successful\n')
|
|
|
|
f.close()
|
|
|
|
print('\nGetting details for %s\n' % testApps[0])
|
|
|
|
bulk = server.bulkDetails(testApps)
|
|
|
|
print(bulk)
|
|
|
|
except Exception as e:
|
|
|
|
print(str(e))
|
|
|
|
sys.exit(1)
|