NADAmobile Automator

Automate watching NADA and related sites

当前为 2016-11-24 提交的版本,查看 最新版本

// ==UserScript==
// @name           NADAmobile Automator
// @description    Automate watching NADA and related sites
// @author         free21
// @include        http://www.nadamobile.com/watch*
// @include        http://*nadamovietrailers.com*
// @include        http://*fameapp.io*
// @include        http://*catscatscats.co*
// @include        http://*local21.news*
// @include	 https://www.nadamobile.com/profile
// @grant        GM_getValue
// @grant        GM_setValue
// @version        1.2.1
// @require     http://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js
// @namespace https://gf.qytechs.cn/users/57063
// ==/UserScript==

function getRandomArbitrary(min, max) {
    return Math.random() * (max - min) + min;
}
window.addEventListener('load', function() {
    var diffSites = GM_getValue('diffSites', 'yes');
    var randomSite = ['http://www.nadamobile.com/watch','http://fast.fameapp.io/','http://www.nadamovietrailers.com/','http://local21.news','http://catscatscats.co'][Math.floor(Math.random() * 5)];
    var timeto = getRandomArbitrary(1000, 10000);

    //for nadamobile.com
    if (document.location.href.indexOf('nadamobile.com/watch') > -1) {
        setTimeout(function() {
            if ($( ".player--hold > div" ).hasClass("vjs-has-started") === false) {
                $('#new--player video')[0].play();
            }
        }, 3000);
        $('.player--hold video').bind('timeupdate', function() {
            if (this.currentTime > 1.5 && this.currentTime < 2) {
                console.log('time is long enough');
                this.currentTime = this.duration - 0.5;
            }
        });
        $('.player--hold video').bind('ended', function() {
            if ($('.after-video').is(":visible") === true) {
                setTimeout(function() {
                    if (diffSites == 'yes') {
                        window.location = randomSite;
                    }
                    else {
                        location.reload();
                    }
                }, timeto);
            }
        });
        if (diffSites == 'yes') {
            $(".before-video").on('DOMSubtreeModified', function() {
                if ($(".before-video a").attr("href") == '/watch') {
                    setTimeout(function() {
                        window.location = randomSite;
                    }, 500);
                }
            });
        }
    }





    //for the other sites
    function playIt() {
        console.log('is it playing?');
        if ($( "#trailerplayer" ).hasClass("vjs-has-started") === false) {
            $('#trailerplayer video')[0].play(); console.log('nope. try to play it.'); }
    }
    setTimeout(playIt, 1500);
    setTimeout(playIt, 10500);
    $('#trailerplayer video').bind('timeupdate', function() {
        if (this.currentTime > 0.5 && this.currentTime < 2) {
            console.log('time is long enough');
            this.currentTime = this.duration - 0.5;
        }
    });
    $('#trailerplayer video').bind('ended', function() {
        setTimeout(function() {
            if (diffSites == 'yes') {
                window.location = randomSite;
            }
            else {
                location.reload();
            }
        }, timeto);
    });
    if (diffSites == 'yes') {
        $("#loader").on('DOMSubtreeModified', function() {
            if ($("#loader div").css('color') !== undefined) {
                setTimeout(function() {
                    window.location = randomSite;
                }, 500);
            }
        });
    }

    //sometimes run into this server error, so i just wait and reload to break out of it
    if ($('title')[0].text == "Application Error") {
        setTimeout(function() {
            location.reload();
        }, 10000);
    }

    //in case things go really sideways, just force a reload if it has been too long without anything
    setTimeout(function() {
        location.reload();
    }, 300000);

    //setup the settings panel
    if (document.location == 'https://www.nadamobile.com/profile') {
        $('<div id="autom8">Loading...</div>').insertBefore(
            '.referrals');
        $('#autom8').css('background-color', '#d83a3d');
        $('#autom8').css('font-size', '1.4em');
        $('#autom8').css('width', '450px');
        $('#autom8').css('padding', '15px');
        $('#autom8').css('margin-left', 'auto');
        $('#autom8').css('color', 'white');
        $('#autom8').css('margin-right', 'auto');
        $('#autom8').html(
            '<h3>autom8 settings:</h3><br /><input type="checkbox" id="diffsites"> Navigate between different sites. <br/> <span style="font-size:0.8em">After each success or fail, it will choose another site at random. (This helps avoid their fraud systems)</span>'
        );
        if (diffSites == 'yes') {
            $("#diffsites").prop('checked', true);
        }
        $("#diffsites").change(function() {
            if (this.checked) {
                GM_setValue('diffSites', 'yes');
                console.log("set value!");
            } else {
                GM_setValue('diffSites', 'no');
            }
        });
    }
}, false);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址