mirror of
https://github.com/FliegendeWurst/googleplay-api.git
synced 2024-11-22 12:54:58 +00:00
search: manage case when no result is found
This commit is contained in:
parent
3b0ff57c38
commit
11128cde27
@ -312,6 +312,12 @@ class GooglePlayAPI(object):
|
|||||||
raise LoginError('Unexpected behaviour, probably expired '
|
raise LoginError('Unexpected behaviour, probably expired '
|
||||||
'token')
|
'token')
|
||||||
cluster = response.payload.listResponse.cluster[0]
|
cluster = response.payload.listResponse.cluster[0]
|
||||||
|
try:
|
||||||
|
cluster.HasField('doc')
|
||||||
|
except ValueError as e:
|
||||||
|
if self.debug:
|
||||||
|
print('No result for query: %s' % query)
|
||||||
|
break
|
||||||
if cluster.doc[0].containerMetadata.nextPageUrl != "":
|
if cluster.doc[0].containerMetadata.nextPageUrl != "":
|
||||||
nextPath = cluster.doc[0].containerMetadata.nextPageUrl
|
nextPath = cluster.doc[0].containerMetadata.nextPageUrl
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user