sviatoslav-lebediev / anki-quizlet-importer-extended

75 stars 11 forks source link

Error on import #135

Closed lingding77 closed 6 months ago

lingding77 commented 8 months ago

Hi there, I'm getting the following error on import, even with "skip errors" checked. Not sure what the issue is, and it just started happening today (I think I imported correctly about a week ago). I've tried removing and redownloading the add-on from latest. It seems to be creating the deck in Anki but unable to add any of the cards.

Error An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem. When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site. Debug info: Anki 2.1.44 (b2b3275f) 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: 2023-11-08 22:04:55 Add-ons possibly involved: ⁨Quizlet to Anki 21 Importer with audio support⁩

Caught exception: Traceback (most recent call last): File "/Users/lingding/Library/Application Support/Anki2/addons21/1362209126/init.py", line 379, in onCode self.createDeck(deck) File "/Users/lingding/Library/Application Support/Anki2/addons21/1362209126/init.py", line 432, in createDeck file_name = self.fileDownloader(self.getAudioUrl( File "/Users/lingding/Library/Application Support/Anki2/addons21/1362209126/init.py", line 486, in fileDownloader raise e File "/Users/lingding/Library/Application Support/Anki2/addons21/1362209126/init.py", line 477, in fileDownloader r = urllib2.urlopen(urllib2.Request(url, headers=headers)) File "urllib/request.py", line 222, in urlopen File "urllib/request.py", line 531, in open File "urllib/request.py", line 640, in http_response File "urllib/request.py", line 569, in error File "urllib/request.py", line 502, in _call_chain File "urllib/request.py", line 649, in http_error_default urllib.error.HTTPError: HTTP Error 403: Forbidden

sviatoslav-lebediev commented 8 months ago

Hi, could you please provide a deck url ?

jahedev commented 8 months ago

I have received a similar error for the following URL: Here or shortened

The following error:

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue to the add-on author.
Debug info:
Anki 2.1.66 (70506aeb) Python 3.9.15 Qt 6.5.2 PyQt 6.5.2
Platform: Windows-10-10.0.22621
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-11-08 13:47:51
Add-ons possibly involved: ⁨Improved Quizlet to Anki 21 Importer⁩

Caught exception:
Traceback (most recent call last):
  File "C:\Users\<USER>\AppData\Roaming\Anki2\addons21\1362209126\__init__.py", line 373, in onCode
    self.createDeck(deck)
  File "C:\Users\<USER>\AppData\Roaming\Anki2\addons21\1362209126\__init__.py", line 432, in createDeck
    file_name = self.fileDownloader(self.getAudioUrl(
  File "C:\Users\<USER>\AppData\Roaming\Anki2\addons21\1362209126\__init__.py", line 480, in fileDownloader
    raise e
  File "C:\Users\<USER>\AppData\Roaming\Anki2\addons21\1362209126\__init__.py", line 471, in fileDownloader
    r = urllib2.urlopen(urllib2.Request(url, headers=headers))
  File "urllib.request", line 214, in urlopen
  File "urllib.request", line 523, in open
  File "urllib.request", line 632, in http_response
  File "urllib.request", line 561, in error
  File "urllib.request", line 494, in _call_chain
  File "urllib.request", line 641, in http_error_default
urllib.error.HTTPError: HTTP Error 403: Forbidden
sviatoslav-lebediev commented 8 months ago

@jahedev and 'Skip errors' doesn't help?

lingding77 commented 8 months ago

I tried several URLs but here is one of them: https://quizlet.com/848467551/sogang-3급-6b과-flash-cards/?funnelUUID=75ac7298-82df-4511-a86d-7b3273656d76

"Skip errors" did not help.

lingding77 commented 8 months ago

I got the previous URL from copying straight from the URL bar, but here is the same URL when I use the Quizlet "share" function:

https://quizlet.com/848467551/sogang-3%EA%B8%89-6b%EA%B3%BC-flash-cards/?i=2uz62a&x=1jqt

jahedev commented 8 months ago

Hi, I tried skip errors and this time it worked but the audio for some of the Quizlets I tried it on did not download, but I'd say this is a minor issue for me. I'm glad that I'm able to download the flashcards. Thank you! This tool is a lifesaver! 😄

sviatoslav-lebediev commented 8 months ago

Hi, I tried skip errors and this time it worked but the audio for some of the Quizlets I tried it on did not download, but I'd say this is a minor issue for me. I'm glad that I'm able to download the flashcards. Thank you! This tool is a lifesaver! 😄

yep that's exactly what Skip error does it skips some audio that it can't download, I will try to improve this but for now that's the fix.

sviatoslav-lebediev commented 8 months ago

I got the previous URL from copying straight from the URL bar, but here is the same URL when I use the Quizlet "share" function:

quizlet.com/848467551/sogang-3%EA%B8%89-6b%EA%B3%BC-flash-cards/?i=2uz62a&x=1jqt

Hi, I have checked and yes for some reason we can download these audio urls, it looks like Cloudflare protects them. I will take a look at what I can do, maybe it requires some "cookies". You still can download decks but without audio

lingding77 commented 8 months ago

Hi there, Just wanted to update that I thought I had checked "skip errors" but I had actually checked "add reverse" instead. Now, properly checking "skip errors" it does work properly. @jahedev for the record I have my cards setup to default to TTS audio when the quizlet audio is missing, so you could add that as well. Something like this:

{{#EnglishAudio}} {{EnglishAudio}} {{/EnglishAudio}} {{^EnglishAudio}} {{tts en_US:EnglishText}} {{/EnglishAudio}}

(can't remember if I had to add the tts add-on or if it was builtin, sorry!

sviatoslav-lebediev commented 6 months ago

Going to close this issue, please join this discussion https://github.com/sviatoslav-lebediev/anki-quizlet-importer-extended/discussions/156