sviatoslav-lebediev / anki-quizlet-importer-extended

86 stars 10 forks source link

Audio not importing when Skip error is selected #134

Closed t3protac closed 9 months ago

t3protac commented 11 months ago

Audio will not import if I select Skip Errors on any of the cards, but the text does. If I dont select skip errors then I get the error below

Quizlet deck URL

Additional context Anki 2.1.63 (f356f177) Python 3.9.15 Qt 6.5.0 PyQt 6.5.0 Platform: macOS-13.4.1-arm64-arm-64bit Flags: frz=True ao=True sv=3 Add-ons, last update check: 2023-11-07 10:08:51 Add-ons possibly involved: ⁨Quizlet to Anki 21 Importer with audio support⁩

Caught exception: Traceback (most recent call last): File "/Users/todd/Library/Application Support/Anki2/addons21/1362209126/init.py", line 379, in onCode self.createDeck(deck) File "/Users/todd/Library/Application Support/Anki2/addons21/1362209126/init.py", line 432, in createDeck file_name = self.fileDownloader(self.getAudioUrl( File "/Users/todd/Library/Application Support/Anki2/addons21/1362209126/init.py", line 486, in fileDownloader raise e File "/Users/todd/Library/Application Support/Anki2/addons21/1362209126/init.py", line 477, 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 11 months ago

hi, yep it means that for some reason cloudflare blocked your requests. For the "text" data i have a proxy but not for audio/images because it will cost me money. I will take a look at your deck url and will let you know if i can import it correctly. For now I would recommend to try to use some VPN or another network.

malotru007 commented 9 months ago

I know you've been looking at a workaround but are you making any progress? ETA ? the add-on is really not as useful without the ability to download audio. Thanks

sviatoslav-lebediev commented 9 months ago

@malotru007 The problem is that Quizlet now protects audio links with CloudFlare as well. So I don't know any good, "free" solution so far :( Previously we had the same issue with html, I wrote a custom proxy, but I will not be able to proxy all audio requests because it will cost me money, and I am not even 100% sure that this will help

If you know of any good solution that can help, let me know.

malotru007 commented 9 months ago

Well they aren't to my knowledge any add-ons like yours so maybe you can test the waters on who would be willing to pay for a fixed add-on? I would. But from what you are saying it seems that the solution would cost a lot, is that right?

sviatoslav-lebediev commented 9 months ago

@malotru007 good question :) It wouldn't cost a lot per user, but it would cost a lot for me if I added it as a free feature. I've made this assumption based on my current proxy statistics. If you want, I can add this proxy, and you can test it (I will create a separate add-on version). But I'm not 100% sure that we will be able to easily bypass cloudflare

malotru007 commented 9 months ago

I would like to test it for sure.

sviatoslav-lebediev commented 9 months ago

@malotru007 let's try

  1. Tools/Add-ons
  2. Select quizlet plugin
  3. Click View Files
  4. open __init__.py
  5. open https://raw.githubusercontent.com/sviatoslav-lebediev/anki-quizlet-importer-extended/41d08f3c4b220b7f8b018011c84f046a6375c4a2/__init__.py
  6. take the content from that url and replace that init.py file content
  7. save and restart anki
  8. try
  9. let me know if it works

if it works I will think about how to allow other people to use this proxy

sviatoslav-lebediev commented 9 months ago

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