video countdown wait

video countdown wait|play click

2016/03/31のページです。最新版はこちら

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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;