Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75b276f4 authored by Marc Abonce Seguin's avatar Marc Abonce Seguin
Browse files

fix bing "garbage" results (issue #1275)

parent b25dccd1
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
from lxml import html
from searx.engines.xpath import extract_text
from searx.url_utils import urlencode
from searx.utils import match_language
from searx.utils import match_language, gen_useragent

# engine dependent config
categories = ['general']
@@ -43,6 +43,9 @@ def request(query, params):
        offset=offset)

    params['url'] = base_url + search_path

    params['headers']['User-Agent'] = gen_useragent('Windows NT 6.3; WOW64')

    return params


+2 −2
Original line number Diff line number Diff line
@@ -57,9 +57,9 @@ blocked_tags = ('script',
                'style')


def gen_useragent():
def gen_useragent(os=None):
    # TODO
    return ua.format(os=choice(ua_os), version=choice(ua_versions))
    return ua.format(os=os or choice(ua_os), version=choice(ua_versions))


def searx_useragent():