Updated README.md

This commit is contained in:
Domenico Iezzi 2019-01-23 14:36:18 +01:00
parent 6ca31cc1d2
commit 26f675c5a6

View File

@ -10,19 +10,33 @@ maintained anymore. The code was updated with some important changes:
(defaults to a OnePlus One)
# Usage
Check `test.py` for a simple example.
An important note about login function:
Check scripts in `test` directory for more examples on how to use this API.
```
def login(self, email=None, password=None, gsfId=None, authSubToken=None)
from gpapi.googleplay import GooglePlayAPI
mail = "mymail@google.com"
passwd = "mypasswd"
api = GooglePlayAPI(locale="en_US", timezone="UTC", device_codename="hero2lte")
api.login(email=mail, password=passwd)
result = server.search("firefox")
for doc in result:
print("doc: {}".format(doc["docid"]))
for cluster in doc["child"]:
print("\tcluster: {}".format(cluster["docid"]))
for app in cluster["child"]:
print("\t\tapp: {}".format(app["docid"]))
```
for first time logins, you should only provide email and password.
The module will take care of initalizing the api,upload device information
For first time logins, you should only provide email and password.
The module will take care of initalizing the api, upload device information
to the google account you supplied, and retrieving
a Google Service Framework ID (which, from now on, will be the android ID of a device).
a Google Service Framework ID (which, from now on, will be the android ID of your fake device).
For the next logins you **should** save the gsfId and the authSubToken, and provide them as parameters to the login function. If you login again with email and password only, this is the equivalent of re-initalizing your android device with a google account.
# Documentation
For some documentation about the google play API check out the relative folder.
For the next logins you **should** save the gsfId and the authSubToken, and provide them as parameters
to the login function. If you login again with email and password, this is the equivalent of
re-initalizing your android device with a google account, invalidating previous gsfId and authSubToken.