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

Connection reset by peer (download error) #102

Closed milangress closed 3 years ago

milangress commented 3 years ago

I'm trying to download a fairly big course (5000 words with audio) and I always get an error message after 1-2 minutes.

<urlopen error <urlopen error [Errno 54] Connection reset by peer>>

This is the course I'm trying to download: https://app.memrise.com/course/426582/top-5000-words-in-greek/

I already verified that my internet connection is not failing and stable the whole time. I also tried to turn off every checkmark (mems, media, etc.) one by one, but I always get the same error.

Any idea what the problem is?

Thank you for your work and for helping out! -m


Full stack trace error:

Anki 2.1.46 (94913ec2) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.16
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-08-06 18:00:04
Möglicherweise beteiligte Erweiterungen: ⁨memrise2anki-extension⁩

Caught exception:
Traceback (most recent call last):
  File "/Users/milan/Library/Application Support/Anki2/addons21/memrise2anki-extension/importer.py", line 854, in importCourse
    raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])
  File "/Users/milan/Library/Application Support/Anki2/addons21/memrise2anki-extension/importer.py", line 150, in run
    course = self.memriseService.loadCourse(self.url, MemriseCourseLoader.Observer(self))
  File "/Users/milan/Library/Application Support/Anki2/addons21/memrise2anki-extension/memrise.py", line 862, in loadCourse
    return courseLoader.loadCourse(self.getCourseIdFromUrl(url))
  File "/Users/milan/Library/Application Support/Anki2/addons21/memrise2anki-extension/memrise.py", line 633, in loadCourse
    level = self.loadLevel(course, levelIndex)
  File "/Users/milan/Library/Application Support/Anki2/addons21/memrise2anki-extension/memrise.py", line 717, in loadLevel
    thingData = self.service.loadThingData(thingId)
  File "/Users/milan/Library/Application Support/Anki2/addons21/memrise2anki-extension/memrise.py", line 905, in loadThingData
    response = self.openWithRetry(thingUrl)
  File "/Users/milan/Library/Application Support/Anki2/addons21/memrise2anki-extension/memrise.py", line 819, in openWithRetry
    return self.opener.open(url)
  File "urllib/request.py", line 525, in open
  File "urllib/request.py", line 542, in _open
  File "urllib/request.py", line 502, in _call_chain
  File "/Users/milan/Library/Application Support/Anki2/addons21/memrise2anki-extension/memrise.py", line 798, in https_open
    return self.do_open_wrapped(http.client.HTTPSConnection, req, context=self._context, check_hostname=self._check_hostname)
  File "/Users/milan/Library/Application Support/Anki2/addons21/memrise2anki-extension/memrise.py", line 788, in do_open_wrapped
    response = self.do_open(http_class, req, **http_conn_args)
  File "urllib/request.py", line 1353, in do_open
urllib.error.URLError: <urlopen error <urlopen error [Errno 54] Connection reset by peer>>
Digital-Coder commented 3 years ago

I am getting the same error. It works when downloading smaller memrise course, but when I tried with 5000+ notes, it crashed all the time.

Caught exception: Traceback (most recent call last): File "C:\Users\user\AppData\Roaming\Anki2\addons21\memrise2anki\importer.py", line 853, in importCourse raise exc_info0.with_traceback(exc_info[2]) File "C:\Users\user\AppData\Roaming\Anki2\addons21\memrise2anki\importer.py", line 152, in run course = self.memriseService.loadCourse(self.url, MemriseCourseLoader.Observer(self)) File "C:\Users\norbe\AppData\Roaming\Anki2\addons21\memrise2anki\memrise.py", line 866, in loadCourse return courseLoader.loadCourse(self.getCourseIdFromUrl(url)) File "C:\Users\user\AppData\Roaming\Anki2\addons21\memrise2anki\memrise.py", line 635, in loadCourse level = self.loadLevel(course, levelIndex) File "C:\Users\user\AppData\Roaming\Anki2\addons21\memrise2anki\memrise.py", line 719, in loadLevel thingData = self.service.loadThingData(thingId) File "C:\Users\user\AppData\Roaming\Anki2\addons21\memrise2anki\memrise.py", line 909, in loadThingData response = self.openWithRetry(thingUrl) File "C:\Users\user\AppData\Roaming\Anki2\addons21\memrise2anki\memrise.py", line 823, in openWithRetry return self.opener.open(url) File "urllib\request.py", line 525, in open File "urllib\request.py", line 542, in _open File "urllib\request.py", line 502, in _call_chain File "urllib\request.py", line 1393, in https_open File "urllib\request.py", line 1353, in do_open urllib.error.URLError: <urlopen error <urlopen error [WinError 10054] An existing connection was forcibly closed by the remote host>>

Digital-Coder commented 3 years ago

just a quick note. I was able to download by disabling all other addons and my VPN. I am not sure if its something related, but finally I managed getting flashcards from memrise

wilddom commented 3 years ago

Improved in 0c15f742f670a452d1da50c3c5fe74487ba396fd