Greasy Fork is available in English.

Suno.ai Link Converter

Convert Suno.ai links to direct audio links

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name         Suno.ai Link Converter
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Convert Suno.ai links to direct audio links
// @author       w4t3r1ily
// @match        *://*/*
// @include      *
// @grant        none
// @icon         https://www.google.com/s2/favicons?sz=64&domain=suno.ai

// ==/UserScript==

(function() {
    'use strict';

    // Add the desired domain to be replaced
    const originalDomain = 'https://app.suno.ai/song/';
    const newDomain = 'https://cdn1.suno.ai/';

    // Select all links on the page
    document.querySelectorAll('a').forEach(link => {
        // Check if the link contains the original domain
        if (link.href.includes(originalDomain)) {
            // Extract the unique identifier from the original link
            const identifier = link.href.split(originalDomain)[1].replace('/', '');

            // Create a new link element for the rewritten link
            const newLink = document.createElement('a');
            newLink.href = newDomain + identifier + '.mp3';
            newLink.innerText = ' ' + newLink.href;

            // Insert the new link under the original one
            link.parentNode.insertBefore(newLink, link.nextSibling);
        }
    });
})();