Avoid Suno WAV fallback failures

This commit is contained in:
DESKTOP-KSVGT20\shkim
2026-05-02 00:06:22 +09:00
parent b763412d9b
commit d24f7da838
2 changed files with 20 additions and 7 deletions
+7 -2
View File
@@ -360,7 +360,6 @@ foreach ($track in $tracks) {
$albumTitle = Get-AlbumTitle $title $id
$trackFolder = Get-TrackFolder $libraryRoot $title $id
New-Item -ItemType Directory -Force -Path $trackFolder | Out-Null
$safeTitle = ConvertTo-SafeName $title $id
$shortId = Get-ShortId $id
$trackNo = Get-NextTrackNumber $trackFolder
@@ -374,7 +373,6 @@ foreach ($track in $tracks) {
$wavUrl = Resolve-SunoMediaUrl $(if ($track.wavUrl) { "$($track.wavUrl)" } else { Get-DeepValue $track @("wav_url", "wavUrl", "download_url", "downloadUrl") })
$wavCandidates = @()
if ($wavUrl) { $wavCandidates += $wavUrl }
if ($id) { $wavCandidates += "https://cdn1.suno.ai/$id.wav" }
$wavCandidates = $wavCandidates | Where-Object { $_ } | Select-Object -Unique
$imageUrl = if ($track.imageUrl) { "$($track.imageUrl)" } else { Get-DeepValue $track @("image_url", "imageUrl", "image_large_url", "cover_url") }
@@ -389,6 +387,11 @@ foreach ($track in $tracks) {
Write-Host ""
Write-Host "[$index/$($tracks.Count)] $title"
if (-not $wavCandidates.Count) {
Write-Warning "WAV URL이 없어서 건너뜀: $title"
continue
}
$audioOk = $false
foreach ($candidate in $wavCandidates) {
Write-Host "WAV 후보 시도: $candidate"
@@ -400,6 +403,8 @@ foreach ($track in $tracks) {
continue
}
New-Item -ItemType Directory -Force -Path $trackFolder | Out-Null
$coverOk = $false
if ($imageUrl) {
$coverDownloaded = Invoke-Download $imageUrl $rawCoverFile