hardikvasa / google-images-download

Python Script to download hundreds of images from 'Google Images'. It is a ready-to-run code!
MIT License
8.57k stars 2.11k forks source link

Other options are ignored when -si (similar_images) is used. #119

Open mikigom opened 6 years ago

mikigom commented 6 years ago

When -si option is used for inverse image search, many other options (e.g. -size, -format) are totally ignored.

GoTop commented 5 years ago

the same go with "single_image", when "single_image" is set, other options like "output_directory" will not work. the image will be download to a directory name "downloads".

then I follow the the function single_image() in google-images-download, change the code a little as below, problem solved~

    def single_image(self, arguments):
        if arguments['output_directory']:
            main_directory = arguments['output_directory']
        else:
            main_directory = "downloads"

        extensions = ("jpeg", ".jpg", ".gif", ".png", ".bmp", ".svg", ".webp",
                      ".ico")
        url = arguments['single_image']
def main():
    records = user_input()
    for arguments in records:

        if arguments['single_image']:  # Download Single Image using a URL
            response = googleimagesdownload()
            response.single_image(arguments)