diff --git a/searx/webapp.py b/searx/webapp.py index 27d5d1016..4806390eb 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -811,6 +811,16 @@ def search(): results.remove(res) except:pass for res in results: + if 'engine' in res and res['engine'] == 'twitter': + try: + if gfw.exists(res['title']): + results.remove(res) + # return index_error(output_format, gettext('No item found')), 500 + if gfw.exists(res['content']): + # return index_error(output_format, gettext('No item found')), 500 + results.remove(res) + continue + except:pass if 'url' not in res: continue if 'title' not in res: continue diff --git a/searx/webapp1.py b/searx/webapp1.py index c612b73f3..511498f8e 100644 --- a/searx/webapp1.py +++ b/searx/webapp1.py @@ -811,6 +811,16 @@ def search(): results.remove(res) except:pass for res in results: + if 'engine' in res and res['engine'] == 'twitter': + try: + if gfw.exists(res['title']): + results.remove(res) + # return index_error(output_format, gettext('No item found')), 500 + if gfw.exists(res['content']): + # return index_error(output_format, gettext('No item found')), 500 + results.remove(res) + continue + except:pass if 'url' not in res: continue if 'title' not in res: continue