@@ -13,6 +13,10 @@
13from urllib import urlencode
13from urllib import urlencode
14from json import loads
14from json import loads
16+from searx.engines import logger
19+logger = logger.getChild('flickr-noapi')
17categories = ['images']
21categories = ['images']
@@ -62,10 +66,11 @@ def response(resp):
62 # From the biggest to the lowest format
66 # From the biggest to the lowest format
63 for image_size in image_sizes:
67 for image_size in image_sizes:
64 if image_size in photo['sizes']:
68 if image_size in photo['sizes']:
65− img_src = photo['sizes'][image_size]['displayUrl']
69+ img_src = photo['sizes'][image_size]['url']
68 if not img_src:
72 if not img_src:
73+ logger.debug('cannot find valid image size: {0}'.format(repr(photo)))
71 if 'id' not in photo['owner']:
76 if 'id' not in photo['owner']:
@@ -73,9 +78,9 @@ def response(resp):
74# For a bigger thumbnail, keep only the url_z, not the url_n
79# For a bigger thumbnail, keep only the url_z, not the url_n
75 if 'n' in photo['sizes']:
80 if 'n' in photo['sizes']:
76− thumbnail_src = photo['sizes']['n']['displayUrl']
81+ thumbnail_src = photo['sizes']['n']['url']
77 elif 'z' in photo['sizes']:
82 elif 'z' in photo['sizes']:
78− thumbnail_src = photo['sizes']['z']['displayUrl']
83+ thumbnail_src = photo['sizes']['z']['url']
80 thumbnail_src = img_src
85 thumbnail_src = img_src