Skip to content

Commit

Permalink
Merge pull request #925 from reverieeee/master
Browse files Browse the repository at this point in the history
update movie.py to use omdbapi as imdbapi is non-functional
  • Loading branch information
embolalia committed Nov 14, 2015
2 parents 533d5eb + 13c2fdc commit ebfd6bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sopel/modules/movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Copyright © 2012-2013, Elad Alfassa, <[email protected]>
Licensed under the Eiffel Forum License 2.
This module relies on imdbapi.com
This module relies on omdbapi.com
"""
from __future__ import unicode_literals
import json
Expand All @@ -25,17 +25,17 @@ def movie(bot, trigger):
if not trigger.group(2):
return
word = trigger.group(2).rstrip()
uri = "http://www.imdbapi.com/?t=" + word
uri = "http://www.omdbapi.com/?t=" + word
u = web.get(uri, 30)
data = json.loads(u) # data is a Dict containing all the information we need
if data['Response'] == 'False':
if 'Error' in data:
message = '[MOVIE] %s' % data['Error']
else:
LOGGER.warning(
'Got an error from the imdb api, search phrase was %s; data was %s',
'Got an error from the OMDb api, search phrase was %s; data was %s',
word, str(data))
message = '[MOVIE] Got an error from imdbapi'
message = '[MOVIE] Got an error from OMDbapi'
else:
message = '[MOVIE] Title: ' + data['Title'] + \
' | Year: ' + data['Year'] + \
Expand Down

0 comments on commit ebfd6bd

Please sign in to comment.