ultralytics / flickr_scraper

Simple Flickr Image Scraper
https://ultralytics.com
GNU Affero General Public License v3.0
214 stars 62 forks source link

raise FlickrError #4

Open infrontofme opened 4 years ago

infrontofme commented 4 years ago

Hi, when I run following script:

python flickr_scraper.py --search 'honeybees on flowers' --n 10 --download

an error occurred.

Traceback (most recent call last):
  File "flickr_scraper.py", line 68, in <module>
    download=opt.download)  # download images
  File "flickr_scraper.py", line 33, in get_urls
    for i, photo in enumerate(photos):
  File "C:\Users\nanwa\anaconda3\lib\site-packages\flickrapi\core.py", line 688, in data_walker
    rsp = method(page=page, **params)
  File "C:\Users\nanwa\anaconda3\lib\site-packages\flickrapi\call_builder.py", line 38, in __call__
    return self.flickrapi_object.do_flickr_call(self.method_name, **kwargs)
  File "C:\Users\nanwa\anaconda3\lib\site-packages\flickrapi\core.py", line 337, in do_flickr_call
    **params)
  File "C:\Users\nanwa\anaconda3\lib\site-packages\flickrapi\core.py", line 407, in _wrap_in_parser
    return parser(self, data)
  File "C:\Users\nanwa\anaconda3\lib\site-packages\flickrapi\core.py", line 297, in parse_etree
    raise FlickrError(six.u('Error: %(code)s: %(msg)s') % err.attrib, code=code)
flickrapi.exceptions.FlickrError: Error: 100: Invalid API Key (Key has invalid format)

I tried both on windows and ubuntu, reports the same error

:)

berkantay commented 3 years ago

did you embed your api and secret key to the flicker_scraper.py

glenn-jocher commented 3 years ago

@infrontofme @berkantay you need to use your own API key, as the README explains:

Use

  1. Request a Flickr API key: https://www.flickr.com/services/apps/create/apply

  2. Write your API key and secret in flickr_scraper.py L11-L12:

    key = ''
    secret = ''