if (len(sys.argv) >= 4): nb_results = sys.argv[3] if (len(sys.argv) == 5): offset = sys.argv[4] # read config from config.py config = GooglePlayAPI.read_config() # connect to GooglePlayStore api = GooglePlayAPI(config['ANDROID_ID']) api.login(config['GOOGLE_LOGIN'], config['GOOGLE_PASSWORD'], config['AUTH_TOKEN']) try: message = api.list(cat, ctr, nb_results, offset) except: print("Error: HTTP 500 - one of the provided parameters is invalid") sys.exit(1) if (ctr is None): print("Subcategory ID", "Name", sep=config['SEPARATOR']) for doc in message.doc: print(helpers.str_compat(doc.docid), helpers.str_compat(doc.title), sep=config['SEPARATOR']) else: helpers.print_header_line() doc = message.doc[0] for c in doc.child: helpers.print_result_line(c)
from __future__ import unicode_literals import helpers from googleplay_api.googleplay import GooglePlayAPI packagenames = "com.reliancejio.mobilesecurity" # read config from config.py config = GooglePlayAPI.read_config() # connect to GooglePlayStore api = GooglePlayAPI(config['ANDROID_ID']) api.login(config['GOOGLE_LOGIN'], config['GOOGLE_PASSWORD'], config['AUTH_TOKEN']) # Only one app if (len(packagenames) == 1): response = api.details(packagenames[0]) for item in response.docV2.details.appDetails.permission: print(helpers.str_compat(item)) else: # More than one app response = api.bulkDetails(packagenames) for entry in response.entry: if (not not entry.ListFields()): # if the entry is not empty print(entry.doc.docid + ":") for item in entry.doc.details.appDetails.permission: print(" " + helpers.str_compat(item)) print()
if (len(sys.argv) >= 3): ctr = sys.argv[2] if (len(sys.argv) >= 4): nb_results = sys.argv[3] if (len(sys.argv) == 5): offset = sys.argv[4] # read config from config.py config = GooglePlayAPI.read_config() # connect to GooglePlayStore api = GooglePlayAPI(config['ANDROID_ID']) api.login(config['GOOGLE_LOGIN'], config['GOOGLE_PASSWORD'], config['AUTH_TOKEN']) try: message = api.list(cat, ctr, nb_results, offset) except: print("Error: HTTP 500 - one of the provided parameters is invalid") sys.exit(1) if (ctr is None): print("Subcategory ID", "Name", sep=config['SEPARATOR']) for doc in message.doc: print(helpers.str_compat(doc.docid), helpers.str_compat(doc.title), sep=config['SEPARATOR']) else: helpers.print_header_line() doc = message.doc[0] for c in doc.child: helpers.print_result_line(c)
if (len(sys.argv) < 2): print("Usage: %s packagename1 [packagename2 [...]]" % sys.argv[0]) print("Display permissions required to install the specified app(s).") sys.exit(0) packagenames = sys.argv[1:] # read config from config.py config = GooglePlayAPI.read_config() # connect to GooglePlayStore api = GooglePlayAPI(config) api.login() # Only one app if (len(packagenames) == 1): response = api.details(packagenames[0]) for item in response.docV2.details.appDetails.permission: print(helpers.str_compat(item)) else: # More than one app response = api.bulkDetails(packagenames) for entry in response.entry: if (not not entry.ListFields()): # if the entry is not empty print(entry.doc.docid + ":") for item in entry.doc.details.appDetails.permission: print(" " + helpers.str_compat(item)) print()