Spaces:
Running
Running
Commit
·
532ed57
1
Parent(s):
cb50560
Update main.py
Browse files
main.py
CHANGED
@@ -82,7 +82,11 @@ from urllib.parse import urlparse, parse_qs
|
|
82 |
|
83 |
@app.route('/proxy/<path:url>')
|
84 |
def proxy(url):
|
85 |
-
|
|
|
|
|
|
|
|
|
86 |
|
87 |
headers = {
|
88 |
'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',
|
@@ -95,7 +99,7 @@ def proxy(url):
|
|
95 |
'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'
|
96 |
}
|
97 |
|
98 |
-
clean_url =
|
99 |
clean_url = encode_url(clean_url)
|
100 |
|
101 |
try:
|
|
|
82 |
|
83 |
@app.route('/proxy/<path:url>')
|
84 |
def proxy(url):
|
85 |
+
full_url = url
|
86 |
+
query_string = request.query_string.decode("utf-8")
|
87 |
+
if query_string:
|
88 |
+
full_url += "?" + query_string
|
89 |
+
print("CHOSEN",full_url)
|
90 |
|
91 |
headers = {
|
92 |
'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',
|
|
|
99 |
'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'
|
100 |
}
|
101 |
|
102 |
+
clean_url = full_url.replace('proxy/', '')
|
103 |
clean_url = encode_url(clean_url)
|
104 |
|
105 |
try:
|