Loading searx/engines/google.py +4 −1 Original line number Diff line number Diff line Loading @@ -202,7 +202,10 @@ def request(query, params): params['headers']['Accept-Language'] = language params['headers']['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' if google_hostname == default_hostname: try: params['cookies']['PREF'] = get_google_pref_cookie() except: logger.warning('cannot fetch PREF cookie') params['cookies']['NID'] = get_google_nid_cookie(google_hostname) params['google_hostname'] = google_hostname Loading searx/tests/engines/test_google.py +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ class TestGoogleEngine(SearxTestCase): params = google.request(query, dicto) self.assertIn('google.com', params['url']) self.assertIn('en', params['headers']['Accept-Language']) self.assertIn('PREF', params['cookies']) # self.assertIn('PREF', params['cookies']) self.assertIn('NID', params['cookies']) def test_response(self): Loading Loading
searx/engines/google.py +4 −1 Original line number Diff line number Diff line Loading @@ -202,7 +202,10 @@ def request(query, params): params['headers']['Accept-Language'] = language params['headers']['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' if google_hostname == default_hostname: try: params['cookies']['PREF'] = get_google_pref_cookie() except: logger.warning('cannot fetch PREF cookie') params['cookies']['NID'] = get_google_nid_cookie(google_hostname) params['google_hostname'] = google_hostname Loading
searx/tests/engines/test_google.py +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ class TestGoogleEngine(SearxTestCase): params = google.request(query, dicto) self.assertIn('google.com', params['url']) self.assertIn('en', params['headers']['Accept-Language']) self.assertIn('PREF', params['cookies']) # self.assertIn('PREF', params['cookies']) self.assertIn('NID', params['cookies']) def test_response(self): Loading