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

Courses Without Defined Levels #53

Closed BaneOfRome closed 6 years ago

BaneOfRome commented 6 years ago

Hello, thank you for your continued support of this add-on, especially after the most recent update. However, I have run into a problem where a course cannot be downloaded if that course does not have its words partitioned into levels. An example of such a course can be found here:

https://www.memrise.com/course/264547/1900-most-common-words-in-nepali/

Trying to download and import this course, as well as similar courses, into Anki results in the following error message:

Traceback (most recent call last): File "C:\Users...\AppData\Roaming\Anki2\addons\Memrise_Course_Importer\importer.py", line 146, in run course = self.memriseService.loadCourse(self.url, MemriseCourseLoader.Observer(self)) File "C:\Users...\AppData\Roaming\Anki2\addons\Memrise_Course_Importer\memrise.py", line 785, in loadCourse return courseLoader.loadCourse(self.getCourseIdFromUrl(url)) File "C:\Users...\AppData\Roaming\Anki2\addons\Memrise_Course_Importer\memrise.py", line 566, in loadCourse course.title = sanitizeName(courseData["session"]["course"]["name"], u"Course") TypeError: 'NoneType' object has no attribute 'getitem'

I fully understand that you may not get around to fixing this right away due to being busy with other things, and, actually, I would expect that to be the case. I just thought that you would like to know that this issue exists.

Thank you again for your continued work on this. It is very much appreciated.

wilddom commented 6 years ago

Well, that course just has one level but I don't see a connection between the number of levels and the error. Maybe I'll manage to take a closer look next week, but no promises though.

BaneOfRome commented 6 years ago

That is all I can ask. Take your time.

I just assumed that the format of the course was the issue since the same error message appeared for three other courses that have all of their words in one long list, similar to the one I had posted, whereas other more conventionally-divided courses downloaded and imported without a single problem.

wilddom commented 6 years ago

The latest commit should fix this issue, could you give it a try?

BaneOfRome commented 6 years ago

It works perfectly! Thank you so much for fixing the issue in such a timely manner!