Avoid Suno WAV fallback failures
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name ChatGPT to Suno Prompt Copier
|
||||
// @namespace local.suno-helper
|
||||
// @version 0.7.0
|
||||
// @version 0.7.1
|
||||
// @description Copy structured ChatGPT song prompt versions into Suno fields.
|
||||
// @author local
|
||||
// @match https://chatgpt.com/*
|
||||
@@ -604,7 +604,7 @@
|
||||
const audioPath = firstValue(object, ["audio_url", "audioUrl", "stream_audio_url", "streamAudioUrl", "play_url", "playUrl", "play_path", "playPath", "mp3_url", "mp3Url", "video_url", "videoUrl"]);
|
||||
const audioUrl = normalizeSunoMediaUrl(audioPath);
|
||||
const wavPath = firstValue(object, ["wav_url", "wavUrl", "download_url", "downloadUrl"]);
|
||||
const wavUrl = normalizeSunoMediaUrl(wavPath) || (id ? `https://cdn1.suno.ai/${id}.wav` : "");
|
||||
const wavUrl = normalizeSunoMediaUrl(wavPath);
|
||||
const lyrics = firstValue(object, ["prompt", "lyrics", "lyric", "text"]);
|
||||
const style = firstValue(object, ["gpt_description_prompt", "style", "tags", "description"]);
|
||||
const model = firstValue(object, ["model_name", "model", "major_model_version"]);
|
||||
@@ -727,7 +727,7 @@
|
||||
id,
|
||||
title: id,
|
||||
audioUrl: "",
|
||||
wavUrl: `https://cdn1.suno.ai/${id}.wav`,
|
||||
wavUrl: "",
|
||||
imageUrl: "",
|
||||
pageUrl: location.href,
|
||||
metadata: {},
|
||||
@@ -783,7 +783,7 @@
|
||||
const id = metadata.id || metadata.clip_id || metadata.clipId || ids[0] || "";
|
||||
const imageUrl = metadata.image_url || metadata.imageUrl || metadata.image_large_url || imageUrls[0] || "";
|
||||
const audioUrl = metadata.audio_url || metadata.audioUrl || audioUrls.find((url) => /\.wav(?:\?|$)/i.test(url)) || audioUrls[0] || "";
|
||||
const wavUrl = metadata.wav_url || metadata.wavUrl || audioUrls.find((url) => /\.wav(?:\?|$)/i.test(url)) || (id ? `https://cdn1.suno.ai/${id}.wav` : "");
|
||||
const wavUrl = metadata.wav_url || metadata.wavUrl || audioUrls.find((url) => /\.wav(?:\?|$)/i.test(url)) || "";
|
||||
|
||||
return {
|
||||
id,
|
||||
@@ -861,7 +861,7 @@
|
||||
await new Promise((resolve) => setTimeout(resolve, 1300));
|
||||
}
|
||||
|
||||
return track.wavUrl || `https://cdn1.suno.ai/${track.id}.wav`;
|
||||
return track.wavUrl || "";
|
||||
}
|
||||
|
||||
function downloadTextFile(text, name) {
|
||||
@@ -935,6 +935,10 @@
|
||||
const track = { ...tracks[index] };
|
||||
setStatus(statusTarget, `${index + 1}/${tracks.length} WAV 준비 중: ${track.title || track.id}`);
|
||||
track.wavUrl = await requestSunoWavUrl(track);
|
||||
if (!track.wavUrl) {
|
||||
setStatus(statusTarget, `${track.title || track.id} WAV URL을 아직 못 받아서 건너뜀`);
|
||||
continue;
|
||||
}
|
||||
preparedTracks.push(track);
|
||||
}
|
||||
const manifest = {
|
||||
@@ -980,6 +984,10 @@
|
||||
const track = { ...missingTracks[index] };
|
||||
setStatus(statusTarget, `${index + 1}/${missingTracks.length} 없는 곡 WAV 준비 중: ${track.title || track.id}`);
|
||||
track.wavUrl = await requestSunoWavUrl(track);
|
||||
if (!track.wavUrl) {
|
||||
setStatus(statusTarget, `${track.title || track.id} WAV 변환 URL이 아직 안 나와서 큐에 넣지 않음`);
|
||||
continue;
|
||||
}
|
||||
const enqueueManifest = {
|
||||
pageUrl: location.href,
|
||||
capturedAt: new Date().toISOString(),
|
||||
|
||||
Reference in New Issue
Block a user