Lyrics into Song Dowloader

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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);
});