summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorMarc Abonce Seguin <marc-abonce@mailbox.org>2019-08-25 22:23:37 -0700
committerMarc Abonce Seguin <marc-abonce@mailbox.org>2019-12-21 22:47:08 -0600
commitc18048e0454f4e3dc75c778940903091fbeae06a (patch)
treedca59fe10ea8df7d1d74dca18c7feef41261bcf3 /searx
parent34ad3d6b34017523a9502f86b92c17fe389918eb (diff)
downloadsearxng-c18048e0454f4e3dc75c778940903091fbeae06a.tar.gz
searxng-c18048e0454f4e3dc75c778940903091fbeae06a.zip
exclude disambiguation pages from wikipedia infobox
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/wikipedia.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/searx/engines/wikipedia.py b/searx/engines/wikipedia.py
index 690da72fe..44dea56fa 100644
--- a/searx/engines/wikipedia.py
+++ b/searx/engines/wikipedia.py
@@ -21,7 +21,8 @@ search_url = base_url + u'w/api.php?'\
'action=query'\
'&format=json'\
'&{query}'\
- '&prop=extracts|pageimages'\
+ '&prop=extracts|pageimages|pageprops'\
+ '&ppprop=disambiguation'\
'&exintro'\
'&explaintext'\
'&pithumbsize=300'\
@@ -87,7 +88,7 @@ def response(resp):
if int(article_id) > 0:
break
- if int(article_id) < 0:
+ if int(article_id) < 0 or 'disambiguation' in page.get('pageprops', {}):
return []
title = page.get('title')