Simplify Suno download controls to WAV workflow
This commit is contained in:
@@ -191,7 +191,6 @@ foreach ($track in $tracks) {
|
||||
$model = Get-DeepValue $track @("model_name", "model", "major_model_version")
|
||||
$createdAt = Get-DeepValue $track @("created_at", "createdAt")
|
||||
|
||||
$audioUrl = Resolve-SunoMediaUrl $(if ($track.audioUrl) { "$($track.audioUrl)" } else { Get-DeepValue $track @("audio_url", "audioUrl", "stream_audio_url", "streamAudioUrl", "play_url", "playUrl", "play_path", "playPath", "mp3_url", "mp3Url", "video_url", "videoUrl") })
|
||||
$wavUrl = Resolve-SunoMediaUrl $(if ($track.wavUrl) { "$($track.wavUrl)" } else { Get-DeepValue $track @("wav_url", "wavUrl", "download_url", "downloadUrl") })
|
||||
$wavCandidates = @()
|
||||
if ($wavUrl) { $wavCandidates += $wavUrl }
|
||||
@@ -200,7 +199,6 @@ foreach ($track in $tracks) {
|
||||
$imageUrl = if ($track.imageUrl) { "$($track.imageUrl)" } else { Get-DeepValue $track @("image_url", "imageUrl", "image_large_url", "cover_url") }
|
||||
|
||||
$inputAudio = Join-Path $workRoot "$prefix.input.wav"
|
||||
$fallbackAudio = Join-Path $workRoot "$prefix.input.$(Get-UrlExtension $audioUrl 'audio')"
|
||||
$coverFile = Join-Path $workRoot "$prefix.cover.$(Get-UrlExtension $imageUrl 'jpg')"
|
||||
$metadataFile = Join-Path $targetRoot "$prefix.metadata.json"
|
||||
$flacFile = Join-Path $targetRoot "$prefix.flac"
|
||||
@@ -214,14 +212,8 @@ foreach ($track in $tracks) {
|
||||
$audioOk = Invoke-Download $candidate $inputAudio
|
||||
if ($audioOk) { break }
|
||||
}
|
||||
if (-not $audioOk -and $audioUrl) {
|
||||
Write-Host "WAV 후보 실패. audioUrl로 fallback 시도."
|
||||
$audioOk = Invoke-Download $audioUrl $fallbackAudio
|
||||
if ($audioOk) { $inputAudio = $fallbackAudio }
|
||||
}
|
||||
|
||||
if (-not $audioOk) {
|
||||
Write-Warning "오디오를 받지 못해서 건너뜀: $title"
|
||||
Write-Warning "WAV를 받지 못해서 건너뜀: $title"
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user