Code Monkey home page Code Monkey logo

google-images-download's Introduction

πŸŒ… Google Images Download

Python Script for 'searching' and 'downloading' hundreds of Google images to the local hard disk!

Summary

This is a command line python program to search keywords/key-phrases on Google Images and then also optionally download one or more images to your computer. This is a small program which is ready-to-run, but still under development. Many more features will be added to it going forward.

Compatability

This program is compatible with both the versions of python (2.x and 3.x). It is a download-and-run program with no changes to the file. You will just have to specify parameters through the command line.


How to run the script?

  1. Download this repository on your local hard drive
  2. Open the terminal (for mac/linux OS) or command prompt (for windows OS) and browse to the location of the file 'google-images-download.py' on your local disk.
  3. Type in one of the following command mentioned below

Usage

Python3: python3 google-images-download.py [Arguments...] OR

Python2: python google-images-download.py [Arguments...]

Arguments

Argument Short hand Explanation
keywords k Denotes the words that you want to search for and the directory file name.
limit l Denotes number of images that you want to download.
url u Allows you search by image. It downloads images from the google images link provided
single_image x Allows you to download one image if the complete URL of the image is provided
output_directory o Allows you specify the main directory name. If not specified, it will default to 'downloads'
delay d Time to wait between downloading two images
color c Denotes the color filter that you would want to apply to the images.
Possible values: red, orange, yellow, green, teal, blue, purple, pink, white, gray, black, brown
usage_rights r Denotes the usage rights/licence under which the image is classified.
Possible values: labled-for-reuse-with-modifications, labled-for-reuse, labled-for-noncommercial-reuse-with-modification, labled-for-nocommercial-reuse
size s Denotes the relative size of the image to be downloaded.
Possible values: large, medium, icon
type t Denotes the type of image to be downloaded.
Possible values: face,photo,clip-art,line-drawing,animated
time w Denotes the time the image was uploaded/indexed.
Possible values: past-24-hours, past-7-days

Note: If single_image or url parameter is not present, then keywords is a mandatory parameter. No other parameters are mandatory.

Examples

  • If you have python 2.x version installed

python google-images-download.py --keywords "Polar bears, baloons, Beaches" --limit 20

  • If you have python 3.x version installed

python3 google-images-download.py --keywords "Polar bears, baloons, Beaches" --limit 20

  • To use the short hand command

python google-images-download.py -k "Polar bears, baloons, Beaches" -l 20

  • To use color filters for the images

python google-images-download.py -k "playground" -l 20 -c red

  • To use non-English keywords for image search

python google-images-download.py -k "εŒ—ζžη†Š" -l 5

  • To download images from the google images link

python google-images-download.py -k "sample" -u <google images page URL>

  • To save images in specific main directory (instead of in 'downloads')

python google-images-download.py -k "boat" -o "boat_new"

  • To download one single image with the image URL

python google-images-download.py --keywords "baloons" --single_image <URL of the images>

  • To download images with size and type constrains

python google-images-download.py --keywords "baloons" --size medium --type animated

  • To download images with specific usage rights

python google-images-download.py --keywords "universe" --usage_rights labled-for-reuse

===> The images would be downloaded in their own sub-directories inside the main directory (either the one you provided or in 'downloads') in the same folder as the python file that you run.


SSL Errors

If you do see SSL errors on Mac for Python 3 please go to Finder β€”> Applications β€”> Python 3 β€”> Click on the β€˜Install Certificates.command’ and run the file.

Contribute

Anyone is welcomed to contribute to this script. If you would like to make a change, open a pull request. For issues and discussion visit the Issue Tracker

❗❗ Disclaimer

This program lets you download tons of images from Google. Please do not download any image without violating its copyright terms. Google Images is a search engine that merely indexes images and allows you to find them. It does NOT produce its own images and, as such, it doesn't own copyright on any of them. The original creators of the images own the copyrights.

Images published in the United States are automatically copyrighted by their owners, even if they do not explicitly carry a copyright warning. You may not reproduce copyright images without their owner's permission, except in "fair use" cases, or you could risk running into lawyer's warnings, cease-and-desist letters, and copyright suits. Please be very careful before its usage!

google-images-download's People

Contributors

a0m0rajab avatar antetokounpo avatar anumpatel avatar auromun avatar hardikvasa avatar harniva14 avatar leemengtw avatar mentatpsi avatar norihito-t avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.