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

download errors should not abort import #24

Closed wilddom closed 9 years ago

wilddom commented 9 years ago

As reported here: https://anki.tenderapp.com/discussions/add-ons/4300-memrise2anki-top-actors-270

This addon worked flawlessly with

Modern Actors/Actresses http://www.memrise.com/course/131011/modern-actorsactresses/

but, when importing this: http://www.memrise.com/course/39778/top-actors-270/

Traceback (most recent call last): 
  File "C:\Users\GEPS\Documents\Anki\addons\Memrise_Course_Importer\importer.py", line 127, in run 
    course = self.memriseService.loadCourse(self.url, MemriseCourseLoader.Observer(self)) 
  File "C:\Users\GEPS\Documents\Anki\addons\Memrise_Course_Importer\memrise.py", line 635, in loadCourse 
    return courseLoader.loadCourse(self.getCourseIdFromUrl(url)) 
  File "C:\Users\GEPS\Documents\Anki\addons\Memrise_Course_Importer\memrise.py", line 501, in loadCourse 
    level = self.loadLevel(course, levelIndex) 
  File "C:\Users\GEPS\Documents\Anki\addons\Memrise_Course_Importer\memrise.py", line 584, in loadLevel 
    self.notify('thingLoaded', thing) 
  File "C:\Users\GEPS\Documents\Anki\addons\Memrise_Course_Importer\memrise.py", line 483, in notify 
    getattr(observer, signal)(*attrs, **kwargs) 
  File "C:\Users\GEPS\Documents\Anki\addons\Memrise_Course_Importer\importer.py", line 69, in thingLoaded 
    self.downloadMedia(thing) 
  File "C:\Users\GEPS\Documents\Anki\addons\Memrise_Course_Importer\importer.py", line 48, in downloadMedia 
    thing.setLocalImageUrls(colName, filter(bool, map(download, thing.getImageUrls(colName)))) 
  File "C:\Users\GEPS\Documents\Anki\addons\Memrise_Course_Importer\memrise.py", line 691, in downloadMedia 
    raise e 
urllib2.HTTPError: HTTP Error 404: Not Found
wilddom commented 9 years ago

Hm... works for me. But the import process should not abort in case of download errors.

wilddom commented 9 years ago

Improve media download: