mirror of
https://github.com/FliegendeWurst/googleplay-api.git
synced 2024-11-22 12:54:58 +00:00
Removed nb_results and offset from search()
This commit is contained in:
parent
cd6d686eff
commit
e1d2671caf
@ -247,7 +247,7 @@ class GooglePlayAPI(object):
|
|||||||
self.gsfId = gsfId
|
self.gsfId = gsfId
|
||||||
self.setAuthSubToken(authSubToken)
|
self.setAuthSubToken(authSubToken)
|
||||||
# check if token is valid with a simple search
|
# check if token is valid with a simple search
|
||||||
self.search('drv', 1, None)
|
self.search('drv')
|
||||||
else:
|
else:
|
||||||
raise LoginError('Either (email,pass) or (gsfId, authSubToken) is needed')
|
raise LoginError('Either (email,pass) or (gsfId, authSubToken) is needed')
|
||||||
|
|
||||||
@ -346,7 +346,7 @@ class GooglePlayAPI(object):
|
|||||||
entryIterator = data.payload.searchSuggestResponse.entry
|
entryIterator = data.payload.searchSuggestResponse.entry
|
||||||
return list(map(utils.parseProtobufObj, entryIterator))
|
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.
|
""" Search the play store for an app.
|
||||||
|
|
||||||
nb_result (int): is the maximum number of result to be returned
|
nb_result (int): is the maximum number of result to be returned
|
||||||
@ -356,12 +356,7 @@ class GooglePlayAPI(object):
|
|||||||
if self.authSubToken is None:
|
if self.authSubToken is None:
|
||||||
raise Exception("You need to login before executing any request")
|
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))
|
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
|
# FIXME: not sure if this toc call should be here
|
||||||
self.toc()
|
self.toc()
|
||||||
data = self.executeRequestApi2(path)
|
data = self.executeRequestApi2(path)
|
||||||
|
@ -16,7 +16,7 @@ server.login(None, None, gsfId, authSubToken)
|
|||||||
print("\nSearch suggestion for \"fir\"\n")
|
print("\nSearch suggestion for \"fir\"\n")
|
||||||
print(server.searchSuggest("fir"))
|
print(server.searchSuggest("fir"))
|
||||||
|
|
||||||
result = server.search("firefox", 34, None)
|
result = server.search("firefox")
|
||||||
for doc in result:
|
for doc in result:
|
||||||
print("doc: {}".format(doc["docid"]))
|
print("doc: {}".format(doc["docid"]))
|
||||||
for cluster in doc["child"]:
|
for cluster in doc["child"]:
|
||||||
|
Loading…
Reference in New Issue
Block a user