Update app.py
Browse files
app.py
CHANGED
|
@@ -35,10 +35,16 @@ def proxy():
|
|
| 35 |
tag['href'] = '/proxy?url=' + tag['href']
|
| 36 |
for tag in soup.find_all(src=True):
|
| 37 |
tag['src'] = '/proxy?url=' + tag['src']
|
| 38 |
-
content =
|
| 39 |
-
|
|
|
|
| 40 |
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
except requests.RequestException as e:
|
| 43 |
return jsonify({'error': str(e)}), 500
|
| 44 |
|
|
|
|
| 35 |
tag['href'] = '/proxy?url=' + tag['href']
|
| 36 |
for tag in soup.find_all(src=True):
|
| 37 |
tag['src'] = '/proxy?url=' + tag['src']
|
| 38 |
+
content = str(soup)
|
| 39 |
+
with open("forward.html", "w") as f:
|
| 40 |
+
f.write(content)
|
| 41 |
|
| 42 |
+
with open("forward.html", "r") as f:
|
| 43 |
+
content = f.read()
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
return content, response.status_code, headers
|
| 48 |
except requests.RequestException as e:
|
| 49 |
return jsonify({'error': str(e)}), 500
|
| 50 |
|