From da4aaa667eb732ce8797a279216f7a761b41e696 Mon Sep 17 00:00:00 2001 From: "DESKTOP-KSVGT20\\shkim" Date: Sat, 2 May 2026 01:01:02 +0900 Subject: [PATCH] Match Suno MP3 download preflight --- .gitignore | 1 + chatgpt-suno-tampermonkey.user.js | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 6642c0a..f48edd3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ companion-inbox/ companion-logs/ _work/ +*.har diff --git a/chatgpt-suno-tampermonkey.user.js b/chatgpt-suno-tampermonkey.user.js index 8794e21..21c0a15 100644 --- a/chatgpt-suno-tampermonkey.user.js +++ b/chatgpt-suno-tampermonkey.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name ChatGPT to Suno Prompt Copier // @namespace local.suno-helper -// @version 0.8.2 +// @version 0.8.3 // @description Copy structured ChatGPT song prompt versions into Suno fields. // @author local // @match https://chatgpt.com/* @@ -28,7 +28,7 @@ (function () { "use strict"; - const SCRIPT_VERSION = "0.8.2"; + const SCRIPT_VERSION = "0.8.3"; const STORAGE_KEY = "chatgptSunoPromptSlots"; const SLOT_COUNT = 2; const isChatGPT = location.hostname.includes("chatgpt.com") || location.hostname.includes("chat.openai.com"); @@ -1155,6 +1155,25 @@ } async function downloadSunoMp3Buffer(track, statusTarget) { + if (track.id) { + const id = encodeURIComponent(track.id); + setStatus(statusTarget, `SUNO MP3 다운로드 권한 요청 중: ${track.title || track.id}`); + for (const url of [ + `https://studio-api-prod.suno.com/api/gen/${id}/increment_action_count/`, + `https://studio-api-prod.suno.com/api/billing/clips/${id}/download/`, + ]) { + try { + await callSunoJson(url, { method: "POST" }); + } catch (postError) { + try { + await callSunoJson(url, { method: "GET" }); + } catch (getError) { + console.warn("[ChatGPT to Suno] MP3 preflight failed", url, postError, getError); + } + } + } + } + const candidates = getMp3Candidates(track); if (!candidates.length) throw new Error("MP3 후보 URL 없음"); for (const url of candidates) {