Skip to content

Commit

Permalink
Updated Chromedriver & GID
Browse files Browse the repository at this point in the history
Issued GID fix as described here hardikvasa/google-images-download#373 (comment)
  • Loading branch information
JenkinsTR committed Jan 1, 2023
1 parent 90c09c4 commit 020940f
Show file tree
Hide file tree
Showing 227 changed files with 21,863 additions and 32 deletions.
Binary file modified Graphics/Bin/chromedriver_win32.zip
Binary file not shown.
4,698 changes: 4,698 additions & 0 deletions Graphics/Bin/chromedriver_win32/LICENSE.chromedriver

Large diffs are not rendered by default.

Binary file modified Graphics/Bin/chromedriver_win32/chromedriver.exe
Binary file not shown.
Binary file added Graphics/Bin/google-images-download-master.zip
Binary file not shown.
54 changes: 54 additions & 0 deletions Graphics/Bin/google-images-download-master/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
*.py[cod]

# C extensions
*.so

#env
env/
env
# pycharm
.idea/
.idea

# Packages
*.egg
*.egg-info
build
dist
dist/*
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
nosetests.xml

# Complexity
output/*.html
output/*/index.html

# Sphinx
docs/_build
docs/.DS_Store
docs/_static/*

# Cookiecutter
output/

# Downloads
downloads/

# Logs
logs/

21 changes: 21 additions & 0 deletions Graphics/Bin/google-images-download-master/Licence.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015-2019 Hardik Vasa

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions Graphics/Bin/google-images-download-master/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include README.md
include requirements.txt
29 changes: 29 additions & 0 deletions Graphics/Bin/google-images-download-master/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Google Images Download
######################

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

Documentation
=============

* `Documentation Homepage <https://google-images-download.readthedocs.io/en/latest/index.html>`__
* `Installation <https://google-images-download.readthedocs.io/en/latest/installation.html>`__
* `Input arguments <https://google-images-download.readthedocs.io/en/latest/arguments.html>`__
* `Examples and Code Samples <https://google-images-download.readthedocs.io/en/latest/examples.html#>`__


Disclaimer
==========

This program lets you download tons of images from Google.
Please do not download or use any image that violates 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! Use this script/code only for educational purposes.
19 changes: 19 additions & 0 deletions Graphics/Bin/google-images-download-master/docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
249 changes: 249 additions & 0 deletions Graphics/Bin/google-images-download-master/docs/arguments.rst

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions Graphics/Bin/google-images-download-master/docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
version = '1.0.1'

source_suffix = '.rst'
master_doc = 'index'

html_static_path = ['_static']

def setup(app):
app.add_stylesheet('overrides.css') # may also be an URL

html_context = {
"display_github": False, # Add 'Edit on Github' link instead of 'View page source'
"last_updated": True,
"commit": False,
}

# -- Project information -----------------------------------------------------

project = 'Google Images Download'
copyright = '2019, Hardik Vasa'
author = 'Hardik Vasa'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'bizstyle'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

html_sidebars = { '**': ['globaltoc.html', 'relations.html', 'searchbox.html'] }

179 changes: 179 additions & 0 deletions Graphics/Bin/google-images-download-master/docs/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
========
Examples
========

Link to `GitHub repo <https://github.com/hardikvasa/google-images-download>`__

Link to `Documentation Homepage <https://google-images-download.readthedocs.io/en/latest/index.html>`__

Link to `Input arguments or parameters <https://google-images-download.readthedocs.io/en/latest/arguments.html>`__

Config File Format
==================

You can either pass the arguments directly from the command as in the examples below or you can pass it through a config file. Below is a sample of how a config
file looks.

You can pass more than one record through a config file. The below sample consist of two set of records. The code will iterate through each of the record and
download images based on arguments passed.

.. code:: json
{
"Records": [
{
"keywords": "apple",
"limit": 5,
"color": "green",
"print_urls": true
},
{
"keywords": "universe",
"limit": 15,
"size": "large",
"print_urls": true
}
]
}
Code sample - Importing the library
===================================

- If you are calling this library from another python file, below is the sample code

.. code-block:: python
from google_images_download import google_images_download #importing the library
response = google_images_download.googleimagesdownload() #class instantiation
arguments = {"keywords":"Polar bears,baloons,Beaches","limit":20,"print_urls":True} #creating list of arguments
paths = response.download(arguments) #passing the arguments to the function
print(paths) #printing absolute paths of the downloaded images
Command line examples
=====================

- If you are passing arguments from a config file, simply pass the config_file argument with name of your JSON file

.. code-block:: bash
$ googleimagesdownload -cf example.json
- Simple example of using keywords and limit arguments

.. code-block:: bash
$ googleimagesdownload --keywords "Polar bears, baloons, Beaches" --limit 20
- Using Suffix Keywords allows you to specify words after the main
keywords. For example if the ``keyword = car`` and
``suffix keyword = 'red,blue'`` then it will first search for
``car red`` and then ``car blue``

.. code-block:: bash
$ googleimagesdownload --k "car" -sk 'red,blue,white' -l 10
- To use the short hand command

.. code-block:: bash
$ googleimagesdownload -k "Polar bears, baloons, Beaches" -l 20
- To download images with specific image extension/format

.. code-block:: bash
$ googleimagesdownload --keywords "logo" --format svg
- To use color filters for the images

.. code-block:: bash
$ googleimagesdownload -k "playground" -l 20 -co red
- To use non-English keywords for image search

.. code-block:: bash
$ googleimagesdownload -k "北极熊" -l 5
- To download images from the google images link

.. code-block:: bash
$ googleimagesdownload -k "sample" -u <google images page URL>
- To save images in specific main directory (instead of in 'downloads')

.. code-block:: bash
$ googleimagesdownload -k "boat" -o "boat_new"
- To download one single image with the image URL

.. code-block:: bash
$ googleimagesdownload --keywords "baloons" --single_image <URL of the images>
- To download images with size and type constrains

.. code-block:: bash
$ googleimagesdownload --keywords "baloons" --size medium --type animated
- To download images with specific usage rights

.. code-block:: bash
$ googleimagesdownload --keywords "universe" --usage_rights labeled-for-reuse
- To download images with specific color type

.. code-block:: bash
$ googleimagesdownload --keywords "flowers" --color_type black-and-white
- To download images with specific aspect ratio

.. code-block:: bash
$ googleimagesdownload --keywords "universe" --aspect_ratio panoramic
- To download images which are similar to the image in the image URL that you provided (Reverse Image search).

.. code-block:: bash
$ googleimagesdownload -si <image url> -l 10
- To download images from specific website or domain name for a given keyword

.. code-block:: bash
$ googleimagesdownload --keywords "universe" --specific_site example.com
===> 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 you are in.


Library extensions
==================

The downloading algorithm does a good job of keeping out corrupt images. However it is not ideal. There are still some chances of getting one-off corrupt image that cannot be used for processing. Below script will help clean those corrupt image files. This script was ideated by @devajith in `Issue 81 <https://github.com/hardikvasa/google-images-download/issues/81>`__.

.. code:: python
import os
from PIL import Image
img_dir = r"path/to/downloads/directory"
for filename in os.listdir(img_dir):
try :
with Image.open(img_dir + "/" + filename) as im:
print('ok')
except :
print(img_dir + "/" + filename)
os.remove(img_dir + "/" + filename)
Loading

0 comments on commit 020940f

Please sign in to comment.