reRedirector

Redirect streaming links directly to source

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         reRedirector
// @namespace    https://tribbe.de
// @version      1.0.0
// @description  Redirect streaming links directly to source
// @author       Tribbe (rePublic Studios)
// @license      MIT
//
// @include      *://*voe*
//
// @include      *streamtape.*/get_video?*
// @include      *streamtape.*/e/*
// @include      *strcloud.*
// @include      *tapecontent.*
// @include      *strtape.*
// @include      *strtpe.*
// @include      *stape.*
// @include      *adblockstrtech.*
//
// @include      *vidoza.net*
//
// @include      *://streamz.ws*
// @include      *://streamzz.to*
//
// @include      *://evoload*
// ==/UserScript==

window.addEventListener("load", doSearch);

async function doSearch() {
  var checkIsVideoNode = await document.querySelectorAll(
    "body>video[data-better-html5-video-type]>source[type*='video/mp4'][src]"
  );
  if (checkIsVideoNode == null || checkIsVideoNode.length == 0) {
    var content = document.body.textContent;
    var video = null;
    var videoNode = null;

    //VOE
    if (document.location.hostname.includes("voe")) {
      var mp4finder = null;
      mp4finder = content.match(/(https?.*?\.mp4)/);
      if (mp4finder != null) video = mp4finder[0];

      if (video == null) {
        mp4finder = content.match(/sources\[\"mp4\"\] = .*?\(\[(.*?)]\);/);
        if (mp4finder != null && mp4finder.length == 2) {
          var mp4array = mp4finder[1].replaceAll("'", "").split(",");
          var p01 = mp4array.join("").split("").reverse().join("");
          video = atob(p01);
        }
      }
    }

    //Streamtape
    if (
      document.location.hostname.includes("streamtape") ||
      document.location.hostname.includes("str") ||
      document.location.hostname.includes("tapecontent") ||
      document.location.hostname.includes("stape") ||
      document.location.hostname.includes("adblockstrtech")
    ) {
      videoNode = await document.querySelectorAll("div[id*='link']");
      var bFound = false;
      for (const link of Object.values(videoNode)) {
        var url = "https:" + link.textContent;
        if (
          !bFound &&
          url.includes(document.location.hostname + "/get_video?id=")
        ) {
          bFound = true;
          video = url;
        }
      }
    }

    //Vidoza
    if (document.location.hostname.includes("vidoza.net")) {
      videoNode = await document.querySelectorAll(
        "video[id*='player_html5_api'][class*='vjs-tech']>source[type*='video/mp4'][src]"
      );
      if (videoNode.length > 0) {
        video = videoNode[0].getAttribute("src");
      }
    }

    //StreamZ
    if (
      document.location.hostname.includes("streamz.ws") ||
      document.location.hostname.includes("streamzz.to")
    ) {
      videoNode = await document.querySelectorAll(
        "video[id*='video_1_html5_api']"
      );
      if (videoNode.length > 0) {
        video = videoNode[0].getAttribute("src");
      }
    }

    //Evoload
    if (document.location.hostname.includes("evoload")) {
      videoNode = await document.querySelectorAll(
        "video[id*='EvoVid_html5_api']"
      );
      if (videoNode.length > 0) {
        video = videoNode[0].getAttribute("src");
      }
    }

    if (video != null) window.location.href = video;
    else {
      await new Promise((resolve) => setTimeout(resolve, 500));
      await doSearch();
    }
    return;
  }

  //disable autoplay
  checkIsVideoNode[0].parentNode.autoplay = false;
}