주소 파싱코드 분리 및 에러 수정

This commit is contained in:
skkim committed 2026-06-02 17:21:27 +09:00
1 parent 2b4c89217a
commit bdee852bed
6 files changed
+134 -124

No files matched your search

+4 -2
View File
@@ -247,7 +247,7 @@ class SunoService:
return data
async def get_lyric_timestamp(self, task_id: str, audio_id: str) -> dict[str, Any]:
async def get_lyric_timestamp(self, task_id: str, audio_id: str) -> dict[str, Any] | None:
"""
음악 타임스탬프 정보 추출
@@ -270,8 +270,10 @@ class SunoService:
response.raise_for_status()
data = response.json()
# Suno는 오디오 생성 완료 후에도 타임스탬프 정렬을 별도로 처리하므로,
# 빈 응답은 아직 준비되지 않은 상태를 의미한다. None을 반환해 호출부에서 폴링을 유지하게 한다.
if not data or not data["data"]:
raise ValueError("Suno API returned empty response for task status")
return None
return data["data"]["alignedWords"]