BraydenMoore commited on
Commit
30aaad8
·
1 Parent(s): 0abe2d7

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -9
main.py CHANGED
@@ -30,15 +30,12 @@ def latlon_to_pixel(loc):
30
  @app.route('/proxy/<path:url>')
31
  def proxy(url):
32
  print('URL:',url)
33
- retries = 3
34
- while retries > 0:
35
- try:
36
- req = requests.get(f'http://{url}', stream=True, timeout=5)
37
- return Response(req.iter_content(chunk_size=10*1024), content_type=req.headers['content-type'])
38
- except requests.exceptions.RequestException as e:
39
- print('retrying...')
40
- retries -= 1
41
- return send_file('static/error.png', mimetype='image/png')
42
 
43
  @app.route('/')
44
  def index():
 
30
  @app.route('/proxy/<path:url>')
31
  def proxy(url):
32
  print('URL:',url)
33
+ try:
34
+ req = requests.get(f'http://{url}', stream=True, timeout=5)
35
+ return Response(req.iter_content(chunk_size=10*1024), content_type=req.headers['content-type'])
36
+ except requests.exceptions.RequestException as e:
37
+ print('error.')
38
+ return send_file('static/error.png', mimetype='image/png')
 
 
 
39
 
40
  @app.route('/')
41
  def index():