mirror of
https://github.com/searx/searx
synced 2025-02-08 16:08:49 +01:00
Do not consent to tracking when using google
This commit is contained in:
parent
a1c06cbb1b
commit
5b50d7455a
@ -11,6 +11,7 @@ Definitions`_.
|
||||
# pylint: disable=invalid-name, missing-function-docstring, too-many-branches
|
||||
|
||||
from urllib.parse import urlencode, urlparse
|
||||
from random import random
|
||||
from lxml import html
|
||||
from searx import logger
|
||||
from searx.utils import match_language, extract_text, eval_xpath, eval_xpath_list, eval_xpath_getindex
|
||||
@ -236,7 +237,7 @@ def request(query, params):
|
||||
params['url'] = query_url
|
||||
|
||||
logger.debug("HTTP header Accept-Language --> %s", lang_info.get('Accept-Language'))
|
||||
params['cookies']['CONSENT'] = "YES+"
|
||||
params['cookies']['CONSENT'] = "PENDING+" + str(random()*100)
|
||||
params['headers'].update(lang_info['headers'])
|
||||
if use_mobile_ui:
|
||||
params['headers']['Accept'] = '*/*'
|
||||
|
@ -21,6 +21,7 @@ import binascii
|
||||
import re
|
||||
from urllib.parse import urlencode
|
||||
from base64 import b64decode
|
||||
from random import random
|
||||
from lxml import html
|
||||
|
||||
from searx import logger
|
||||
@ -113,7 +114,7 @@ def request(query, params):
|
||||
|
||||
logger.debug("HTTP header Accept-Language --> %s", lang_info.get('Accept-Language'))
|
||||
|
||||
params['cookies']['CONSENT'] = "YES+"
|
||||
params['cookies']['CONSENT'] = "PENDING+" + str(random()*100)
|
||||
params['headers'].update(lang_info['headers'])
|
||||
params['headers']['Accept'] = (
|
||||
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
|
||||
|
@ -12,6 +12,7 @@ Definitions`_.
|
||||
|
||||
from urllib.parse import urlencode
|
||||
from datetime import datetime
|
||||
from random import random
|
||||
from lxml import html
|
||||
from searx import logger
|
||||
|
||||
@ -99,7 +100,7 @@ def request(query, params):
|
||||
params['url'] = query_url
|
||||
|
||||
logger.debug("HTTP header Accept-Language --> %s", lang_info.get('Accept-Language'))
|
||||
params['cookies']['CONSENT'] = "YES+"
|
||||
params['cookies']['CONSENT'] = "PENDING+" + str(random()*100)
|
||||
params['headers'].update(lang_info['headers'])
|
||||
params['headers']['Accept'] = (
|
||||
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
|
||||
|
@ -22,6 +22,7 @@ Definitions`_. Not all parameters can be appied.
|
||||
|
||||
import re
|
||||
from urllib.parse import urlencode
|
||||
from random import random
|
||||
from lxml import html
|
||||
|
||||
from searx import logger
|
||||
@ -139,7 +140,7 @@ def request(query, params):
|
||||
params['url'] = query_url
|
||||
|
||||
logger.debug("HTTP header Accept-Language --> %s", lang_info.get('Accept-Language'))
|
||||
params['cookies']['CONSENT'] = "YES+"
|
||||
params['cookies']['CONSENT'] = "PENDING+" + str(random()*100)
|
||||
params['headers'].update(lang_info['headers'])
|
||||
params['headers']['Accept'] = (
|
||||
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
|
||||
|
@ -6,6 +6,7 @@
|
||||
from functools import reduce
|
||||
from json import loads, dumps
|
||||
from urllib.parse import quote_plus
|
||||
from random import random
|
||||
|
||||
# about
|
||||
about = {
|
||||
@ -43,7 +44,7 @@ base_youtube_url = 'https://www.youtube.com/watch?v='
|
||||
|
||||
# do search-request
|
||||
def request(query, params):
|
||||
params['cookies']['CONSENT'] = "YES+"
|
||||
params['cookies']['CONSENT'] = "PENDING+" + str(random() * 100)
|
||||
if not params['engine_data'].get('next_page_token'):
|
||||
params['url'] = search_url.format(query=quote_plus(query), page=params['pageno'])
|
||||
if params['time_range'] in time_range_dict:
|
||||
|
Loading…
x
Reference in New Issue
Block a user