diff --git a/README.rst b/README.rst index f0a19b1d..8d140352 100644 --- a/README.rst +++ b/README.rst @@ -292,6 +292,12 @@ Arguments | | | | | | | This argument does not take any value. Just add '--no_numbering' or '-nn' in your query. | +-------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+ +| offset | of | When you specify this argument, it will skip the offset number of links before it starts downloading images | +| | | | +| | | If this argument is not specified, the script will start downloading form the first link until the limit is reached | +| | | | +| | | This argument takes integer. Make sure the value of this argument is less than the value of limit | ++-------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+ | help | h | show the help message regarding the usage of the above arguments | +-------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+ diff --git a/google_images_download/google_images_download.py b/google_images_download/google_images_download.py index 794d5874..5031eee0 100755 --- a/google_images_download/google_images_download.py +++ b/google_images_download/google_images_download.py @@ -39,7 +39,8 @@ "exact_size", "aspect_ratio", "type", "time", "time_range", "delay", "url", "single_image", "output_directory", "image_directory", "no_directory", "proxy", "similar_images", "specific_site", "print_urls", "print_size", "print_paths", "metadata", "extract_metadata", "socket_timeout", - "thumbnail", "language", "prefix", "chromedriver", "related_images", "safe_search", "no_numbering"] + "thumbnail", "language", "prefix", "chromedriver", "related_images", "safe_search", "no_numbering", + "offset"] def user_input(): @@ -108,6 +109,7 @@ def user_input(): parser.add_argument('-ri', '--related_images', default=False, help="Downloads images that are similar to the keyword provided", action="store_true") parser.add_argument('-sa', '--safe_search', default=False, help="Turns on the safe search filter while searching for images", action="store_true") parser.add_argument('-nn', '--no_numbering', default=False, help="Allows you to exclude the default numbering of images", action="store_true") + parser.add_argument('-of', '--offset', help="Where to start in the fetched links", type=str, required=False) args = parser.parse_args() arguments = vars(args) @@ -697,6 +699,9 @@ def _get_all_items(self,page,main_directory,dir_name,limit,arguments): break elif object == "": page = page[end_content:] + elif arguments['offset'] and count < int(arguments['offset']): + count += 1 + page = page[end_content:] else: #format the item for readability object = self.format_object(object) diff --git a/setup.py b/setup.py index c725c937..fe28fdf9 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from codecs import open from os import path -__version__ = '2.3.0' +__version__ = '2.4.0' here = path.abspath(path.dirname(__file__))