wilddom / memrise2anki-extension

An extension for Anki 2 that downloads and converts a course from Memrise into an Anki deck.
ISC License
159 stars 22 forks source link

Unable to "Download media files" #41

Closed JasoonS closed 7 years ago

JasoonS commented 7 years ago

I am having an error downloading media files. See the error below. I am using the latest version, the commit 3 days ago for https. Maybe memrise changed more than just their https?

De-selecting the "download media files" options works perfectly still.

Traceback (most recent call last):
  File "/home/jasoons/Documents/Anki/addons/Memrise_Course_Importer/importer.py", line 146, in run
    course = self.memriseService.loadCourse(self.url, MemriseCourseLoader.Observer(self))
  File "/home/jasoons/Documents/Anki/addons/Memrise_Course_Importer/memrise.py", line 752, in loadCourse
    return courseLoader.loadCourse(self.getCourseIdFromUrl(url))
  File "/home/jasoons/Documents/Anki/addons/Memrise_Course_Importer/memrise.py", line 568, in loadCourse
    level = self.loadLevel(course, levelIndex)
  File "/home/jasoons/Documents/Anki/addons/Memrise_Course_Importer/memrise.py", line 659, in loadLevel
    self.notify('thingLoaded', thing)
  File "/home/jasoons/Documents/Anki/addons/Memrise_Course_Importer/memrise.py", line 549, in notify
    getattr(observer, signal)(*attrs, **kwargs)
  File "/home/jasoons/Documents/Anki/addons/Memrise_Course_Importer/importer.py", line 70, in thingLoaded
    self.downloadMedia(thing)
  File "/home/jasoons/Documents/Anki/addons/Memrise_Course_Importer/importer.py", line 51, in downloadMedia
    audio.localUrl = self.sender.download(audio.remoteUrl)
  File "/home/jasoons/Documents/Anki/addons/Memrise_Course_Importer/importer.py", line 110, in download
    return self.memriseService.downloadMedia(url, skipExisting=self.skipExistingMedia)
  File "/home/jasoons/Documents/Anki/addons/Memrise_Course_Importer/memrise.py", line 809, in downloadMedia
    data = self.openWithRetry(url).read()
  File "/home/jasoons/Documents/Anki/addons/Memrise_Course_Importer/memrise.py", line 715, in openWithRetry
    return self.opener.open(url)
  File "/usr/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/home/jasoons/Documents/Anki/addons/Memrise_Course_Importer/memrise.py", line 697, in https_open
    return self.do_open_wrapped(httplib.HTTPSConnection, req)
  File "/home/jasoons/Documents/Anki/addons/Memrise_Course_Importer/memrise.py", line 687, in do_open_wrapped
    response = self.do_open(http_class, req)
  File "/usr/lib/python2.7/urllib2.py", line 1195, in do_open
    h.request(req.get_method(), req.get_selector(), req.data, headers)
  File "/usr/lib/python2.7/httplib.py", line 1057, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1097, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 1053, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 897, in _send_output
    self.send(msg)
  File "/usr/share/anki/aqt/sync.py", line 441, in _incrementalSend
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 1278, in connect
    server_hostname=server_hostname)
  File "/usr/lib/python2.7/ssl.py", line 353, in wrap_socket
    _context=self)
  File "/usr/lib/python2.7/ssl.py", line 601, in __init__
    self.do_handshake()
  File "/usr/lib/python2.7/ssl.py", line 838, in do_handshake
    match_hostname(self.getpeercert(), self.server_hostname)
  File "/usr/lib/python2.7/ssl.py", line 272, in match_hostname
    % (hostname, ', '.join(map(repr, dnsnames))))
ssl.CertificateError: hostname u'static.memrise.com' doesn't match either of 'cloudfront.net', '*.cloudfront.net'
wilddom commented 7 years ago

Well, unfortunately it's a lot of guesswork when it comes to memrise... the static.memrise.com urls seem to be plain http. Can you try again?

JasoonS commented 7 years ago

Great, thank you. It worked first time :)

I really appreciate the help!