diff options
author | asciimoo <asciimoo@gmail.com> | 2013-10-22 23:34:45 +0200 |
---|---|---|
committer | asciimoo <asciimoo@gmail.com> | 2013-10-22 23:34:45 +0200 |
commit | 3a6d3e33778fb25dc64002a21681208d9fc509da (patch) | |
tree | 8e5074301b662aa3b7f1d883082c6e8bfd90c965 /searx/engines/flickr.py | |
parent | 31471ed93647cbd38e83504c69aa298a40202465 (diff) | |
download | searxng-3a6d3e33778fb25dc64002a21681208d9fc509da.tar.gz searxng-3a6d3e33778fb25dc64002a21681208d9fc509da.zip |
[enh][mod] using image template rendering
Diffstat (limited to 'searx/engines/flickr.py')
-rwxr-xr-x | searx/engines/flickr.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/searx/engines/flickr.py b/searx/engines/flickr.py index 60e2b6f3b..079c1e11c 100755 --- a/searx/engines/flickr.py +++ b/searx/engines/flickr.py @@ -23,6 +23,8 @@ def response(resp): url = urljoin(base_url, result.attrib.get('href')) img = result.xpath('.//img')[0] title = img.attrib.get('alt', '') - content = '<img src="%s" alt="%s" />' % (img.attrib.get('data-defer-src', ''), title) - results.append({'url': url, 'title': title, 'content': content}) + img_src = img.attrib.get('data-defer-src') + if not img_src: + continue + results.append({'url': url, 'title': title, 'img_src': img_src, 'template': 'images.html'}) return results |