Removed nb_results and offset from search()

This commit is contained in:
Domenico Iezzi 2018-12-23 23:37:07 +01:00
parent cd6d686eff
commit e1d2671caf
No known key found for this signature in database
GPG Key ID: D8CE73FC9E4393C3
2 changed files with 3 additions and 8 deletions

View File

@ -247,7 +247,7 @@ class GooglePlayAPI(object):
self.gsfId = gsfId
self.setAuthSubToken(authSubToken)
# check if token is valid with a simple search
self.search('drv', 1, None)
self.search('drv')
else:
raise LoginError('Either (email,pass) or (gsfId, authSubToken) is needed')
@ -346,7 +346,7 @@ class GooglePlayAPI(object):
entryIterator = data.payload.searchSuggestResponse.entry
return list(map(utils.parseProtobufObj, entryIterator))
def search(self, query, nb_result, offset=None):
def search(self, query):
""" Search the play store for an app.
nb_result (int): is the maximum number of result to be returned
@ -356,12 +356,7 @@ class GooglePlayAPI(object):
if self.authSubToken is None:
raise Exception("You need to login before executing any request")
remaining = nb_result
output = []
path = SEARCH_URL + "?c=3&q={}".format(requests.utils.quote(query))
if (offset is not None):
nextPath += "&o={}".format(offset)
# FIXME: not sure if this toc call should be here
self.toc()
data = self.executeRequestApi2(path)

View File

@ -16,7 +16,7 @@ server.login(None, None, gsfId, authSubToken)
print("\nSearch suggestion for \"fir\"\n")
print(server.searchSuggest("fir"))
result = server.search("firefox", 34, None)
result = server.search("firefox")
for doc in result:
print("doc: {}".format(doc["docid"]))
for cluster in doc["child"]: