maxcine.net link shortener bypass

Redirects to URL the destination URL bypassing the link shorteners

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         maxcine.net link shortener bypass
// @version      1.0
// @description  Redirects to URL the destination URL bypassing the link shorteners
// @author       Rust1667
// @match        https://links.cuevana.ac/short/*
// @grant        none
// @namespace https://greasyfork.org/users/980489
// ==/UserScript==

(function() {
    'use strict';

    // Find the line containing "document.getElementById('contador').href = 'htt"
    var lines = document.documentElement.innerHTML.split('\n');
    var targetLine = lines.find(line => line.includes("document.getElementById('contador').href = 'htt"));

    if (targetLine) {
        // Extract the URL
        var startIndex = targetLine.indexOf("http");
        var endIndex = targetLine.indexOf("'", startIndex);
        var extractedUrl = targetLine.substring(startIndex, endIndex);

        // Check if '?s=' exists in the URL
        if (extractedUrl.includes('?s=')) {
            var sIndex = extractedUrl.indexOf('?s=') + 3; // 3 is the length of '?s='
            extractedUrl = extractedUrl.substring(sIndex);
        }

        // Redirect to the extracted URL
        window.location.href = extractedUrl;
    } else {
        console.log("Target line not found.");
    }
})();