Update app.py
Browse files
app.py
CHANGED
|
@@ -1033,7 +1033,7 @@ async def handle_upload(file: UploadFile = File(...)):
|
|
| 1033 |
return JSONResponse(content={"error": "FAILED GOD MAN AFTER alot of attempts"}, status_code=500)
|
| 1034 |
|
| 1035 |
original_url = upload_result['serving_url']
|
| 1036 |
-
mirrored_url = f"/
|
| 1037 |
|
| 1038 |
if original_extension.lower() not in supported_types:
|
| 1039 |
mirrored_url = mirrored_url.replace('.png', '')
|
|
@@ -1094,7 +1094,7 @@ async def redirect_short_url(short_code: str):
|
|
| 1094 |
"""
|
| 1095 |
return HTMLResponse(content=html_content)
|
| 1096 |
|
| 1097 |
-
@app.get("/
|
| 1098 |
async def handle_file_stream(path: str, request: Request):
|
| 1099 |
original_url = f'https://replicate.delivery/pbxt/{path}'
|
| 1100 |
|
|
|
|
| 1033 |
return JSONResponse(content={"error": "FAILED GOD MAN AFTER alot of attempts"}, status_code=500)
|
| 1034 |
|
| 1035 |
original_url = upload_result['serving_url']
|
| 1036 |
+
mirrored_url = f"/pp/{original_url.split('/pbxt/')[1]}"
|
| 1037 |
|
| 1038 |
if original_extension.lower() not in supported_types:
|
| 1039 |
mirrored_url = mirrored_url.replace('.png', '')
|
|
|
|
| 1094 |
"""
|
| 1095 |
return HTMLResponse(content=html_content)
|
| 1096 |
|
| 1097 |
+
@app.get("/pp/{path:path}")
|
| 1098 |
async def handle_file_stream(path: str, request: Request):
|
| 1099 |
original_url = f'https://replicate.delivery/pbxt/{path}'
|
| 1100 |
|