Upload main.py
Browse files
main.py
CHANGED
|
@@ -307,7 +307,7 @@ async def get_reciter_audio(reciter_name: str, recitation_type: str, surah_numbe
|
|
| 307 |
# Return a StreamingResponse
|
| 308 |
return StreamingResponse(response.iter_content(chunk_size=8192),
|
| 309 |
media_type=response.headers.get('Content-Type', 'audio/mpeg'),
|
| 310 |
-
headers={"Content-Disposition": f"attachment; filename=
|
| 311 |
except requests.exceptions.RequestException as e:
|
| 312 |
print(f"Failed to fetch from HF CDN: {e}")
|
| 313 |
# Fall through to 404 if HF CDN also fails
|
|
|
|
| 307 |
# Return a StreamingResponse
|
| 308 |
return StreamingResponse(response.iter_content(chunk_size=8192),
|
| 309 |
media_type=response.headers.get('Content-Type', 'audio/mpeg'),
|
| 310 |
+
headers={"Content-Disposition": f"attachment; filename='{surah_str_padded}.mp3'"})
|
| 311 |
except requests.exceptions.RequestException as e:
|
| 312 |
print(f"Failed to fetch from HF CDN: {e}")
|
| 313 |
# Fall through to 404 if HF CDN also fails
|