fix(music-render): raise_for_status on MusicGen MP3 download (T6 follow-up)
Code review found: non-200 response from /audio/ endpoint was silently written as MP3 body → corrupt file. Match T5 suno.py download pattern. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -68,6 +68,7 @@ def run_local_generation(task_id: str, params: dict) -> None:
|
|||||||
file_path = os.path.join(MUSIC_MEDIA_ROOT, filename)
|
file_path = os.path.join(MUSIC_MEDIA_ROOT, filename)
|
||||||
|
|
||||||
dl = requests.get(remote_url, timeout=120, stream=True)
|
dl = requests.get(remote_url, timeout=120, stream=True)
|
||||||
|
dl.raise_for_status()
|
||||||
with open(file_path, "wb") as f:
|
with open(file_path, "wb") as f:
|
||||||
for chunk in dl.iter_content(chunk_size=8192):
|
for chunk in dl.iter_content(chunk_size=8192):
|
||||||
f.write(chunk)
|
f.write(chunk)
|
||||||
|
|||||||
Reference in New Issue
Block a user