kelciour / batch-download-pictures-from-google-images

7 stars 5 forks source link

There's some problem when I run the add-on #26

Closed morningdrop closed 6 months ago

morningdrop commented 6 months ago

when I run the add-on, my computer will freeze and then anki will report it encounters into a problem. I have no idea what to do. I had just updated my anki and the add-on to the latest version, but the problem still occurs. image

I copy a dubug info if it helps. Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.6.1 PyQt 6.6.1 Platform: Windows-10-10.0.22621

Traceback (most recent call last): File "urllib3.connection", line 203, in _new_conn File "urllib3.util.connection", line 85, in create_connection File "urllib3.util.connection", line 73, in create_connection socket.timeout: timed out

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

Traceback (most recent call last): File "urllib3.connectionpool", line 790, in urlopen File "urllib3.connectionpool", line 491, in _make_request File "urllib3.connectionpool", line 467, in _make_request File "urllib3.connectionpool", line 1096, in _validate_conn File "urllib3.connection", line 611, in connect File "urllib3.connection", line 212, in _new_conn urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x00000224D14AE160>, 'Connection to www.google.com timed out. (connect timeout=15)')

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='www.google.com', port=443): Max retries exceeded with url: /search?tbm=isch&q=cat&safe=active&ie=utf8&oe=utf8&ucbcb=1 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x00000224D14AE160>, 'Connection to www.google.com timed out. (connect timeout=15)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Lucy\AppData\Roaming\Anki2\addons21\561924305__init_.py", line 434, in a.triggered.connect(lambda , b=browser: onAddImages(b)) File "C:\Users\Lucy\AppData\Roaming\Anki2\addons21\561924305__init.py", line 427, in onAddImages updateNotes(browser, nids) File "C:\Users\Lucy\AppData\Roaming\Anki2\addons21\561924305\init__.py", line 368, in updateNotes r = requests.get("https://www.google.com/search?tbm=isch&q={}&safe=active&ie=utf8&oe=utf8&ucbcb=1".format(query), headers=headers, cookies={"CONSENT":"YES+"}, timeout=15) 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 507, in send requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='www.google.com', port=443): Max retries exceeded with url: /search?tbm=isch&q=cat&safe=active&ie=utf8&oe=utf8&ucbcb=1 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x00000224D14AE160>, 'Connection to www.google.com timed out. (connect timeout=15)'))

===Add-ons (active)=== (add-on provided name [Add-on folder, installed at, version, is config changed]) Advanced Review Bottom Bar ['1136455830', 2024-02-05T02:38, 'None', mod] AnkiConnect ['2055492159', 2024-02-27T12:37, 'None', ''] AwesomeTTS - Add speech to your flashcards ['1436550454', 2024-02-09T14:42, 'None', ''] Batch Download Pictures From Google Images ['561924305', 2024-02-22T01:38, 'None', mod] Enhance main window ['877182321', 2023-10-23T04:28, 'None', ''] Remove Duplicate Cards ['95590040', 2021-05-06T02:12, 'None', ''] Review Heatmap ['1771074083', 2022-06-30T09:43, 'None', '']

===IDs of active AnkiWeb add-ons=== 1136455830 1436550454 1771074083 2055492159 561924305 877182321 95590040

===Add-ons (inactive)=== (add-on provided name [Add-on folder, installed at, version, is config changed]) Fast Word Query Multi-threaded queries for words from local or web dictionaries ['1807206748', 2019-06-23T11:10, 'None', ''] Word Query ['775418273', 2018-01-01T01:07, 'None', '']

I wish you would spare some time to look at my question, if your add-on could work, it would be a great help to me. thank you very much! (p.s: I'm in China, if my location is of any important.)

kelciour commented 6 months ago

It looks like the add-on can't connect to www.google.com for some reason. The add-on seems to work for me. Aside from trying a VPN software, maybe try https://ankiweb.net/shared/info/1024335436 to download from Baidu Images instead, I've updated it to make it work with Anki 23.12.1 PyQt6.