Catch json error for imdbapi

This commit is contained in:
Ruud committed 2012-05-11 14:56:49 +02:00
1 parent 63141b5971
commit 30022fef8f
1 file changed
+6 -2
@@ -64,8 +64,12 @@ class IMDBAPI(MovieProvider):
movie_data = {}
try:
if isinstance(movie, (str, unicode)):
movie = json.loads(movie)
try:
if isinstance(movie, (str, unicode)):
movie = json.loads(movie)
except ValueError:
log.info('No proper json to decode')
return movie_data
if movie.get('Response') == 'Parse Error':
return movie_data