Route WAV buttons through Suno UI download

This commit is contained in:
DESKTOP-KSVGT20\shkim
2026-05-02 02:04:41 +09:00
parent 12a27381e3
commit 8fb7dbb250
+9 -9
View File
@@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name ChatGPT to Suno Prompt Copier // @name ChatGPT to Suno Prompt Copier
// @namespace local.suno-helper // @namespace local.suno-helper
// @version 0.9.5 // @version 0.9.8
// @description Copy structured ChatGPT song prompt versions into Suno fields. // @description Copy structured ChatGPT song prompt versions into Suno fields.
// @author local // @author local
// @match https://chatgpt.com/* // @match https://chatgpt.com/*
@@ -30,7 +30,7 @@
(function () { (function () {
"use strict"; "use strict";
const SCRIPT_VERSION = "0.9.7"; const SCRIPT_VERSION = "0.9.8";
const STORAGE_KEY = "chatgptSunoPromptSlots"; const STORAGE_KEY = "chatgptSunoPromptSlots";
const SLOT_COUNT = 2; const SLOT_COUNT = 2;
const isChatGPT = location.hostname.includes("chatgpt.com") || location.hostname.includes("chat.openai.com"); const isChatGPT = location.hostname.includes("chatgpt.com") || location.hostname.includes("chat.openai.com");
@@ -1815,15 +1815,15 @@
<div class="cgs-track-list" data-cgs-track-list></div> <div class="cgs-track-list" data-cgs-track-list></div>
<div class="cgs-row"> <div class="cgs-row">
<button class="cgs-btn cgs-wide" type="button" data-cgs-process-one-mp3>선택 1곡 MP3</button> <button class="cgs-btn cgs-wide" type="button" data-cgs-process-one-mp3>선택 1곡 MP3</button>
<button class="cgs-btn cgs-wide" type="button" data-cgs-process-one-wav>선택 1곡 WAV</button> <button class="cgs-btn cgs-wide" type="button" data-cgs-process-one-wav>선택 1곡 WAV(UI)</button>
</div> </div>
<div class="cgs-row"> <div class="cgs-row">
<button class="cgs-btn cgs-primary cgs-wide" type="button" data-cgs-process-selected-mp3>선택항목 MP3</button> <button class="cgs-btn cgs-primary cgs-wide" type="button" data-cgs-process-selected-mp3>선택항목 MP3</button>
<button class="cgs-btn cgs-primary cgs-wide" type="button" data-cgs-process-selected-wav>선택항목 WAV</button> <button class="cgs-btn cgs-primary cgs-wide" type="button" data-cgs-process-selected-wav>선택항목 WAV(UI)</button>
</div> </div>
<div class="cgs-row"> <div class="cgs-row">
<button class="cgs-btn cgs-wide" type="button" data-cgs-ui-download-mp3>SUNO UI MP3 클릭</button> <button class="cgs-btn cgs-wide" type="button" data-cgs-ui-download-mp3>SUNO UI MP3 클릭</button>
<button class="cgs-btn cgs-wide" type="button" data-cgs-ui-download-wav>SUNO UI WAV 클릭</button> <button class="cgs-btn cgs-wide" type="button" data-cgs-ui-download-wav>SUNO UI WAV 재시도</button>
</div> </div>
<div class="cgs-row"> <div class="cgs-row">
<button class="cgs-btn cgs-wide" type="button" data-cgs-test-companion>연결 테스트</button> <button class="cgs-btn cgs-wide" type="button" data-cgs-test-companion>연결 테스트</button>
@@ -2039,7 +2039,7 @@
}); });
body.querySelector("[data-cgs-process-one-wav]").addEventListener("click", async () => { body.querySelector("[data-cgs-process-one-wav]").addEventListener("click", async () => {
await processSelectedTrack("wav"); await clickSelectedSunoUiDownloads("wav", { one: true });
}); });
body.querySelector("[data-cgs-process-selected-mp3]").addEventListener("click", async () => { body.querySelector("[data-cgs-process-selected-mp3]").addEventListener("click", async () => {
@@ -2047,15 +2047,15 @@
}); });
body.querySelector("[data-cgs-process-selected-wav]").addEventListener("click", async () => { body.querySelector("[data-cgs-process-selected-wav]").addEventListener("click", async () => {
await processSelectedTracks("wav"); await clickSelectedSunoUiDownloads("wav");
}); });
const clickSelectedSunoUiDownloads = async (format) => { const clickSelectedSunoUiDownloads = async (format, options = {}) => {
if (!libraryTracks.length) { if (!libraryTracks.length) {
mergeLibraryTracks(scanSunoLibraryTracks()); mergeLibraryTracks(scanSunoLibraryTracks());
renderLibraryTrackList(); renderLibraryTrackList();
} }
const tracks = getSelectedTracks(); const tracks = options.one ? (getSelectedTracks().slice(0, 1)) : getSelectedTracks();
if (!tracks.length) { if (!tracks.length) {
setStatus(body, "선택된 곡이 없어. 목록에서 현재 화면에 보이는 곡을 먼저 선택해줘."); setStatus(body, "선택된 곡이 없어. 목록에서 현재 화면에 보이는 곡을 먼저 선택해줘.");
return; return;