diff options
| author | 2016-04-03 13:20:05 +0100 | |
|---|---|---|
| committer | 2016-04-03 13:20:05 +0100 | |
| commit | 504e93a78d59d51243acbcab6831309805d01fd1 (patch) | |
| tree | f5687e4611875e3b4b5e5370492bf7df86e77703 /modules/trakt.py | |
| parent | added code to prevent newlines being where they shouldn't be in outgoing lines. (diff) | |
tinkered with some modules and fixed a few bugs, also added the skeleton for the auto_mode.py module.
Diffstat (limited to 'modules/trakt.py')
| -rw-r--r-- | modules/trakt.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/trakt.py b/modules/trakt.py index 94538b8f..b488ad40 100644 --- a/modules/trakt.py +++ b/modules/trakt.py @@ -29,12 +29,9 @@ class Module(object): "trakt-api-version": "2", "trakt-api-key": self.bot.config["trakt-api-key"]}, json=True, code=True) - if page: + if page[0]: code, page = page - if code == 204: - event["stderr"].write( - "%s is not watching anything" % username) - else: + if code == 200: type = page["type"] if type == "movie": title = page["movie"]["title"] @@ -58,5 +55,8 @@ class Module(object): URL_TRAKTSLUG % ("shows", slug))) else: print("ack! unknown trakt media type!") + else: + event["stderr"].write( + "%s is not watching anything" % username) else: event["stderr"].write("Failed to load results") |
