Greasy Fork is available in English.

SkipperScript

It should be able to skip and autoskip intos

2019-06-24 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला 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         SkipperScript
// @version      0.1
// @match        ://stream.proxer.me/*
// @description  It should be able to skip and autoskip intos
// @author       Schlauewurst
// @require      http://code.jquery.com/jquery-3.4.1.min.js
// @namespace https://greasyfork.org/users/312840
// ==/UserScript==
/*TODO
Add Database
Add compatibly to other players
Skip Flashbacks
Skip Filler
Parse all the Info from somewhere
*/

(function() {
    'use strict';
    function getCoockies(){

    }

    var createCookie = function(name, value, days=365) {
        var expires;
        if (days) {
            var date = new Date();
            date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
            expires = "; expires=" + date.toGMTString();
        }
        else {
            expires = "";
        }
        document.cookie = name + "=" + value + expires + "; path=/";
    }

    function getCookie(c_name) {
        if (document.cookie.length > 0) {
            let c_start = document.cookie.indexOf(c_name + "=");
            if (c_start != -1) {
                c_start = c_start + c_name.length + 1;
                let c_end = document.cookie.indexOf(";", c_start);
                if (c_end == -1) {
                    c_end = document.cookie.length;
                }
                return unescape(document.cookie.substring(c_start, c_end));
            }
        }
        return "";
    }

    function loadSettings(){
        if(getCookie("show") == "false"){
            $("#hidebtn").text("Show");
            $("#buttonlist").hide();
        }
        if(getCookie("autoplay") == "true"){
            $("#autoplay").find("input").prop('checked', true);
        }
        if(getCookie("skipintro") == "true"){
            $("#skipintro").find("input").first().prop('checked', true);
        }
        if(getCookie("skipoutro") == "true"){
            $("#skipoutro").find("input").first().prop('checked', true);
        }
        if (!getCookie("outrostart") == ""){
         $("#skipoutro input").eq(1).val(getCookie("outrostart"));
        }
        if (!getCookie("introstart") == ""){
            $("#skipintro input").eq(1).val(getCookie("introstart"))
        }
        if (!getCookie("introend") == ""){
            $("#skipintro input").eq(2).val(getCookie("introend"))
        }
    }

    function makeButtons(){
        $("#psplayercontrols").append(" <button id='hidebtn'>Hide</button><span id='buttonlist'>")
        $("#buttonlist").append(" | <span id='autoplay'><label for='autoplay'>Autoplay</label><input name='autoplay' type='checkbox'></input></span>");
        $("#buttonlist").append(" | <span id='skipintro'><label for='skipintro'>Skip Intro</label><input name='skipintro' type='checkbox'></input><input class='start' style='width:30px' value='0' type='text'></input><input class='end' style='width:30px' value='100' type='text'></input></span>");
        $("#buttonlist").append(" | <span id='skipoutro'><label for='skipoutro'>Skip Outro</label><input name='skipoutro' type='checkbox'></input><input style='width:30px' value='1300' type='text'</span>");
        $("#psplayercontrols").append("</span>");
    }

    function startTimer(){
        setInterval(function(){
            let skipstart = $("#skipintro input").eq(1).val(),
                skipend = $("#skipintro input").eq(2).val(),
                skip1 = $("#skipintro input").is(":checked"),
                skip2 = $("#skipoutro input").is(":checked"),
                skipoutro = $("#skipoutro input").eq(1).val();

            if(skip1 && player.currentTime > skipstart && player.currentTime < skipend){
                player.currentTime = parseInt(skipend);
            }
            if(skip2 && player.currentTime>skipoutro){
                var url = new URL(window.location.href).searchParams.get("ref");
                url = url.split("/")
                window.top.location.href="https://proxer.me/watch/"+url[2]+"/"+(parseInt(url[3])+1)+"/"+url[4]
            }
        }, 1000);
    }

    $(document).ready(function(){
        makeButtons();
        loadSettings();

        if(player.ready && $("#autoplay").find("input").is(":checked")){
            player.play()
        }

        startTimer();

        $(document).on("click","#hidebtn",function(){
            if($(this).text()=="Hide"){
                $(this).text("Show");
                $("#buttonlist").hide();
                createCookie("show",false);
            }else{
                $(this).text("Hide");
                $("#buttonlist").show();
                createCookie("show",true);
            }
        })

        $(document).on("click","#autoplay",function(){
            let autoplay = $(this).find("input").is(":checked")
            createCookie("autoplay",autoplay);
        })

        $(document).on("click","#skipintro",function(){
            let skipintro = $(this).find("input").first().is(":checked")
            createCookie("skipintro",skipintro);
        })

        $(document).on("click","#skipoutro",function(){
            let skipoutro = $(this).find("input").first().is(":checked")
            createCookie("skipoutro",skipoutro);
        })

        $(document).on("change","#skipoutro input",function(){
            createCookie("outrostart",$(this).val());
        })

        $(document).on("change","#skipintro",function(){
            createCookie("introstart",$(this).find(".start").val());
            createCookie("introend",$(this).find(".end").val());
        })
    })

})();