BraydenMoore commited on
Commit
81d7489
·
1 Parent(s): f732347

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -49,17 +49,17 @@ def proxy(url):
49
  clean_url = url.replace('proxy/', '')
50
  print('Cleaned URL:', clean_url)
51
 
52
- req = requests.get(f'{clean_url}', headers=headers, stream=True, timeout=10)
53
  print("Status Code:", req.status_code)
54
  print("Response Headers:", req.headers)
55
 
56
  content_type = req.headers['content-type']
57
 
58
- return Response(req.iter_content(chunk_size=50*1024), content_type=content_type)
59
 
60
  except:
61
  print(f'Redirecting')
62
- return redirect(url_for('index', new='true'))
63
 
64
 
65
  @app.route('/')
 
49
  clean_url = url.replace('proxy/', '')
50
  print('Cleaned URL:', clean_url)
51
 
52
+ req = requests.get(f'{clean_url}', headers=headers, stream=True, timeout=15)
53
  print("Status Code:", req.status_code)
54
  print("Response Headers:", req.headers)
55
 
56
  content_type = req.headers['content-type']
57
 
58
+ return Response(req.iter_content(chunk_size=2*1024), content_type=content_type)
59
 
60
  except:
61
  print(f'Redirecting')
62
+ return send_file('static/error.png', mimetype='image/png')
63
 
64
 
65
  @app.route('/')