maxcine.net link shortener bypass

Redirects to URL the destination URL bypassing the link shorteners

  1. // ==UserScript==
  2. // @name maxcine.net link shortener bypass
  3. // @version 1.0
  4. // @description Redirects to URL the destination URL bypassing the link shorteners
  5. // @author Rust1667
  6. // @match https://links.cuevana.ac/short/*
  7. // @grant none
  8. // @namespace https://greasyfork.org/users/980489
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Find the line containing "document.getElementById('contador').href = 'htt"
  15. var lines = document.documentElement.innerHTML.split('\n');
  16. var targetLine = lines.find(line => line.includes("document.getElementById('contador').href = 'htt"));
  17.  
  18. if (targetLine) {
  19. // Extract the URL
  20. var startIndex = targetLine.indexOf("http");
  21. var endIndex = targetLine.indexOf("'", startIndex);
  22. var extractedUrl = targetLine.substring(startIndex, endIndex);
  23.  
  24. // Check if '?s=' exists in the URL
  25. if (extractedUrl.includes('?s=')) {
  26. var sIndex = extractedUrl.indexOf('?s=') + 3; // 3 is the length of '?s='
  27. extractedUrl = extractedUrl.substring(sIndex);
  28. }
  29.  
  30. // Redirect to the extracted URL
  31. window.location.href = extractedUrl;
  32. } else {
  33. console.log("Target line not found.");
  34. }
  35. })();