Soundgasm.net Downloader

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

当前为 2020-05-22 提交的版本,查看 最新版本

  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. // @author q2p
  5. // @namespace q2p
  6. // @version 0.4
  7. // @include http://soundgasm.net/u/*/*
  8. // @include https://soundgasm.net/u/*/*
  9. // @grant none
  10. // @run-at document-end
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. window.addEventListener("load", () => {
  16. if (!document.getElementById("jquery_jplayer_1")) {
  17. return;
  18. }
  19. const interval = setInterval(() => {
  20. const src_el = document.getElementById("jp_audio_0");
  21. const title_el = document.getElementsByClassName("jp-title");
  22. if (src_el && title_el && title_el.length !== 0) {
  23. const src = src_el.src;
  24. const title = title_el[0].textContent;
  25. if (src && src.length > 4 && title) {
  26. clearInterval(interval);
  27. const link = document.createElement("a");
  28. link.href = src;
  29. link.download = title+".m4a";
  30. link.textContent = "Download Link";
  31. document.body.appendChild(link);
  32. }
  33. }
  34. }, 200);
  35. });
  36. })();