osteenbergen / slackify

Slack bot to play/queue Spotify
13 stars 1 forks source link

Help #18

Closed alxkski closed 8 years ago

alxkski commented 8 years ago

Hi there, I'm struggling to get this setup and running. I'm on OSX and have gone through the setup and installed all the required stuff on my machine. However I'm not quite sure what to do next. I've run "python slackify.py" from the terminal and am getting this:

Traceback (most recent call last): File "slackify.py", line 5, in <module> from lib.bot import SlackifyBot File "/Users/alex/slackify-master/lib/bot.py", line 2, in <module> from lib.spotifyplayer import SpotifyPlayer File "/Users/alex/slackify-master/lib/spotifyplayer.py", line 8, in <module> import spotipy ImportError: No module named spotipy

Any help would be greatly appreciated it!

osteenbergen commented 8 years ago

It seems that you forgot to run the pip command in the readme. Python is complaining about the missing module spotipy.

Hope this helps

Onno

On 12 Aug 2016 3:53 p.m., "alxkski" notifications@github.com wrote:

Hi there, I'm struggling to get this setup and running. I'm on OSX and have gone through the setup and installed all the required stuff on my machine. However I'm not quite sure what to do next. I've run "python slackify.py" from the terminal and am getting this:

Traceback (most recent call last): File "slackify.py", line 5, in from lib.bot import SlackifyBot File "/Users/alex/slackify-master/lib/bot.py", line 2, in from lib.spotifyplayer import SpotifyPlayer File "/Users/alex/slackify-master/lib/spotifyplayer.py", line 8, in

import spotipy ImportError: No module named spotipy Any help would be greatly appreciated it! — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/osteenbergen/slackify/issues/18, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDfTYm3j9d2tD2wB8dqw2JXfRkp7TuQks5qfHrdgaJpZM4JjGt9 .
alxkski commented 8 years ago

Ahhh ok my bad! Got it working and running. The bot connects to slack now. However running pause/play/stop gives these results: "No song currently playing"

Trying to queue or play a song gives this: Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/slackbot/dispatcher.py", line 55, in _dispatch_msg_handler func(Message(self._client, msg), *args) File "/Users/alex/slackify-master/plugins/queue.py", line 23, in queue_song result = slackify.player.search(text) File "/Users/alex/slackify-master/lib/spotifyplayer.py", line 117, in search search = self.web.search(q=query, limit=25, type="track",market=self._settings.SPOTIFY_MARKET) AttributeError: 'module' object has no attribute 'SPOTIFY_MARKET'

osteenbergen commented 8 years ago

Ah yes, that is my bad. The spotify library isn't supported anymore so i switched to the web api for searching. However the python library for this forgot to implement the market setting.

I did a quick dirty hack to that module that's undocumented.

Will fix that this weekend by reimplementing searching myself.

If you really want a working version now you should edit the client.py in the spotipy library so that the search function has the market parameter (add ,market=None). The _get function call within search should include this new parameter (add ,market=market)

On 12 Aug 2016 5:20 p.m., "alxkski" notifications@github.com wrote:

Ahhh ok my bad! Got it working and running. The bot connects to slack now. However running pause/play/stop gives these results: "No song currently playing"

Trying to queue or play a song gives this: Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/slackbot/dispatcher.py", line 55, in _dispatch_msg_handler func(Message(self._client, msg), *args) File "/Users/alex/slackify-master/plugins/queue.py", line 23, in queuesong result = slackify.player.search(text) File "/Users/alex/slackify-master/lib/spotifyplayer.py", line 117, in search search = self.web.search(q=query, limit=25, type="track",market=self. settings.SPOTIFY_MARKET) AttributeError: 'module' object has no attribute 'SPOTIFY_MARKET'

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/osteenbergen/slackify/issues/18#issuecomment-239475679, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDfTQ6IX6F6PcksG8JjvcAUfnKiVtUqks5qfI9OgaJpZM4JjGt9 .

alxkski commented 8 years ago

Ok thanks for letting me know. I'll wait for you to amend it over the weekend. Gave it a go myself to look like this in the client.py file:

def search(self, q, limit=10, offset=0, type='track', market=None):
        return self._get('search', q=q, limit=limit, offset=offset, type=type, market=market)

But it's still giving me the same error.

osteenbergen commented 8 years ago

Been a long time since i have set it up from cratch.. You should add SPOTIFY_MARKET = 'NL' to the settings file to make it work (or you own country)

Sorry for the difficult setup ^^

On 12 Aug 2016 5:53 p.m., "alxkski" notifications@github.com wrote:

Ok thanks for letting me know. I'll wait for you to amend it over the weekend. Gave it a go myself to look like this in the client.py file:

def search(self, q, limit=10, offset=0, type='track', market=None): return self._get('search', q=q, limit=limit, offset=offset, type=type, market=market)

But it's still giving me the same error.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/osteenbergen/slackify/issues/18#issuecomment-239484419, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDfTeJXJJYwclkCROmcPfv3U-wvNloDks5qfJbjgaJpZM4JjGt9 .

osteenbergen commented 8 years ago

I have updated the README and the code so it should be better now. If you have any issues on OSX please let me know, closing this for now.