NoMore201 / googleplay-api

Google Play Unofficial Python API
Other
413 stars 208 forks source link

Download apk file via PackageId #55

Closed 4j17h closed 6 years ago

4j17h commented 6 years ago

from gpapi.googleplay import GooglePlayAPI, RequestError import sys import argparse ap = argparse.ArgumentParser(description='Test download of expansion files') ap.add_argument('-e', '--email', dest='email', help='google username') ap.add_argument('-p', '--password', dest='password', help='google password') ap.add_argument('-id', '--pacid', dest='PackageId', help='PackageId') args = ap.parse_args() server = GooglePlayAPI('en_US', 'Europe/Rome') # LOGIN print('\nLogging in with email and password\n') server.login(args.email, args.password, None, None) gsfId = server.gsfId authSubToken = server.authSubToken print('\nNow trying secondary login with ac2dm token and gsfId saved\n') server = GooglePlayAPI('en_US', 'Europe/Rome') server.login(None, None, gsfId, authSubToken) print('\nAttempting to download %s\n' % args.PackageId) fl = server.download(args.PackageId) with open(args.PackageId + '.apk', 'wb') as apk_file: for chunk in fl.get('file').get('data'): apk_file.write(chunk) print('\nDownload successful\n')

NoMore201 commented 6 years ago

You should make commits on your own fork and submit a PR rather than using comments. Read more here: https://help.github.com/articles/creating-a-pull-request-from-a-fork/