Match Suno MP3 download preflight
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user