From e1d2671caf1aa37eb160f430f9ddc07647c390dc Mon Sep 17 00:00:00 2001 From: Domenico Iezzi Date: Sun, 23 Dec 2018 23:37:07 +0100 Subject: [PATCH] Removed nb_results and offset from search() --- gpapi/googleplay.py | 9 ++------- test/test.py | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/gpapi/googleplay.py b/gpapi/googleplay.py index 48d7617..a804c42 100644 --- a/gpapi/googleplay.py +++ b/gpapi/googleplay.py @@ -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) diff --git a/test/test.py b/test/test.py index c8240d9..21155cd 100644 --- a/test/test.py +++ b/test/test.py @@ -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"]: