Spaces:
Running
Running
Commit
·
e580d82
1
Parent(s):
b6d7245
Update main.py
Browse files
main.py
CHANGED
@@ -57,10 +57,14 @@ def proxy(url):
|
|
57 |
if '.jpg' in clean_url and 'stream' not in clean_url:
|
58 |
req = requests.get(f'{clean_url}', headers=headers, timeout=3)
|
59 |
content_type = req.headers['content-type']
|
|
|
|
|
60 |
return Response(req.content, content_type=content_type)
|
61 |
else:
|
62 |
req = requests.get(f'{clean_url}', headers=headers, stream=True, timeout=10)
|
63 |
content_type = req.headers['content-type']
|
|
|
|
|
64 |
return Response(req.iter_content(chunk_size=512), content_type=content_type)
|
65 |
|
66 |
except:
|
|
|
57 |
if '.jpg' in clean_url and 'stream' not in clean_url:
|
58 |
req = requests.get(f'{clean_url}', headers=headers, timeout=3)
|
59 |
content_type = req.headers['content-type']
|
60 |
+
print("Status Code:", req.status_code)
|
61 |
+
print("Response Headers:", req.headers)
|
62 |
return Response(req.content, content_type=content_type)
|
63 |
else:
|
64 |
req = requests.get(f'{clean_url}', headers=headers, stream=True, timeout=10)
|
65 |
content_type = req.headers['content-type']
|
66 |
+
print("Status Code:", req.status_code)
|
67 |
+
print("Response Headers:", req.headers)
|
68 |
return Response(req.iter_content(chunk_size=512), content_type=content_type)
|
69 |
|
70 |
except:
|