Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,32 +22,9 @@ input, button { padding:0.5rem; margin:0.5rem 0; width:100%; }
|
|
| 22 |
a { color:#0f0; display:block; margin-top:1rem; }
|
| 23 |
</style>
|
| 24 |
</head>
|
| 25 |
-
<body>
|
| 26 |
|
| 27 |
-
<h1>Suno Song → Direct MP3</h1>
|
| 28 |
|
| 29 |
-
<input id="songUrl" placeholder="Paste Suno song URL here" />
|
| 30 |
-
<button id="convertBtn">Convert to MP3</button>
|
| 31 |
|
| 32 |
-
<div id="result"></div>
|
| 33 |
-
|
| 34 |
-
<script>
|
| 35 |
-
document.getElementById("convertBtn").onclick = () => {
|
| 36 |
-
const url = document.getElementById("songUrl").value.trim();
|
| 37 |
-
const match = url.match(/suno\.com\/song\/([a-f0-9\-]+)/i);
|
| 38 |
-
if(match){
|
| 39 |
-
const uuid = match[1];
|
| 40 |
-
const mp3Url = `https://cdn1.suno.ai/${uuid}.mp3`;
|
| 41 |
-
document.getElementById("result").innerHTML = `
|
| 42 |
-
<p>Direct MP3 URL:</p>
|
| 43 |
-
<a href="${mp3Url}" download>Download MP3</a>
|
| 44 |
-
<audio controls src="${mp3Url}"></audio>
|
| 45 |
-
`;
|
| 46 |
-
} else {
|
| 47 |
-
document.getElementById("result").innerHTML = `<p style="color:red;">Invalid Suno URL!</p>`;
|
| 48 |
-
}
|
| 49 |
-
};
|
| 50 |
-
</script>
|
| 51 |
|
| 52 |
</body>
|
| 53 |
|
|
@@ -107,6 +84,36 @@ a:hover {
|
|
| 107 |
<p>If the player doesn’t load, you can <a href="https://suno.com/song/c0cdb3ad-f49d-4125-8e16-4d7dd7924a02" target="_blank">click here to listen on Suno</a>.</p>
|
| 108 |
|
| 109 |
</body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
</html>
|
| 111 |
"""
|
| 112 |
return html_code
|
|
|
|
| 22 |
a { color:#0f0; display:block; margin-top:1rem; }
|
| 23 |
</style>
|
| 24 |
</head>
|
|
|
|
| 25 |
|
|
|
|
| 26 |
|
|
|
|
|
|
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
</body>
|
| 30 |
|
|
|
|
| 84 |
<p>If the player doesn’t load, you can <a href="https://suno.com/song/c0cdb3ad-f49d-4125-8e16-4d7dd7924a02" target="_blank">click here to listen on Suno</a>.</p>
|
| 85 |
|
| 86 |
</body>
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
<body>
|
| 91 |
+
|
| 92 |
+
<h1>Suno Song → Direct MP3</h1>
|
| 93 |
+
|
| 94 |
+
<input id="songUrl" placeholder="Paste Suno song URL here" />
|
| 95 |
+
<button id="convertBtn">Convert to MP3</button>
|
| 96 |
+
|
| 97 |
+
<div id="result"></div>
|
| 98 |
+
|
| 99 |
+
<script>
|
| 100 |
+
document.getElementById("convertBtn").onclick = () => {
|
| 101 |
+
const url = document.getElementById("songUrl").value.trim();
|
| 102 |
+
const match = url.match(/suno\.com\/song\/([a-f0-9\-]+)/i);
|
| 103 |
+
if(match){
|
| 104 |
+
const uuid = match[1];
|
| 105 |
+
const mp3Url = `https://cdn1.suno.ai/${uuid}.mp3`;
|
| 106 |
+
document.getElementById("result").innerHTML = `
|
| 107 |
+
<p>Direct MP3 URL:</p>
|
| 108 |
+
<a href="${mp3Url}" download>Download MP3</a>
|
| 109 |
+
<audio controls src="${mp3Url}"></audio>
|
| 110 |
+
`;
|
| 111 |
+
} else {
|
| 112 |
+
document.getElementById("result").innerHTML = `<p style="color:red;">Invalid Suno URL!</p>`;
|
| 113 |
+
}
|
| 114 |
+
};
|
| 115 |
+
</script>
|
| 116 |
+
|
| 117 |
</html>
|
| 118 |
"""
|
| 119 |
return html_code
|