librospdfgratismundo.net replace link shorteners

Replace link shorteners with true download links

  1. // ==UserScript==
  2. // @name librospdfgratismundo.net replace link shorteners
  3. // @version 1.0
  4. // @description Replace link shorteners with true download links
  5. // @author Rust1667
  6. // @match https://librospdfgratismundo.net/*
  7. // @grant none
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=librospdfgratismundo.net
  9. // @namespace https://greasyfork.org/users/980489
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Select all <a> elements with class "btn" and iterate over them
  16. document.querySelectorAll('a.btn').forEach(function(link) {
  17. // Check if the href attribute contains "librospdfgratismundo.net"
  18. if (link.href.includes('librospdfgratismundo.net')) {
  19. // Extract the URL after the "?url=" substring
  20. let encodedUrl = link.href.split('?url=')[1];
  21. // Decode the URL from base64
  22. let decodedUrl = atob(encodedUrl);
  23. // Update the href attribute with the decoded URL
  24. link.href = decodedUrl;
  25. }
  26. });
  27. })();