From 6a3926fcd6eea8429b55e9cfd7b1ddd522cb25a0 Mon Sep 17 00:00:00 2001 From: Domenico Iezzi Date: Sun, 5 Nov 2017 15:43:23 +0100 Subject: [PATCH] search: fixed wrong doc check --- gpapi/googleplay.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gpapi/googleplay.py b/gpapi/googleplay.py index b9e069a..73b9929 100644 --- a/gpapi/googleplay.py +++ b/gpapi/googleplay.py @@ -312,11 +312,9 @@ def search(self, query, nb_result, offset=None): raise LoginError('Unexpected behaviour, probably expired ' 'token') cluster = response.payload.listResponse.cluster[0] - try: - cluster.HasField('doc') - except ValueError as e: - if self.debug: - print('No result for query: %s' % query) + print(cluster.doc) + if len(cluster.doc) == 0: + print('No results for query %s' % query) break if cluster.doc[0].containerMetadata.nextPageUrl != "": nextPath = cluster.doc[0].containerMetadata.nextPageUrl