From e02adcf84515e50c7edaa18692b9f4b9b34e5a01 Mon Sep 17 00:00:00 2001 From: inpos Date: Sun, 26 Nov 2017 17:28:00 +0300 Subject: [PATCH] tmdb. 'results' key doesn't exist --- resources/scrapers/tmdb.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/scrapers/tmdb.py b/resources/scrapers/tmdb.py index d6b578e..0b7344e 100644 --- a/resources/scrapers/tmdb.py +++ b/resources/scrapers/tmdb.py @@ -144,9 +144,11 @@ class Movies(Core): return self.movies["total_results"] def iter_results(self): - log('movies.keys: %s' % (repr(self.movies.keys()))) - for i in self.movies["results"]: - yield i + if 'results' in self.movies.keys(): + for i in self.movies["results"]: + yield i + else: + return [] def get_ordered_matches(self): """