diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2015-01-17 20:25:13 +0100 |
|---|---|---|
| committer | Adam Tauber <asciimoo@gmail.com> | 2015-01-17 20:25:13 +0100 |
| commit | e3edded60f96aea7ce25465fd0dc49914d4fe9c8 (patch) | |
| tree | d67dd90de2b3983604e127c2c5e06de3aede9577 /searx/engines/flickr-noapi.py | |
| parent | 975b6b5b09b8b6366dc3103d04ca3636da927ebe (diff) | |
| parent | d910744efe02f6eedb8fcb7661b208b349f78b39 (diff) | |
Merge pull request #178 from Cqoicebordel/thumbnails
Thumbnails
Diffstat (limited to 'searx/engines/flickr-noapi.py')
| -rw-r--r-- | searx/engines/flickr-noapi.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/searx/engines/flickr-noapi.py b/searx/engines/flickr-noapi.py index 89dd2ee5f..66c6f4027 100644 --- a/searx/engines/flickr-noapi.py +++ b/searx/engines/flickr-noapi.py @@ -71,6 +71,14 @@ def response(resp): if 'id' not in photo['owner']: continue +# For a bigger thumbnail, keep only the url_z, not the url_n + if 'n' in photo['sizes']: + thumbnail_src = photo['sizes']['n']['displayUrl'] + elif 'z' in photo['sizes']: + thumbnail_src = photo['sizes']['z']['displayUrl'] + else: + thumbnail_src = img_src + url = build_flickr_url(photo['owner']['id'], photo['id']) title = photo.get('title', '') @@ -89,6 +97,7 @@ def response(resp): results.append({'url': url, 'title': title, 'img_src': img_src, + 'thumbnail_src': thumbnail_src, 'content': content, 'template': 'images.html'}) |