creatomate 가사 정합

This commit is contained in:
jaehwang committed 2026-01-21 04:18:14 +00:00
1 parent 94be8a0746
commit 198513f237
4 files changed
+141 -49

No files matched your search

+7 -7
View File
@@ -197,19 +197,19 @@ class SunoService:
"audio_id" : audio_id
}
async with httpx.AsyncClient() as client:
response = await client.get(
response = await client.post(
f"{self.BASE_URL}/generate/get-timestamped-lyrics",
headers=self.headers,
json = payload,
json=payload,
timeout=30.0,
)
response.raise_for_status()
data = response.json()
if data is None:
if not data or not data['data']:
raise ValueError("Suno API returned empty response for task status")
return data['alignedWords']
return data['data']['alignedWords']
def parse_status_response(self, result: dict | None) -> PollingSongResponse:
"""Suno API 상태 응답을 파싱하여 PollingSongResponse로 변환합니다.
@@ -355,12 +355,12 @@ class SunoService:
results.append({
'text': sentence,
'startS': word_start['startS'],
'endS': word_end['endS'],
'start_sec': word_start['startS'],
'end_sec': word_end['endS'],
})
search_pos = found_pos + len(norm_sentence)
else:
results.append({'text': sentence, 'startS': None, 'endS': None})
results.append({'text': sentence, 'start_sec': None, 'end_sec': None})
return results