aboutsummaryrefslogtreecommitdiffstats
path: root/server.py
diff options
context:
space:
mode:
Diffstat (limited to 'server.py')
-rw-r--r--server.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/server.py b/server.py
index 6fb61de..acce420 100644
--- a/server.py
+++ b/server.py
@@ -44,12 +44,12 @@ def proxy_site(env, start_response, video=False):
if env['QUERY_STRING']:
url += '?' + env['QUERY_STRING']
- if video and settings.route_tor == 1:
- response, cleanup_func = util.fetch_url_response(url, headers,
- use_tor=False,
- max_redirects=10)
- elif video:
+ if video:
+ params = urllib.parse.parse_qs(env['QUERY_STRING'])
+ params_use_tor = int(params.get('use_tor', '0')[0])
+ use_tor = (settings.route_tor == 2) or params_use_tor
response, cleanup_func = util.fetch_url_response(url, headers,
+ use_tor=use_tor,
max_redirects=10)
else:
response, cleanup_func = util.fetch_url_response(url, headers)