Forums

Trouble opening url ( python )

I'm trying to set up a turntable.fm bot using the website and when I run it I get this error

urllib2.HTTPError: HTTP Error 403: Forbidden

The particular line of code that spawns this error is from Alain’s gilbert's ttapi.py

dataStr = urllib2.urlopen('http://turntable.fm:80/api/room.which_chat'
                      'server?roomid=%s' % roomId).read()

Are you not allowed to make socket connections from pythonanywhere?

I should also note, the reason that I'm setting this up on here is because my work has a proxy that won't allow me to get around it. I have gotten similar errors like 403 forbidden and the server actively refused the connection because of this. That's why I'm wondering if you are allowed to do client server connections over this website.

After some digging, I see that this is because turntable.fm is not on the whitelist of acceptable websites? Is it possible to add this for free accounts please?

Hi mystikalemu,

Yes that isn't a problem. I've gone ahead and made that change to the live whitelist. Try it now.

Hi Hansel,

Thanks for adding that. However, now when I run my program the console just says "Loading console ..." and never does anything. Have I used up all my time already?

I think it's getting through now I'm just trying to figure out why nothing is happening in the program, but that is on my end. Thanks for your help.