Spaces:
Running
Running
Commit
·
d1f4a66
1
Parent(s):
b306f2e
Update main.py
Browse files
main.py
CHANGED
@@ -35,7 +35,16 @@ from urllib.parse import urlparse, parse_qs
|
|
35 |
|
36 |
@app.route('/proxy/<path:url>')
|
37 |
def proxy(url):
|
38 |
-
headers = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
try:
|
40 |
# Remove 'proxy/' from the url if present
|
41 |
clean_url = url.replace('proxy/', '')
|
|
|
35 |
|
36 |
@app.route('/proxy/<path:url>')
|
37 |
def proxy(url):
|
38 |
+
headers = {
|
39 |
+
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
40 |
+
'Accept-Encoding': 'gzip, deflate',
|
41 |
+
'Accept-Language': 'en-US,en;q=0.9',
|
42 |
+
'Cache-Control': 'max-age=0',
|
43 |
+
'Connection': 'keep-alive',
|
44 |
+
'Dnt': '1',
|
45 |
+
'Upgrade-Insecure-Requests': '1',
|
46 |
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36'
|
47 |
+
}
|
48 |
try:
|
49 |
# Remove 'proxy/' from the url if present
|
50 |
clean_url = url.replace('proxy/', '')
|