Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace urllib2 by requests #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

waynehuangplus
Copy link

Hi,
I use python python 2.7.9 and it will an error, and I found it may due to SSL verification in Python 2.7.9 from some discussion HenriWahl/Nagstamon#126 (comment).

I replace urllib2 by requests to make sure it works in python2.7 in this PR.

Traceback (most recent call last):
File "./og.py", line 5, in
video = opengraph.OpenGraph(url="http://www.youtube.com/watch?v=q3ixBmDzylQ")
File "/usr/local/lib/python2.7/site-packages/opengraph/opengraph.py", line 36, in init
self.fetch(url)
File "/usr/local/lib/python2.7/site-packages/opengraph/opengraph.py", line 50, in fetch
raw = urllib2.urlopen(url)
File "/usr/local/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/usr/local/lib/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python2.7/urllib2.py", line 469, in error
result = self._call_chain(_args)
File "/usr/local/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(_args)
File "/usr/local/lib/python2.7/urllib2.py", line 656, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/usr/local/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/usr/local/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/usr/local/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/local/lib/python2.7/urllib2.py", line 1240, in https_open
context=self._context)
File "/usr/local/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant