Skip to content

Commit

Permalink
minor changes after merging hardikvasa#213
Browse files Browse the repository at this point in the history
doc updates for hardikvasa#213
minor other docs updates - linking doc pages
doc update for hardikvasa#140
  • Loading branch information
hardikvasa committed May 21, 2019
1 parent 9c3cb54 commit 0d2bf8f
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 8 deletions.
Binary file added docs/_static/.DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions docs/arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Input Arguments
===============

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>`__

+-------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+
| Argument | Short hand | Description |
+===================+=============+===============================================================================================================================+
Expand Down Expand Up @@ -235,6 +239,10 @@ Input Arguments
| | | |
| | | This argument will override all the other print arguments (like print_urls, print_size, etc.) |
+-------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+
| ignore_urls | iu | Skip downloading of images whose urls contain certain strings such as wikipedia.org |
| | | |
| | | This argument takes a delimited set of values e.g. wikipedia.org,wikimedia.org |
+-------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+
| help | h | show the help message regarding the usage of the above arguments |
+-------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+

Expand Down
14 changes: 12 additions & 2 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
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
==================

Expand Down Expand Up @@ -31,8 +37,8 @@ download images based on arguments passed.
}
Command line examples
=====================
Code sample - Importing the library
===================================

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

Expand All @@ -46,6 +52,10 @@ Command line examples
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
Expand Down
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Google Images Download
======================

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

.. index:: Summary

Summary
Expand Down
2 changes: 2 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Installation
============

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

You can use **one of the below methods** to download and use this repository.

Install using pip
Expand Down
4 changes: 4 additions & 0 deletions docs/structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Workflow
========

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>`__

Below diagram represents the algorithm logic to download images.

.. figure:: http://www.zseries.in/flow-chart.png
Expand Down
17 changes: 17 additions & 0 deletions docs/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Troubleshooting Errors/Issues
=============================

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>`__

SSL Errors
==========

Expand Down Expand Up @@ -75,3 +79,16 @@ For **All the operating systems** you will have to use '--chromedriver' or '-cd'
chromedriver that you have downloaded in your machine.

If on any rare occasion the chromedriver does not work for you, try downgrading it to a lower version.


urlopen error [SSL: CERTIFICATE_VERIFY_FAILED]
==============================================

`Reference to this issue <https://github.com/hardikvasa/google-images-download/issues/140>`__

Use the below command to install the SSL certificate on your machine.

.. code-block:: bash
cd /Applications/Python\ 3.7/
./Install\ Certificates.command
4 changes: 4 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Usage
=====

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>`__

Using the library from Command Line Interface
=============================================

Expand Down
10 changes: 5 additions & 5 deletions google_images_download/google_images_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def create_directories(self,main_directory, dir_name,thumbnail,thumbnail_only):
return


# Download Images
# Download Image thumbnails
def download_image_thumbnail(self,image_url,main_directory,dir_name,return_image_name,print_urls,socket_timeout,print_size,no_download,save_source,img_src,ignore_urls):
if print_urls or no_download:
print("Image URL: " + image_url)
Expand Down Expand Up @@ -576,14 +576,14 @@ def download_image_thumbnail(self,image_url,main_directory,dir_name,return_image

# Download Images
def download_image(self,image_url,image_format,main_directory,dir_name,count,print_urls,socket_timeout,prefix,print_size,no_numbering,no_download,save_source,img_src,silent_mode,thumbnail_only,format,ignore_urls):
if not silent_mode:
if print_urls or no_download:
print("Image URL: " + image_url)
if ignore_urls:
if any(url in image_url for url in ignore_urls.split(',')):
return "fail","Image ignored",None,None
return "fail", "Image ignored due to 'ignore url' parameter", None, image_url
if thumbnail_only:
return "success", "Skipping image download...", str(image_url[(image_url.rfind('/')) + 1:]), image_url
if not silent_mode:
if print_urls or no_download:
print("Image URL: " + image_url)
if no_download:
return "success","Printed url without downloading",None,image_url
try:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from codecs import open
from os import path

__version__ = '2.7.0'
__version__ = '2.8.0'

here = path.abspath(path.dirname(__file__))

Expand Down

0 comments on commit 0d2bf8f

Please sign in to comment.