Voe.sx video redirector

Redirect to link for Voe.sx videos

目前為 2020-12-02 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Voe.sx video redirector
// @namespace    https://tribbe.de
// @version      1.0.4
// @description  Redirect to link for Voe.sx videos
// @author       Tribbe
// @match        https://voe.sx/*
// @match        https://*.voe-network.net/*
// @require      https://greasyfork.org/scripts/6250-waitforkeyelements/code/waitForKeyElements.js?version=23756
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
// @grant        GM.xmlHttpRequest
// ==/UserScript==

waitForKeyElements (
	"#voe-player_html5_api",
	tribbe
);

waitForKeyElements (
	".plyr__video-wrapper",
	tribbe_wrapper
);

waitForKeyElements (
	"video[name*='media']",
	tribbe_autostop
);

function tribbe (jNode) {
    if(jNode[0].src && jNode[0].src.includes(".mp4")) {
        window.location.href = jNode[0].src;
    }
    else if (jNode[0].currentSrc && jNode[0].currentSrc.includes(".mp4")) {
        window.location.href = jNode[0].currentSrc;
    }
}

function tribbe_wrapper (jNode) {
    if(jNode[0].childNodes.length > 0) {
        var video = jNode[0].childNodes[0];
        if(video.localName == "video" && video.currentSrc.includes(".mp4")) {
            window.location.href = video.currentSrc;
        }
    }
}

function tribbe_autostop (jNode) {
    jNode[0].autoplay = false;
}