Spaces:
Running
Running
Commit
·
3ff67ea
1
Parent(s):
525173b
Update main.py
Browse files
main.py
CHANGED
@@ -49,7 +49,10 @@ 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)
|
|
|
|
|
|
|
53 |
|
54 |
content_type = req.headers['content-type']
|
55 |
|
@@ -59,6 +62,9 @@ def proxy(url):
|
|
59 |
print(f'MY Error: {e}')
|
60 |
return send_file('static/error.png', mimetype='image/png')
|
61 |
|
|
|
|
|
|
|
62 |
|
63 |
@app.route('/')
|
64 |
def index():
|
|
|
49 |
clean_url = url.replace('proxy/', '')
|
50 |
print('Cleaned URL:', clean_url)
|
51 |
|
52 |
+
#req = requests.get(f'{clean_url}', headers=headers, stream=True)
|
53 |
+
req = requests.get(f'{clean_url}', headers=headers)
|
54 |
+
print("Status Code:", req.status_code)
|
55 |
+
print("Response Headers:", req.headers)
|
56 |
|
57 |
content_type = req.headers['content-type']
|
58 |
|
|
|
62 |
print(f'MY Error: {e}')
|
63 |
return send_file('static/error.png', mimetype='image/png')
|
64 |
|
65 |
+
except Exception as e:
|
66 |
+
print(f"General Error: {e}")
|
67 |
+
|
68 |
|
69 |
@app.route('/')
|
70 |
def index():
|