PSSTAudio.com Downloader

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

当前为 2020-10-18 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name PSSTAudio.com 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.2
  7. // @include https://psstaudio.com/post/*
  8. // @grant none
  9. // @run-at document-end
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. const page_content = document.getElementsByClassName("page-content")[0];
  15. const card_body = page_content.getElementsByClassName("card-body")[0];
  16. const title = card_body.getElementsByClassName("card-title")[0].textContent;
  17. const description = card_body.getElementsByClassName("card-text")[0].textContent;
  18. const audio = card_body.getElementsByTagName("audio")[0];
  19. const audio_src = audio.firstElementChild.src;
  20.  
  21. const link_container = document.createElement("div");
  22. const link = document.createElement("a");
  23. link.href = audio_src;
  24. link.download = title+" "+description+".mp3";
  25. link.textContent = "Download Link";
  26. link_container.appendChild(link);
  27. card_body.appendChild(link_container);
  28. })();