diff --git a/internetarchive/search.py b/internetarchive/search.py index 08a3bc9c..0de196ed 100644 --- a/internetarchive/search.py +++ b/internetarchive/search.py @@ -150,6 +150,10 @@ def _scrape(self): j = r.json() if j.get('error'): yield j + if j['total'] is None: + # Unexpected empty response when iterating on cursor + # Retry with same cursor: + continue num_found = int(j['total']) if not self._num_found: self._num_found = num_found