video countdown wait

video countdown wait|play click

2016-03-31 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name        video countdown wait
// @namespace   manobastardo
// @include     *vodlocker.com*
// @include     *gorillavid*
// @include     http://bestreams.net*
// @include     *thevideo*
// @include     *streamin*
// @include     *vidbull*
// @include     *daclips*
// @version     1
// @grant       none
// @description video countdown wait|play click
// ==/UserScript==

current_url = window.location.href;

var click_event = document.createEvent('MouseEvents');
click_event.initEvent('click', true, true);

function get_player(player) {
    if (typeof(jwplayer) === typeof(Function)) {
        return jwplayer()
    }
    return $(player);
}

function elements() {
    var values = {
        "button": "",
        "player": "",
        "wanted": "",
        "current": ""
    };

    if (current_url.indexOf("gorillavid") > -1) {
        values.button = $('#btn_download');
        values.player = get_player("#flvplayer");
        values.wanted = "continue";
        values.current = values.button.attr("value");
    } else if (current_url.indexOf("daclips") > -1) {
        values.button = $('#btn_download');
        values.player = get_player("#flvplayer");
        values.wanted = "continue";
        values.current = values.button.attr("value");
    } else if (current_url.indexOf("bestreams") > -1) {
        values.button = $('#btn_download');
        values.player = get_player("#flvplayer");
        values.wanted = "hidden";
        values.current = $("#countdown_str").css("visibility");
    } else if (current_url.indexOf("vodlocker") > -1) {
        values.button = $('#btn_download');
        values.player = get_player("#flvplayer");
        values.wanted = "hidden";
        values.current = $("#countdown_str").css("visibility");
    } else if (current_url.indexOf("thevideo") > -1) {
        values.button = $('#btn_download');
        values.player = get_player("#flvplayer");
        values.wanted = "proceed";
        values.current = values.button.text();
    } else if (current_url.indexOf("streamin") > -1) {
        values.button = $('#btn_download');
        values.player = get_player("#flvplayer");
        values.wanted = "hidden";
        values.current = $("#countdown_str").css("visibility");
    } else if (current_url.indexOf("vidbull") > -1) {
        values.button = $('#btn_download');
        values.player = get_player("#flvplayer");
        values.wanted = "block";
        values.current = $('#download_linkb').css("display");
    }

    return values
}

function is_player(player) {
    console.log("is_player");
    return player.length > 0 || typeof player === "object";
}

function is_button(button) {
    console.log("is_button");
    return button.length > 0;
}

function wait_button() {
    console.log("wait_button");
    check_button = setInterval(function () {
        var e = elements();
        if (e.current.toLowerCase().indexOf(e.wanted) > -1) {
            clearInterval(check_button);
            e.button[0].dispatchEvent(click_event);
            wait_player(e.player);
        } else {
            console.log("wait_button");
        }
    }, 111);
}


function play_player(player) {
    console.log("play_player");
    player.play();
    player[0].play();
    jwplayer().play();
}

function wait_player(player) {
    console.log("wait_player");
    check_video = setInterval(function () {
        if (is_player(player)) {
            clearInterval(check_video);
            play_player(player);
        } else {
            console.log("wait_player");
        }
    }, 111);
}

function wait_check() {
    console.log("wait_check");
    var e = elements();
    if (is_button(e.button)) {
        wait_button();
    } else {
        wait_player(e.player);
    }
}

console.log("wait");
window.onload = wait_check;