drakedevel/gsclient

Select Command failure

Closed this issue · 14 comments

Hi,

Thanks for your great work! I could try your script about 4 times (very nice!), but now it doesn't work anymore when I type select <sond_Id>, I get the following error:

gscmd> select 29
Traceback (most recent call last):
  File "main.py", line 156, in <module>
    MainCmd().cmdloop()
  File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "main.py", line 123, in do_select
    self._select(self._results[index - 1])
  File "main.py", line 130, in _select_song
    (url, postdata) = self._client.get_stream(song)
  File "/home/koen/gsclient-master/gsclient/gsclient.py", line 62, in get_stream
    print stream_data['streamKey']
TypeError: list indices must be integers, not str

After looking into this a bit, I THINK what's happening is Grooveshark is blacklisting the IP address.

Does the web client still work for you on that IP address? The library probably needs to be updated either way.

Tested that. I can access the web client but trying to play a song gives
"Error playing song".
On 11 Feb 2013 22:24, "Andrew Drake" notifications@github.com wrote:

Does the web client still work for you on that IP address? The library
probably needs to be updated either way.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-13406924.

That's no good. Something probably changed in the API and the library set off a red flag. I can take a closer look after work today -- of course any help would be welcome :)

Yes, I can still use the online client.

Experiencing the same behaviour here any help in solving it would be most appreciated

Can you list reliable steps to reproduce?

Just keep streaming songs on the same IP address, eventually (after
2-3 songs, usually) it will stop working. You don't even have to play
the whole song if I remember correctly.

Web: http://www.joelotter.com
Facebook: http://www.facebook.com/joel.auterson
Twitter: http://www.twitter.com/JoelOtter

I spent the weekend looking into this -- I found a couple of songs returning empty stream data. The songs that I found don't work in the web interface either, as JoelOtter mentioned. These songs remain unplayable from the web interface even from another IP address, so I suspect it might be Grooveshark's problem.

Those affected: can you post the Grooveshark song link for the songs that didn't work for you, whether it works on the web, and whether you can find any songs at all that do work?

I am having problems with all songs. This is what I did:

  • Start script
  • Search: song I dont feel like dancing (This happens with any song)
  • Play first result: select 1

Then it fails and I get this:

File "./main.py", line 130, in _select_song
    (url, postdata) = self._client.get_stream(song)
File "/home/florian/GSclient/gsclient.py", line 62, in get_stream
    return ("http://%s/stream.php" % stream_data['ip'],
TypeError: list indices must be integers, not str

And some more...

Hi, great job!, was doing some tests to run the script in raspberry pi. The first time worked perfectly, but then I have the same errors.
I am starting with python but if I can be of any help I would like to collaborate.
Sorry for my bad English, greetings!

Well either I have really bad luck with selecting songs or something is wrong... Here's the error that I get with select, it won't play any of the songs:
Traceback (most recent call last):
File "main.py", line 180, in
MainCmd().cmdloop()
File "/usr/lib/python3.3/cmd.py", line 138, in cmdloop
stop = self.onecmd(line)
File "/usr/lib/python3.3/cmd.py", line 217, in onecmd
return func(arg)
File "main.py", line 140, in do_select
self._select(self._results[index - 1])
File "main.py", line 148, in select_song
stream = urlopen(url, data = postdata)
File "/usr/lib/python3.3/urllib/request.py", line 160, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.3/urllib/request.py", line 471, in open
req = meth(req)
File "/usr/lib/python3.3/urllib/request.py", line 1183, in do_request

raise TypeError(msg)
TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str.

Closing since Grooveshark is now defunct

Thanks for your hard work on a great library, @drakedevel 👍