Soundgasm Downloader

Add a download link to Soundgasm.net links

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Soundgasm Downloader
// @namespace    https://github.com/RobertSagit/soundgasm-downloader
// @version      1.1
// @description  Add a download link to Soundgasm.net links
// @author       RobertSagit
// @match        http*://soundgasm.net/u/*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    function gendownload() {
        var audioplayer = document.getElementById("jp_audio_0");
        var description = document.getElementsByClassName("jp-description")[0];
        var title = document.getElementsByClassName("jp-title")[0].innerHTML.replace(/[^a-z0-9]/gi, '');

        // Debug code
        //console.log(`Audio source: ${audioplayer.src}`);

        description.innerHTML += `<br /><a href="${audioplayer.src}" download="${title}">Download File</a>`;
    }

    setTimeout(gendownload, 100);
})();