alexis-mignon / python-flickr-api

A python implementation of the Flickr API
BSD 3-Clause "New" or "Revised" License
367 stars 108 forks source link

save urls in search to avoid flickr server hits #98

Closed newpro closed 5 years ago

newpro commented 6 years ago

Hello again.

The current implementation use getSizes function to fetch url of photos. Each url is a flickr API query. This increases flickr server API hits by number of images trying to fetch.

For example, for the following task: "Search 400 words from flickr, each word fetch 4000 images. " The task can have max of hits to server of (400*4000) hits to server with current library, way pass flickr hourly limits (see limits section).

However, the task can be complete with 400*(4000/500) = 2400 hits, as 500 is max fetch per page due to image urls can be return with results. Which is below flickr hourly limits. Due to flickr search api can request photo urls return with search results via "extra" field: see extra field in here. Under current implementation, each fetched photo can be parsed and saved with "Photo" class, with max_size url cached.

Thanks again for the great repo!

Cheers!

mtrovo commented 5 years ago

I released a fix for this on version v0.7.2