Soundgasm.net Downloader

This is a simple script that shows you a direct link to audio file that you want to download.

  1. // ==UserScript==
  2. // @name Soundgasm.net Downloader
  3. // @description This is a simple script that shows you a direct link to audio file that you want to download.
  4. // @license Creative Commons Zero v1.0 Universal
  5. // @supportURL https://github.com/q2p/Soundgasm-Link-Exporter
  6. // @author q2p
  7. // @namespace q2p
  8. // @version 0.5
  9. // @include http://soundgasm.net/u/*/*
  10. // @include https://soundgasm.net/u/*/*
  11. // @grant none
  12. // @run-at document-end
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17. window.addEventListener("load", () => {
  18. if (!document.getElementById("jquery_jplayer_1")) {
  19. return;
  20. }
  21. const interval = setInterval(() => {
  22. const src_el = document.getElementById("jp_audio_0");
  23. const title_el = document.getElementsByClassName("jp-title");
  24. if (src_el && title_el.length !== 0) {
  25. const src = src_el.src;
  26. const title = title_el[0].textContent;
  27. if (src && src.length > 4 && title) {
  28. clearInterval(interval);
  29. const link = document.createElement("a");
  30. link.href = src;
  31. link.download = title+".m4a";
  32. link.textContent = "Download Link";
  33. document.body.appendChild(link);
  34. }
  35. }
  36. }, 200);
  37. });
  38. })();