verpeliculasonline.org subtituladas.com link shortener auto-bypass

Redirects to URL the destination URL bypassing the link shorteners

  1. // ==UserScript==
  2. // @name verpeliculasonline.org subtituladas.com link shortener auto-bypass
  3. // @version 1.2
  4. // @description Redirects to URL the destination URL bypassing the link shorteners
  5. // @author Rust1667
  6. // @match https://subtituladas.com/enlace/*
  7. // @match https://verpeliculasonline.org/enlace/*
  8. // @grant none
  9. // @namespace https://greasyfork.org/users/980489
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Find the URL within the <a> element
  16. var linkElement = document.getElementById('link');
  17. if (linkElement) {
  18. var linkUrl = linkElement.href;
  19.  
  20. // Check if '?s=' exists in the URL
  21. if (linkUrl.includes('?s=')) {
  22. var sIndex = linkUrl.indexOf('?s=') + 3; // 3 is the length of '?s='
  23. var extractedUrl = linkUrl.substring(sIndex);
  24.  
  25. // Redirect to the extracted URL
  26. window.location.href = extractedUrl;
  27.  
  28. //Stop the now useless timer
  29. window.setTimeout = function() {};
  30. window.setInterval = function() {};
  31. document.addEventListener = function() {};
  32.  
  33. } else {
  34. // Redirect to the full URL
  35. window.location.href = linkUrl;
  36. }
  37. } else {
  38. console.log("Link element not found.");
  39. }
  40. })();