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

Scrape metadata with the built-in Flickr crawler #71

Open
spencerchubb opened this issue Apr 18, 2020 · 0 comments
Open

Scrape metadata with the built-in Flickr crawler #71

spencerchubb opened this issue Apr 18, 2020 · 0 comments
Labels

Comments

@spencerchubb
Copy link

class MyImageDownloader(ImageDownloader):

def __init__(self, thread_num, signal, session, storage, log_file):
    super(MyDownloader, self).__init__(thread_num, signal, session,
                                       storage)
    self.log_file = open(log_file, 'w')

def process_meta(self, task):
    if task['success']:
        with self.lock:
            self.log_file.write('{} {} {} {}\n'.format(
                task['filename'], task['file_url'], *task['img_size']))

When someone asked a question similar to mine earlier, this was the example code that solved it. This code rewrites the process_meta function so that it scrapes file name, file url, and img size. I would also like to know if there is a way to scrape photo title, description, and tags with the built-in Flickr crawler. Perhaps it is just a matter of using different keywords in the task dict?

Thanks!

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