Unlucky-Life / ankimon

Ankimon is a Anki Addon to Gamify your learning experience
Other
41 stars 5 forks source link

Ankimon isn't appearing; can't download additional resources. #38

Closed Dubuyu closed 3 months ago

Dubuyu commented 4 months ago

I am receiving the notification saying that I need to download the additional resources, but am not given the option to do so. Receiving this notification: image And the following debug info: Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.6.1 PyQt 6.6.1 Platform: Windows-10-10.0.22621

When loading Ankimon by Unlucky-life: Traceback (most recent call last): File "urllib3.connectionpool", line 467, in _make_request File "urllib3.connectionpool", line 1096, in _validate_conn File "urllib3.connection", line 642, in connect File "urllib3.connection", line 782, in _ssl_wrap_socket_and_matchhostname File "urllib3.util.ssl", line 470, in ssl_wrapsocket File "urllib3.util.ssl", line 514, in _ssl_wrap_socket_impl File "ssl", line 501, in wrap_socket File "ssl", line 1041, in _create File "ssl", line 1310, in do_handshake ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "urllib3.connectionpool", line 790, in urlopen File "urllib3.connectionpool", line 491, in _make_request urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "requests.adapters", line 486, in send File "urllib3.connectionpool", line 844, in urlopen File "urllib3.util.retry", line 515, in increment urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /Unlucky-Life/ankimon/main/update_txt.md (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "aqt.addons", line 245, in loadAddons File "C:\Users\IWong25\AppData\Roaming\Anki2\addons21\1908235722__init.py", line 265, in github_content, github_html_content = read_github_file(github_url) File "C:\Users\IWong25\AppData\Roaming\Anki2\addons21\1908235722\init__.py", line 229, in read_github_file response = requests.get(url) File "requests.api", line 73, in get File "requests.api", line 59, in request File "requests.sessions", line 589, in request File "requests.sessions", line 703, in send File "requests.adapters", line 517, in send requests.exceptions.SSLError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /Unlucky-Life/ankimon/main/update_txt.md (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))

Any fixes? It may be useful to know that I am using a non-personal laptop with browsing restrictions. Thanks for all the hard work that has clearly been put into this add-on.

Unlucky-Life commented 4 months ago

Hi Thanks for the nice words ! It seems like that you do have a issue due to the browsing restrictions. That issue seems to be the corresponding with my github notification file and the help guide file on github. Download this file: https://we.tl/t-JtURvCggje and rename it as __init__.py. Then replace this file with __init__.py in the ankimon addon_folder. This is a workaround for the internet restrictions issues that i can see there. With this you should be able to start Ankimon. You may have an issue tho, when downloading the resource files. Reply to this issue again, if the downloading issue is a problem and i will try to help you out personally - so you can simple drag and drop files.

Dubuyu commented 4 months ago

Again, appreciate how passionate you are about this project, will make sure to at least send you coffee even if it doesn't work. Unfortunately I think I still can't download the additional resources. It seems to be stopping when trying to contact pokemon showdown.

Unlucky-Life commented 4 months ago

else if you like - i could send you a complete addon file if you send me your email. If the rework doesnt work.

Dubuyu commented 4 months ago

That would be so amazing, thanks. Email is Isaacwongsyd@gmail.com.

Where should I put said files?

omfgroflmfaol commented 3 months ago

I seem to have a similar issue with anki not being able to verify my ssh keys (I suppose that this might be because I'm currently stuck using eduroam or a mobile hotspot).

I thought that I had found workarounds for that by disabling ssh verification first for anki in general, and then in the ankimon addon. Ankimon now does load successfully, but now anki crashes when I try to download the resources 😢 I'm at my wits end as I can't decipher anything in the macOS crash report. Here's what I did:

First, I added a new plugin folder in the addons21 directory with just a __init__.pyfile in it containing:

import warnings import anki.sync warnings.filterwarnings("ignore") anki.sync.AnkiRequestsClient.verify = False

Then, I changed line 232 of ankimon's __init__.py file to say:

response = requests.get(url, verify=False)

and added the lines

import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

to the top of the file.

I'm so excited to try ankimon, wasted all day trying to find out what's causing the issues instead of learning 🙈

Unlucky-Life commented 3 months ago

Hey im sorry, i completely missed your last message !

Unlucky-Life commented 3 months ago

@Dubuyu @omfgroflmfaol Here is a link to the files u would normally need to download: https://we.tl/t-aViO1emrOD Steps to go through:

  1. unzip the zip file
  2. paste the content into the image addons21\1908235722\user_files
  3. the the user_file folder should look like this: image
  4. Restart your anki and i think it should work :)
omfgroflmfaol commented 3 months ago

Thank you, it works!

Dubuyu commented 3 months ago

https://we.tl/t-JtURvCggje

Hi, sorry, didn't manage to grab this file in time before it expired, is it the same as the one you resent or different?

omfgroflmfaol commented 3 months ago

Here you go @Dubuyu: https://we.tl/t-ZQkQEvzEUg

Dubuyu commented 3 months ago

Here you go @Dubuyu: https://we.tl/t-ZQkQEvzEUg

Sorry, I meant the one that needs to be named init.py

Unlucky-Life commented 3 months ago

@Dubuyu try this init file: https://github.com/Unlucky-Life/ankimon/blob/46ec628d8edc8bd0de1268221816cc2d8a0a5a01/src/Ankimon/__init__.py => and go into config and set ssh to false => this should solve your above issue

Dubuyu commented 3 months ago

Unfortunately still not working :(

Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.6.1 PyQt 6.6.1 Platform: Windows-10-10.0.22621

When loading Ankimon by Unlucky-life: Traceback (most recent call last): File "urllib3.connectionpool", line 467, in _make_request File "urllib3.connectionpool", line 1096, in _validate_conn File "urllib3.connection", line 642, in connect File "urllib3.connection", line 782, in _ssl_wrap_socket_and_matchhostname File "urllib3.util.ssl", line 470, in ssl_wrapsocket File "urllib3.util.ssl", line 514, in _ssl_wrap_socket_impl File "ssl", line 501, in wrap_socket File "ssl", line 1041, in _create File "ssl", line 1310, in do_handshake ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "urllib3.connectionpool", line 790, in urlopen File "urllib3.connectionpool", line 491, in _make_request urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "requests.adapters", line 486, in send File "urllib3.connectionpool", line 844, in urlopen File "urllib3.util.retry", line 515, in increment urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /Unlucky-Life/ankimon/main/update_txt.md (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "aqt.addons", line 245, in loadAddons File "C:\Users\IWong25\AppData\Roaming\Anki2\addons21\1908235722__init.py", line 357, in github_content, github_html_content = read_github_file(github_url) File "C:\Users\IWong25\AppData\Roaming\Anki2\addons21\1908235722\init__.py", line 317, in read_github_file response = requests.get(url) File "requests.api", line 73, in get File "requests.api", line 59, in request File "requests.sessions", line 589, in request File "requests.sessions", line 703, in send File "requests.adapters", line 517, in send requests.exceptions.SSLError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /Unlucky-Life/ankimon/main/update_txt.md (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))