{"id":13610105,"url":"https://github.com/WuLC/GoogleImagesDownloader","last_synced_at":"2025-04-12T22:32:59.316Z","repository":{"id":42187872,"uuid":"104892196","full_name":"WuLC/GoogleImagesDownloader","owner":"WuLC","description":"Enlarge training dataset by searching images with specified keywords in google and download the presented images","archived":false,"fork":false,"pushed_at":"2020-12-11T06:13:01.000Z","size":63794,"stargazers_count":125,"open_issues_count":2,"forks_count":66,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-07T16:42:07.594Z","etag":null,"topics":["crawler","google","image","keyword","selenium"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WuLC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-26T14:02:28.000Z","updated_at":"2024-10-24T06:56:06.000Z","dependencies_parsed_at":"2022-09-18T19:03:14.988Z","dependency_job_id":null,"html_url":"https://github.com/WuLC/GoogleImagesDownloader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WuLC%2FGoogleImagesDownloader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WuLC%2FGoogleImagesDownloader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WuLC%2FGoogleImagesDownloader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WuLC%2FGoogleImagesDownloader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WuLC","download_url":"https://codeload.github.com/WuLC/GoogleImagesDownloader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248641473,"owners_count":21138210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crawler","google","image","keyword","selenium"],"created_at":"2024-08-01T19:01:41.226Z","updated_at":"2025-04-12T22:32:54.306Z","avatar_url":"https://github.com/WuLC.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# GoogleImagesDownloader\n\nThis repository can download images from google with specified keywords\n\n## Requirements\n\n- python 3.5\n- selenium 3.6.0\n- Firefox\n- geckodriver\n\n**Firefox and geckodriver are required by selenium, and Firefox 55 or greater is recommended, cause [geckodriver][1] support that best. As for geckodriver, just download the latest version of geckodriver from [here][2], then add it to the PATH environment variable.**\n\nHere is an example of downloading with selenium using 2 processes\n\n\u003cimg src=\"/imgs/download_with_selenium.gif?raw=true\"\u003e\n\n## Details and Configuration\n\n### Two Methods\n\nTwo different methods are provided\n\n- `download_with_urllib`\n- `download_with_selenium`\n\n\n`download_with_urllib` is to download with just package `urllib`, but due to the limit by google, each searching query can download at most 100 images\n\n`download_with_selenium` is to download with package `selenium` and `urllib`, with selenium, we can directly search and scroll in the browser, so we can get more than 100 images for each searching query\n\n**Both of the above methods support downloading with single process or mulitple processes**, and `download_with_selenium` will firstly store the actual links of images in a file, then download the actual images with the file, while `download_with_urllib` will directly download all the images since the number if small\n\n**Specify `main_keywords` and `supplemented_keywords` in the code**, each `main_keyword` will join with each `supplemented_keyword` to become a searching query, and one directory will be created for each main_keyword to store the related images.The following image is a simple example \n\n\u003cimg src=\"/imgs/keywords.png?raw=true\"\u003e\n\n### Download With Time Limit\n\nAs to the script `download_images_with_time_limit.py`, it is a replacement of the method `download_images` in script `download_with_selenium.py`, because the method `download_images` will always block due to network issue, so I add restriction that each http request can cost at most 10 sceonds, and that is what `download_images_with_time_limit.py` does. \n\nPay attention that the time-limited strategy is to use the signal that system provides, and here the `SIGALRM` in unix-like system is adopted, so this script should run with unix-like system rather than Windows. However, the network blocking thing happened when I ran the script in my network, but not sure whether this will happen in yours, so you can test with `download_with_selenium.py` firstly, if the downloading task blocks, change to the script `download_images_with_time_limit.py`\n\nMore details about the repository can be obtained in [this blog][5]\n\n\n  [1]: https://github.com/mozilla/geckodriver\n  [2]: https://github.com/mozilla/geckodriver/releases\n  [3]: https://github.com//WuLC/GoogleImagesDownloader/blob/master/imgs/download_with_selenium.gif\n  [4]: http://static.zybuluo.com/WuLiangchao/pcnc2a7dge8y2jh0lt15l05l/image_1c52u2p8r1t8hfkmsie10lr1d1qm.png\n  [5]: http://wulc.me/2017/09/23/Google%20%E5%9B%BE%E7%89%87%E7%88%AC%E8%99%AB/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWuLC%2FGoogleImagesDownloader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWuLC%2FGoogleImagesDownloader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWuLC%2FGoogleImagesDownloader/lists"}