Audiobookcup Download

Replace fake audiobookcup download links with real download links. You must start playing audiobook first so it can load the file src.

  1. // ==UserScript==
  2. // @name Audiobookcup Download
  3. // @namespace http://hermanfassett.me
  4. // @version 0.1
  5. // @description Replace fake audiobookcup download links with real download links. You must start playing audiobook first so it can load the file src.
  6. // @author You
  7. // @match https://www.audiobookcup.com/*
  8. // @icon https://www.google.com/s2/favicons?domain=audiobookcup.com
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Replace fake download links with actual download
  16. [...document.querySelectorAll("a[href='https://www.audiobookmax.com']")].forEach((a) => {
  17. a.onclick = function() {
  18. const audio = document.querySelector("#fwdeapdiv0 audio");
  19. const title = document.querySelector("h1.entry-title").innerText || document.title;
  20.  
  21. if (audio && audio.src) {
  22. this.href = audio.src;
  23. this.download = `${title}.mp3`;
  24. this.removeAttribute("target");
  25. this.removeAttribute("rel");
  26. }
  27. }
  28. });
  29. })();