Commit ·
16ae8b2
1
Parent(s): 51966de
Ensure ?download=true in router redirect for cloud URLs
Browse files
modules/story_reels/router.py
CHANGED
|
@@ -97,6 +97,9 @@ async def download_story_reel(video_id: str):
|
|
| 97 |
|
| 98 |
# If video is in cloud (HF Hub), redirect to cloud URL
|
| 99 |
if video_url and video_url.startswith("https://"):
|
|
|
|
|
|
|
|
|
|
| 100 |
from fastapi.responses import RedirectResponse
|
| 101 |
return RedirectResponse(url=video_url, status_code=302)
|
| 102 |
|
|
|
|
| 97 |
|
| 98 |
# If video is in cloud (HF Hub), redirect to cloud URL
|
| 99 |
if video_url and video_url.startswith("https://"):
|
| 100 |
+
# Ensure ?download=true for direct download
|
| 101 |
+
if "?download=true" not in video_url:
|
| 102 |
+
video_url = video_url + "?download=true"
|
| 103 |
from fastapi.responses import RedirectResponse
|
| 104 |
return RedirectResponse(url=video_url, status_code=302)
|
| 105 |
|
modules/video_creator/router.py
CHANGED
|
@@ -80,6 +80,9 @@ async def get_video(video_id: str):
|
|
| 80 |
if cloud_meta_path.exists():
|
| 81 |
cloud_url = cloud_meta_path.read_text().strip()
|
| 82 |
if cloud_url:
|
|
|
|
|
|
|
|
|
|
| 83 |
from fastapi.responses import RedirectResponse
|
| 84 |
return RedirectResponse(url=cloud_url, status_code=302)
|
| 85 |
|
|
|
|
| 80 |
if cloud_meta_path.exists():
|
| 81 |
cloud_url = cloud_meta_path.read_text().strip()
|
| 82 |
if cloud_url:
|
| 83 |
+
# Ensure ?download=true for direct download
|
| 84 |
+
if "?download=true" not in cloud_url:
|
| 85 |
+
cloud_url = cloud_url + "?download=true"
|
| 86 |
from fastapi.responses import RedirectResponse
|
| 87 |
return RedirectResponse(url=cloud_url, status_code=302)
|
| 88 |
|