mirror of https://github.com/searx/searx
parent
78081baa8f
commit
27efdf38c8
|
@ -13,6 +13,10 @@
|
|||
from urllib import urlencode
|
||||
from json import loads
|
||||
import re
|
||||
from searx.engines import logger
|
||||
|
||||
|
||||
logger = logger.getChild('flickr-noapi')
|
||||
|
||||
categories = ['images']
|
||||
|
||||
|
@ -62,10 +66,11 @@ def response(resp):
|
|||
# From the biggest to the lowest format
|
||||
for image_size in image_sizes:
|
||||
if image_size in photo['sizes']:
|
||||
img_src = photo['sizes'][image_size]['displayUrl']
|
||||
img_src = photo['sizes'][image_size]['url']
|
||||
break
|
||||
|
||||
if not img_src:
|
||||
logger.debug('cannot find valid image size: {0}'.format(repr(photo)))
|
||||
continue
|
||||
|
||||
if 'id' not in photo['owner']:
|
||||
|
@ -73,9 +78,9 @@ def response(resp):
|
|||
|
||||
# For a bigger thumbnail, keep only the url_z, not the url_n
|
||||
if 'n' in photo['sizes']:
|
||||
thumbnail_src = photo['sizes']['n']['displayUrl']
|
||||
thumbnail_src = photo['sizes']['n']['url']
|
||||
elif 'z' in photo['sizes']:
|
||||
thumbnail_src = photo['sizes']['z']['displayUrl']
|
||||
thumbnail_src = photo['sizes']['z']['url']
|
||||
else:
|
||||
thumbnail_src = img_src
|
||||
|
||||
|
|
Loading…
Reference in New Issue