Lyrics into Song Dowloader

Let's you download your AI songs without a paid subscription!

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Lyrics into Song Dowloader
// @namespace    LyricsintoSongDownloader
// @version      1.0
// @description  Let's you download your AI songs without a paid subscription!
// @author       Runterya
// @homepage     https://github.com/Runteryaa
// @match        *://lyricsintosong.com/play_music/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=lyricsintosong.com
// @grant        GM_download
// @license      MIT
// @compatible   chrome
// @compatible   edge
// @compatible   firefox
// @compatible   opera
// @compatible   safari
// ==/UserScript==

console.log("LyricsintoSongDownloader");


// Function to create the download button
function createDownloadButton(audio) {
    const downloadButton = document.createElement('a');
    downloadButton.textContent = 'Download';
    downloadButton.style.marginTop = '10px';
    downloadButton.style.display = 'inline-block';
    downloadButton.style.padding = '5px 10px';
    downloadButton.style.backgroundColor = '#4CAF50';
    downloadButton.style.color = 'white';
    downloadButton.style.cursor = 'pointer';
    downloadButton.style.textDecoration = 'none';
    downloadButton.style.borderRadius = '5px';
    downloadButton.textContent = 'LyricsintoSongDownloader';
    downloadButton.style.marginTop = '10px';

    // Add event listener to download the audio file
    downloadButton.addEventListener('click', () => {
        const audioSource = audio.src || audio.querySelector('source')?.src;
        if (audioSource) {
            GM_download(audioSource, audioSource.split('/').pop());
        }
    });

    // Append the button to the parent of the audio element
    audio.parentElement.appendChild(downloadButton);
}

// Find all audio elements on the page
const audioElements = document.querySelectorAll('audio');

// Create download buttons for each audio element
audioElements.forEach(audio => {
    createDownloadButton(audio);
});