aboutsummaryrefslogtreecommitdiff
path: root/modules/spotify.py
diff options
context:
space:
mode:
authorGravatar dngfx2018-08-31 10:50:37 +0100
committerGravatar dngfx2018-08-31 10:50:37 +0100
commitabed9cf4ea71dcbad2dd2c049683b8d14b942e09 (patch)
tree3e40caf63fa7e1500469f4ad9a0c45c51808aad4 /modules/spotify.py
parentFix a copy paste fail in IRCLineHandler that caused PARTs to be handled as QUITs (diff)
signature
Reformat
Diffstat (limited to 'modules/spotify.py')
-rw-r--r--modules/spotify.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/spotify.py b/modules/spotify.py
index 64ba2c2f..9b69523d 100644
--- a/modules/spotify.py
+++ b/modules/spotify.py
@@ -3,6 +3,7 @@ import Utils
URL_SPOTIFY = "https://api.spotify.com/v1/search"
+
class Module(object):
def __init__(self, bot):
bot.events.on("received").on("command").on("spotify").hook(
@@ -11,7 +12,9 @@ class Module(object):
def spotify(self, event):
page = Utils.get_url(URL_SPOTIFY, get_params={"type": "track",
- "limit": 1, "q": event["args"]}, json=True)
+ "limit": 1,
+ "q": event["args"]},
+ json=True)
if page:
if len(page["tracks"]["items"]):
item = page["tracks"]["items"][0]
@@ -19,7 +22,7 @@ class Module(object):
artist_name = item["artists"][0]["name"]
url = item["external_urls"]["spotify"]
event["stdout"].write("%s (by %s) %s" % (title, artist_name,
- url))
+ url))
else:
event["stderr"].write("No results found")
else: