Hey, I am thinking of developing something within deviant art. Do you mind whitelisting deviantart? Thanks! https://www.deviantart.com/developers/
Hey, I am thinking of developing something within deviant art. Do you mind whitelisting deviantart? Thanks! https://www.deviantart.com/developers/
hmm- I see that you are a paying user, so your account should not be constrained by the whitelist. Or are you asking for a different account? If you just upgraded, you will have to start new consoles/reload your webapp etc before your settings take effect.
Oh yeah, sorry i have another different account in which i run extra small webapps on.
Ah, fair enough. That does look like an official public API, so I've whitelisted it.
Thank you! ^_^
No problem!
Any reasons why I get SSL Handshake failures with deviantart api?
Python 2.7:
>>> import urllib2
>>> response = urllib2.urlopen('https://google.com') #Works
>>> response = urllib2.urlopen('https://www.deviantart.com/api/v1/oauth2/data/tos') #Doesnt work
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 404, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 422, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1222, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1184, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 1] _ssl.c:510: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure>
Are you inside a virtualenv? If so, you need to install a couple of extra packages to make sure that Python 2.7 handles Server Name Indication properly. This will fix the problem:
pip install urllib3[secure] pyopenssl ndg-httpsclient pyasn1
If you're not in a virtualenv, let me know and we can see if there's a different problem.
Nope, not inside a virtual env. i just launched python 2.7 console from the consoles screen and typed away
urllib2
is out of date. We tend to recommend a library called "requests" (which uses urllib3 under the hood), and that makes it very nice to do web requests.
import requests
>>> print requests.get('https://www.deviantart.com/api/v1/oauth2/data/tos').text
{"error":"invalid_request","error_description":"Must provide an access_token to access this resource.","status":"error"}