mirror of https://github.com/searx/searx
exclude disambiguation pages from wikipedia infobox
This commit is contained in:
parent
34ad3d6b34
commit
c18048e045
|
@ -21,7 +21,8 @@ search_url = base_url + u'w/api.php?'\
|
||||||
'action=query'\
|
'action=query'\
|
||||||
'&format=json'\
|
'&format=json'\
|
||||||
'&{query}'\
|
'&{query}'\
|
||||||
'&prop=extracts|pageimages'\
|
'&prop=extracts|pageimages|pageprops'\
|
||||||
|
'&ppprop=disambiguation'\
|
||||||
'&exintro'\
|
'&exintro'\
|
||||||
'&explaintext'\
|
'&explaintext'\
|
||||||
'&pithumbsize=300'\
|
'&pithumbsize=300'\
|
||||||
|
@ -87,7 +88,7 @@ def response(resp):
|
||||||
if int(article_id) > 0:
|
if int(article_id) > 0:
|
||||||
break
|
break
|
||||||
|
|
||||||
if int(article_id) < 0:
|
if int(article_id) < 0 or 'disambiguation' in page.get('pageprops', {}):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
title = page.get('title')
|
title = page.get('title')
|
||||||
|
|
Loading…
Reference in New Issue