diff options
| author | 2018-07-02 11:09:02 +0100 | |
|---|---|---|
| committer | 2018-07-02 11:09:02 +0100 | |
| commit | 464510cd80068a54a1d1e151b8fcbcb0af000ef4 (patch) | |
| tree | ef484b4f17fdcfd927c8954c59026f3120b356a0 /modules/imdb.py | |
| parent | Fixed small type in IRCServer (diff) | |
| signature | ||
OMDBAPI now needs an api key
Diffstat (limited to 'modules/imdb.py')
| -rw-r--r-- | modules/imdb.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/imdb.py b/modules/imdb.py index 0c03556a..c24b4c0a 100644 --- a/modules/imdb.py +++ b/modules/imdb.py @@ -1,3 +1,5 @@ +#--require-config omdbapi-api-key + import json import Utils @@ -7,13 +9,16 @@ URL_IMDBTITLE = "http://imdb.com/title/%s" class Module(object): _name = "IMDb" def __init__(self, bot): + self.bot = bot bot.events.on("received").on("command").on("imdb").hook( self.imdb, min_args=1, help="Search for a given title on IMDb", usage="<movie/tv title>") def imdb(self, event): - page = Utils.get_url(URL_OMDB, get_params={"t": event["args"]}, + page = Utils.get_url(URL_OMDB, get_params={ + "t": event["args"], + "apikey": self.bot.config["omdbapi-api-key"]}, json=True) if page: if "Title" in page: |
