Merge remote-tracking branch 'origin/main' into heroku-app
This commit is contained in:
commit
42d0244bb9
|
@ -14,7 +14,7 @@ app.default_key_set = generate_user_keys()
|
||||||
app.no_cookie_ips = []
|
app.no_cookie_ips = []
|
||||||
app.config['SECRET_KEY'] = os.urandom(32)
|
app.config['SECRET_KEY'] = os.urandom(32)
|
||||||
app.config['SESSION_TYPE'] = 'filesystem'
|
app.config['SESSION_TYPE'] = 'filesystem'
|
||||||
app.config['VERSION_NUMBER'] = '0.3.1'
|
app.config['VERSION_NUMBER'] = '0.3.2'
|
||||||
app.config['APP_ROOT'] = os.getenv(
|
app.config['APP_ROOT'] = os.getenv(
|
||||||
'APP_ROOT',
|
'APP_ROOT',
|
||||||
os.path.dirname(os.path.abspath(__file__)))
|
os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
|
@ -210,6 +210,12 @@ class Request:
|
||||||
'User-Agent': self.modified_user_agent
|
'User-Agent': self.modified_user_agent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# FIXME: Should investigate this further to ensure the consent
|
||||||
|
# view is suppressed correctly
|
||||||
|
cookies = {
|
||||||
|
'CONSENT': 'PENDING+999'
|
||||||
|
}
|
||||||
|
|
||||||
# Validate Tor conn and request new identity if the last one failed
|
# Validate Tor conn and request new identity if the last one failed
|
||||||
if self.tor and not send_tor_signal(
|
if self.tor and not send_tor_signal(
|
||||||
Signal.NEWNYM if attempt > 0 else Signal.HEARTBEAT):
|
Signal.NEWNYM if attempt > 0 else Signal.HEARTBEAT):
|
||||||
|
@ -233,7 +239,8 @@ class Request:
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
base_url + query,
|
base_url + query,
|
||||||
proxies=self.proxies,
|
proxies=self.proxies,
|
||||||
headers=headers)
|
headers=headers,
|
||||||
|
cookies=cookies)
|
||||||
|
|
||||||
# Retry query with new identity if using Tor (max 10 attempts)
|
# Retry query with new identity if using Tor (max 10 attempts)
|
||||||
if 'form id="captcha-form"' in response.text and self.tor:
|
if 'form id="captcha-form"' in response.text and self.tor:
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -8,7 +8,7 @@ setuptools.setup(
|
||||||
author='Ben Busby',
|
author='Ben Busby',
|
||||||
author_email='benbusby@protonmail.com',
|
author_email='benbusby@protonmail.com',
|
||||||
name='whoogle-search',
|
name='whoogle-search',
|
||||||
version='0.3.1',
|
version='0.3.2',
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
install_requires=requirements,
|
install_requires=requirements,
|
||||||
description='Self-hosted, ad-free, privacy-respecting metasearch engine',
|
description='Self-hosted, ad-free, privacy-respecting metasearch engine',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user