Commit
·
1c6395a
1
Parent(s):
3c8edf7
Update main.py
Browse files
main.py
CHANGED
|
@@ -68,7 +68,7 @@ def proxy(url):
|
|
| 68 |
clean_url = url.replace('proxy/', '')
|
| 69 |
|
| 70 |
try:
|
| 71 |
-
|
| 72 |
req = requests.get(clean_url, headers=headers, stream=True, timeout=5)
|
| 73 |
logging.info(f"Status Code: {req.status_code}, Response Headers: {req.headers}")
|
| 74 |
return Response(req.iter_content(chunk_size=2048), content_type=req.headers['content-type'])
|
|
@@ -77,7 +77,7 @@ def proxy(url):
|
|
| 77 |
session['exception_urls'].append(url)
|
| 78 |
save_exception_urls(session['exception_urls'])
|
| 79 |
print('Added to exceptions:',session['exception_urls'])
|
| 80 |
-
logging.error(f"Error in proxy
|
| 81 |
return send_file('static/error.png', mimetype='image/png')
|
| 82 |
|
| 83 |
|
|
@@ -106,7 +106,7 @@ def index():
|
|
| 106 |
loc = info['loc']
|
| 107 |
X, Y = latlon_to_pixel(info['loc'])
|
| 108 |
proxy_url = 'proxy/' + url
|
| 109 |
-
|
| 110 |
loc_link = f"https://www.google.com/maps/search/{loc}"
|
| 111 |
ip_link = url
|
| 112 |
return render_template('index.html',
|
|
|
|
| 68 |
clean_url = url.replace('proxy/', '')
|
| 69 |
|
| 70 |
try:
|
| 71 |
+
logging.info(f"Sending request to: {clean_url}")
|
| 72 |
req = requests.get(clean_url, headers=headers, stream=True, timeout=5)
|
| 73 |
logging.info(f"Status Code: {req.status_code}, Response Headers: {req.headers}")
|
| 74 |
return Response(req.iter_content(chunk_size=2048), content_type=req.headers['content-type'])
|
|
|
|
| 77 |
session['exception_urls'].append(url)
|
| 78 |
save_exception_urls(session['exception_urls'])
|
| 79 |
print('Added to exceptions:',session['exception_urls'])
|
| 80 |
+
logging.error(f"Error in proxy.\n\n")
|
| 81 |
return send_file('static/error.png', mimetype='image/png')
|
| 82 |
|
| 83 |
|
|
|
|
| 106 |
loc = info['loc']
|
| 107 |
X, Y = latlon_to_pixel(info['loc'])
|
| 108 |
proxy_url = 'proxy/' + url
|
| 109 |
+
logging.info(f"Generated proxy URL: {proxy_url}")
|
| 110 |
loc_link = f"https://www.google.com/maps/search/{loc}"
|
| 111 |
ip_link = url
|
| 112 |
return render_template('index.html',
|