forked from egirault/googleplay-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdetails.py
42 lines (30 loc) · 1.07 KB
/
details.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
##
## Basic script to retrieve the public details of an app.
## author: Alessandra Gorla
##
#!/usr/bin/python
#!/usr/bin/python
# Do not remove
GOOGLE_LOGIN = GOOGLE_PASSWORD = AUTH_TOKEN = None
import requests
import sys
from pprint import pprint
from config import *
from googleplay import GooglePlayAPI
from helpers import sizeof_fmt, print_header_line, print_result_line
from google.protobuf import text_format
from requests.packages.urllib3.exceptions import InsecureRequestWarning
if (len(sys.argv) < 2):
print "\nUsage: %s appPackageName." % sys.argv[0]
print "Retrieves the details (i.e. description, URL to screenshots etc) of a specific app.\n"
sys.exit(0)
# Dealing with user's parameter
appname = sys.argv[1]
# Ignore unverified HTTPS request warning.
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
# authentication
api = GooglePlayAPI(ANDROID_ID)
api.login(GOOGLE_LOGIN, GOOGLE_PASSWORD, AUTH_TOKEN)
#invoking api method to get the app details.
detailsResponse = api.details(appname)
print text_format.MessageToString(detailsResponse)