Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to download the image along with its name #108

Open
nhanlt1 opened this issue Feb 6, 2023 · 0 comments
Open

I want to download the image along with its name #108

nhanlt1 opened this issue Feb 6, 2023 · 0 comments
Labels

Comments

@nhanlt1
Copy link

nhanlt1 commented Feb 6, 2023

like when you google search it will show the image and the text below it
code python below:

def auto_down_img(_keyword):
    rm_temp()
    create_Temp_img()

    class DefaultNameDownloader(ImageDownloader):
        def get_filename(self, task, default_ext):
            filename = super().get_filename(task, default_ext)
            return filename

    google_crawler = GoogleImageCrawler(
        feeder_threads=1,
        parser_threads=1,
        downloader_threads=4,
        storage={'root_dir': 'Temp_image'},
        downloader_cls=DefaultNameDownloader
    )
    filters = dict(
        size='large',
        # license='commercial,modify',
        date=(None, None))
    google_crawler.crawl(keyword=_keyword, filters=filters, offset=0, max_num=9,
                        min_size=(800, 800), max_size=None, file_idx_offset=0)

This is the code I'm using, it seems that the "class DefaultNameDownloader" doesn't work at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants