36 3
Contact Author Sign in to rate

Batch Download Pictures From Google Images

8.50MB. Updated 2020-07-09. Only supports Anki 2.1.x.
The author has shared 31 other item(s).

Description

An Anki add-on to batch download pictures from Google Images. 1. Open the card browser - select a few cards - menu Edit - Add Google Images. 2. Select "Source Field". 3. Select "Target Field" instead of "<ignored>". 4. Select how many pictures to download. (optional) 5. Set the maximum width or height. (optional) 6. Click "Start". If the source field contains cloze deletions, only clozes will be used to search for pictures. By default, multiple pictures will be separated by a space character (" "). It can be changed, for example, to a newline character ("<br>") by editing the "Delimiter" option in the config window (Tools - Add-ons - ... - Config). For Anki 2.1.15 The add-on depends on mpv video player to be able to resize pictures. By default, the pictures will be downsized by height to 260 px if mpv video player can be found. On macOS it can be installed via brew.sh and on Linux it should be already installed with Anki 2.1. On Windows download mpv video player from http://mpv.io and update the PATH environment variable. For Anki 2.1.20+ The latest version contains a built-in image resizer but requires Anki 2.1.20+, i.e. there's no need to additionally install mpv video player to be able to resize pictures, but mpv is still required to be able to resize gifs. CHANGELOG 2019-09-12 Initial version 2019-10-18 Add an option to resize pictures 2019-10-25 Ignore HTML tags 2019-12-31 Download multiple images at the same time 2020-01-04 Temporary fix for no module named 'multiprocessing' on Linux. 2020-02-18 Make it work again after Google Images were updated 2020-02-19 Add support for clozes 2020-02-22 Don't resize pictures if mpv is not found 2020-02-26 Add option to overwrite non-empty fields 2020-03-10 Make Google Images work again and be more lenient 2020-04-08 Write images in the main thread 2020-04-15 Compatibility fix for Anki 2.1.15 2020-06-14 Make Google Images work again and be more lenient 2020-06-20 Ignore SSL errors 2020-07-08 Temporarily added a built-in image resizer (Anki 2.1.20+) 2020-07-09 Lazy load external dependencies to prevent update errors - https://i.imgur.com/bSLe2Na.png ADDITIONAL INFORMATION The future development and support likely will depend on Ko-fi and Patreon. Nickolay Nonard <kelciour@gmail.com>

Download

As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

Supported Anki versions:

To download this add-on, please copy and paste the following code into Anki 2.1:

561924305

If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

All Anki 2.1.x Add-Ons Contact Author

Reviews

on 1599857154
This amazing addon was the last piece I needed to finalize my Anki setup. Very highly recommend!
on 1598165712
This is so amazing! I'm adding German memes to all my flashcards - because now I can.
on 1598135265
I love you
on 1597234948
really nice addon works so well. worth pointing out that the issues mention in the negative reviews have been fixed.
on 1597229390
Can't believe how useful this is. Well made. Much appreciated. It's a shame to see negative reviews from people who never changed it back to positive, even after the dev fixed their problems...
on 1596879990
ABSOLUTELY ESSENTIAL for all language learners !!!

Images on cards ARE useful, but many of us waste way too much time trying to find the 'right' images.

This marvellous addon should, once and for all, put paid to this 'Image-FOMO' — have (more or less pertinent) images on all cards, yet, don't get an*l about trying to find them :D

.
on 1596028060
Good stuff
on 1596018142
After some playing around with it, I finally got it to work.

UPDATE: THIS IS A MUCH BETTER ADDON THAN I THOUGHT!!! I can choose from which field it picks the word and into which field it adds it! It's a pure bliss once I got the hang of it.

You're a life saver. Just awesome.
on 1595981355
Thank you! works beautifully! thank you for sharing this time saving addon.
on 1595691459
Hi, can you help me? I have 2.1.15 Anki, but I can't find "menu Edit":(
I want to use your add-on to add images to my cards, but I can't:(((

1. Open the card browser - select a few cards - menu Edit - Add Google Images.
2. Select "Source Field".
3. Select "Target Field" instead of "<ignored>".
4. Select how many pictures to download. (optional)
5. Set the maximum width or height. (optional)
6. Click "Start".
Comment from author
https://imgur.com/a/GeVAnt7
on 1594579861
The first your recommendation is working.
thanks a lot

*************************************************
Your plugin does not work for me.
Please help with it.
After the last update I got such an 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 on the add-on support site.
Debug info:
Anki 2.1.26 (arch-linux-2.1.26-1) Python 3.8.3 Qt 5.15.0 PyQt 5.15.0
Platform: Linux
Flags: frz=False ao=True sv=1
Add-ons, last update check: 2020-07-12 13:19:31
Add-ons possibly involved: ⁨Batch Download Pictures From Google Images⁩

Caught exception:
Traceback (most recent call last):
File "/home/x/.local/share/Anki2/addons21/561924305/__init__.py", line 368, in <lambda>
a.triggered.connect(lambda _, b=browser: onAddImages(b))
File "/home/x/.local/share/Anki2/addons21/561924305/__init__.py", line 361, in onAddImages
updateNotes(browser, nids)
File "/home/x/.local/share/Anki2/addons21/561924305/__init__.py", line 47, in updateNotes
from PIL import Image, ImageSequence, UnidentifiedImageError
ImportError: cannot import name 'UnidentifiedImageError' from 'PIL' (/usr/lib/python3.8/site-packages/PIL/__init__.py)
Comment from author before post was edited
Thank you for the report. Since you're using Arch Linux, I'm not familiar with it, but I guess, you're running Anki from source or something similar, sys.path in Anki contains local Python libraries and Pillow is a bit outdated. It might take some time before the add-on will be updated and at the moment I can think of two possible ways to fix it.

1. Update Pillow to the latest version, i.e. close Anki, open your terminal and run the following command.

python3.8 -m pip install --upgrade Pillow

2. Anki - Tools - Addons - Batch Download... - View Files - open __init__.py in any text editor and replace line #32
from
sys.path.append(os.path.join(os.path.dirname(__file__), "vendor"))
to
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "vendor"))
then close it and restart Anki.
on 1592153831
It works! ( ͡° ͜ʖ ͡°)
on 1590290619
Great add-on!! Good work!!
on 1589528050
breathtaking
on 1589003672
I want to add images to same field without overwriting. is it possible?
As you said, Nothing happens if both fields contain some words or meaning and if I add some pictures to same field until checking the "Overwrite stuff".
-------------------
Working super good :)
Thank you for saving my time to add images manually.
You are Rock!!!!
-------------------
There are a few bugs in it.

1. It is not working when I have TTS sounds related to words. such as "visual [sound:collins!@#!$.mp3]" not working.
If dont have TTS sounds, It works.
2. Pictures are just right next to the letter or meaning, So I had to press "Enter key" one by one.

I hope they will fix it next version. :)
thank you so much :)
Comment from author before post was edited
Yes, it's possible. I'm not sure when the add-on will be updated next time, it will unlikely happen this month, but it can be easily added on your own. I haven't tested it, but it should work if I didn't miss something.

1. Anki - Tools - Add-ons - Batch Download ... - View Files... - open __init__.py in any text editor.
2. Replace the following line (it probably will be a line number 187 or a bit different)
note[fld] = " ".join(imgs)
with
note[fld] += " ".join(imgs)
i.e. replace = with +=
3. Save it, restart Anki, open the add-on and check "Overwrite if not empty".
on 1587570679
Updated to 2.1.22
Not working on 2.1.15 and 2.1.16
Now works great!

Do you think its possible for making a mosaic of 2 or 4 images from the first 4 google results?
Sometimes the first result is not related to the word or expression

Great addon , thank you.
Comment from author
Maybe something with CSS and a bit of JavaScript. I'm pretty sure there's a better way to do it but maybe something like "Google Images 2x2 Template.apkg" - https://drive.google.com/open?id=1erFwUWJULWRBuI_U-ne4eN1aZl8Sh4MI

It's a sample deck with 3 cards in it. The card template can be found here - https://gist.github.com/kelciour/8aff82d8621e14723830cce13bc2ac6c

It looks something like this - https://imgur.com/L2PVbrs

To apply it to your own card template, create a new "Google Images" field and copy everything from the Front Template from the above link to your Front Template and/or Back Template, then copy ".google-images {...}, .google-images > div {...}, img {...}" from the Styling to your Styling section, i.e. everything except ".card" and ".word". Then use the add-on to add 2 or 4 pictures to the "Google Images" field.
on 1586995927
This is great!
on 1586966578
Very cool! Now I can see a picture on every card!
on 1586401450
Very useful!
on 1586383108
working great. Thanks
on 1585991956
Super dope add on! Excellent work by the developer!
on 1585781404
Works great!!! Thx for "giphs" function, it's perfect :D
on 1583974598
Works well!! Thank you. Would it be possible to add the image in addition to the existing material of that field instead of completely overwriting it?
on 1582514467
This add on works great now and saves a lot of time when adding pictures to cards. Developer was quick to respond and fix bugs and really cares about his add-on. I would really recommend this add-on for visual learners!
Comment from author before post was edited
Thank you. I was able to reproduce it. Please update the add-on. It should be fixed now but options to resize pictures will be disabled since the add-on won't be able to find mpv video player.

If you'd like to resize pictures please install mpv video player.

1. Download mpv video player as *.7z from https://sourceforge.net/projects/mpv-player-windows/files/stable/
2. Unzip it somewhere.
3. Update the PATH environment variable - https://streamable.com/2b1l6
4. Restart Anki.

Hopefully, I'd have time to add a built-in resizer next week, but as for now it's the only option aside of maybe resizing them later using some external software.
----------------------------
I've just updated it. Could you try it again and let me know if it works or not?
on 1582463858
Excellent addon and support!
Comment from author before post was edited
I don't know how I missed it. Thank you. It should work now.
on 1582382271
Masterpiece, every bug is now fixed, and it works wonder!
Comment from author before post was edited
Thank you. I was able to reproduce it. Please update the add-on. It should be fixed now but options to resize pictures will be disabled since the add-on won't be able to find mpv video player.

If you'd like to resize pictures please install mpv video player.

1. Download mpv video player as *.7z from https://sourceforge.net/projects/mpv-player-windows/files/stable/
2. Unzip it somewhere.
3. Update the PATH environment variable - https://streamable.com/2b1l6
4. Restart Anki.

Hopefully, I'd have time to add a built-in resizer next week, but as for now it's the only option aside of maybe resizing them later using some external software.
----------------------------------
Thank you. This is a very strange error. Could you use Tools - Add-ons - Check for Updates and let me know if it works or not?
on 1582097324
A well-devised, well-implemented and very useful add-on. kelcior even implemented multi-threading in response to a reviewer. Excellent work!

@the reviewer "scammed with some bulls*t image add-on": Maybe it was https://ankiimage.bigcartel.com/ ? To be fair, it did work for me (the version for Anki 2.0, at least).
on 1582063414
Very efficient !
on 1581630947
Stopped working.
Comment from author
It's working now.
on 1581375482
As of 2-10-2020 it does NOT work.
Comment from author
It's been fixed.
on 1581084662
google must have changed something on their end. this program and "Image search" no longer function and return 0 images.
Comment from author
It's been fixed at last!
on 1579632268
Good
on 1578568216
Good addon and thanks for the useful info and links.
on 1578266878
great add bro!
on 1578078339
Some asshole scammed me with some bulls*t image add-on for Anki. I regret that I didn't discover this before buying that other crappy add-on. The images are accurate like 88% of the time. Love it, and thank you, you've saved me a loot of time!
on 1576864070
This is a real lifesaver! Just a quick question: For some reason it takes a really long time to download each image. About 3 to 6 seconds for each. I have an 11.000 card deck and it takes forever. Is this normal? It doesn't seem to be a processing limit on my computer. Could it be an internet speed thing? Thanks!
Comment from author
Thank you for the question. Yes, that's correct. It takes about ~3 or more seconds to download one picture. It takes ~750 ms to get search results from Google Images, ~750 ms to parse them and get the list of images, ~750 ms to download an image and ~750 ms to resize it if mpv is installed.

Could you please update the add-on via Tools - Add-ons - Check for Updates. I've updated the code to download pictures in parallel using multiple threads. It should work a bit faster now and something can be improved in the future to make it a bit faster.
on 1575262839
it works but the images won't resize... could someone share the files (upload to mediafire or whatever) that we're supposed to put in anki??
Comment from author
The official site is https://mpv.io/
For Windows, it can be downloaded from https://sourceforge.net/projects/mpv-player-windows/files
on 1569486667
Works really well.
on 1568041437
nice. thank you.