動畫瘋·Plus

分級標識自動同意、跳過廣告、分級鎖定、影片空降座標、網頁全螢幕

目前为 2018-08-27 提交的版本。查看 最新版本

// ==UserScript==
// @name         動畫瘋·Plus
// @namespace    none
// @version      1.12.6
// @description  分級標識自動同意、跳過廣告、分級鎖定、影片空降座標、網頁全螢幕
// @author       xu3u04u48
// @match        *://ani.gamer.com.tw/animeVideo.php?sn=*
// @grant        none
// @icon         https://i2.bahamut.com.tw/anime/baha_s.png
// @require      https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js
// ==/UserScript==


$('.sub_top').append('<div class="ani-tabs__item"><a href="#ani_tab_content-3" class="ani-tabs-link">動畫瘋·Plus設定</a></div>');
$('.ani-tab-content').append('<div id="ani-tab-content-3" class="ani-tab-content__item" style="display: none;"></div>');

$('a[href="#ani_tab_content-3"]').click(function(){
    $(".ani-tab-content__item").css("display","none");
    $("#ani-tab-content-3").css("display","block");
    $('.ani-tabs-link').removeClass('is-active');
    $(this).addClass("is-active");
});


$('head').append(`
<style>
.plus_bullet-send {
padding:0 5px 0 5px;
width:20%;
z-index:1;
border-radius:5px;
cursor:all-scroll;
}
.plus_bullet-control {
left:unset;
right:0;
z-index:1;
height:100%;
}

.plus_bullet-send_icon {
width: 42px;
height: 40px;
float: right;
padding: 6px 8px;
}

.plus_bullet-send_icon:before {
content: "textsms";
}

.plus_bullet-send_icon:before {
font-size: 26px;
direction: ltr;
display: inline-block;
font-family: 'Material Icons';
font-style: normal;
font-weight: normal;
letter-spacing: normal;
line-height: 1;
text-transform: none;
white-space: nowrap;
word-wrap: normal;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
-webkit-font-feature-settings: 'liga';
font-feature-settings: 'liga';
}

.plus_bullet-send_icon:hover{
color: #00B4D8;
}

.plus_bullet-send_icon span {
display: none
}


.plus_bullet-send_icon:hover span {
height: 22px;
position: absolute;
padding: 5px;
top: -35px;
text-decoration: none;
display: block;
background-color: #000000ed;
color: #ffffffd6;
border-radius: 5px;
}


.plus_Web_fullscreen_icon {
width: 42px;
height: 40px;
float: right;
padding: 6px 8px;
}

.plus_Web_fullscreen_icon:before {
content: "aspect_ratio";
}

.plus_Web_fullscreen_icon:before {
font-size: 26px;
direction: ltr;
display: inline-block;
font-family: 'Material Icons';
font-style: normal;
font-weight: normal;
letter-spacing: normal;
line-height: 1;
text-transform: none;
white-space: nowrap;
word-wrap: normal;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
-webkit-font-feature-settings: 'liga';
font-feature-settings: 'liga';
}

.plus_Web_fullscreen_icon:hover{
color: #00B4D8 !important;
}

.plus_Web_fullscreen_icon span {
display: none
}

.plus_Web_fullscreen_icon:hover span {
height: 22px;
position: absolute;
padding: 5px;
top: -35px;
text-decoration: none;
display: block;
background-color: #000000ed;
color: #ffffffd6;
border-radius: 5px;
}

.plus_time_body{
width: 100%;
padding: 8px;
min-height: 175px;
border: 1px solid #ddd;
background: #f5f5f5;
border-radius: 4px;
box-sizing: border-box;
}

.plus_keyword-label {
display: inline-flex;
align-items: center;
max-width: 100%;
margin: 0 4px 4px 0;
background: #02B4D8;
font-size: 13px;
color: #fff;
border-radius: 4px;
cursor: no-drop;
}

.plus_keyword-label > span {
display: block;
padding: 3px 6px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
vertical-align: middle;
}

.plus_no_sub {
text-align: center;
line-height: 1.5em;
color: #888;
}

button.plus_refresh {
float: none;
margin: 0;
padding: 0;
height: 30px;
width: 30px;
border: 1px solid #ccc;
background: #eee;
font-size: 18px;
border-radius: 5px;
cursor: pointer;
outline: none;
}


.ani-tab-content__item .plus_refresh  {
width: 30px;
height: 30px;
border: 1px solid #00B4D8;
background: #00B4D8;
color: #fff;
}

.ani-tab-content__item .plus_refresh:hover {
background: #FFF049;
border-color: #FFF049;
color: #333;
}

.plus_material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 21px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}

.ani-tab-content__item .plus_refresh > i {
vertical-align: middle;
}
</style>
`);


//實體化使用者介面
$("#ani-tab-content-3").prepend(`
<div class=\"ani-setting-section\">
<h4 class=\"ani-setting-title\">動畫瘋·Plus</h4>
<!--<div class="ani-setting-item ani-flex">
<div class="ani-setting-label">
<span class="ani-setting-label__mian">彈幕字型</span>
</div>
<div class="ani-setting-value ani-set-flex-right">
<div class="ani-checkbox">
<select id="font" class="ani-select">
<option value ="unset">默認</option>
<option value ="Microsoft JhengHei">微軟正黑體</option>
<option value ="Microsoft Yahei">微軟雅黑體</option>
<option value ="DFKai-sb">標楷體</option>
<option value ="Simsun">Simsun</option>
<option value ="sans-serif">sans-serif</option>
<option value ="STHeitiTC-Light">STHeitiTC-Light</option>
<option value ="MS Mincho">MS Mincho</option>
<option value ="Meiryo">Meiryo</option>
<option value ="Arial">Arial</option>
</select>
</div>
</div>
</div>-->
<div class="ani-setting-item ani-flex">
<div class="ani-setting-label">
<span class="ani-setting-label__mian">自動同意分級標識警告</span>
</div>
<div class="ani-setting-value ani-set-flex-right">
<div class="ani-checkbox">
<label class="ani-checkbox__label">
<input id="grading" type="checkbox">
<div class="ani-checkbox__button"></div>
</label>
</div>
</div>
</div>
<div class="ani-setting-item ani-flex">
<div class="ani-setting-label">
<span class="ani-setting-label__mian">跳過動畫瘋廣告</span>
</div>
<div class="ani-setting-value ani-set-flex-right">
<div class="ani-checkbox">
<label class="ani-checkbox__label">
<input id="advertising" type="checkbox">
<div class="ani-checkbox__button"></div>
</label>
</div>
</div>
</div>
<div class="ani-setting-item ani-flex">
<div class="ani-setting-label">
<span class="ani-setting-label__mian">影片加速</span>
</div>
<div class="ani-setting-value ani-set-flex-right">
<div class="ani-checkbox">
<label class="ani-checkbox__label">
<input id="acceleration" type="checkbox">
<div class="ani-checkbox__button"></div>
</label>
</div>
</div>
</div>
<div class="ani-setting-item ani-flex">
<div class="ani-setting-label">
<span id="plus-setting-label__mian" class="ani-setting-label__mian">分級鎖定</span>
</div>
<div id="plus-value" class="ani-setting-value ani-set-flex-right">
<div class="plus-keyword-header">
<input type="password" id="plus-password" class="plus-input ani-input--keyword" placeholder="首次使用須設定密碼">
<a id="plus-password-setup" href="#" role="button" class="plus-bluebtn" >設定</a>
</div>
</div>
<div id="plus-value2" class="ani-setting-value ani-set-flex-right" style="display:none">
<div class="plus-keyword-header">
<input type="password" id="plus-password2" class="plus-input ani-input--keyword" placeholder="輸入密碼">
<a id="plus-password-enter-setup" href="#" role="button" class="plus-bluebtn" >確定</a>
</div>
</div>
<div id="ncc-password" class="ani-setting-value ani-set-flex-right" style="display:none">
<div class="ani-checkbox">
<select id="grading-password" class="ani-select">
<option value ="none">無</option>
<option value ="6">保護級(含·以上)</option>
<option value ="12">補12級(含·以上)</option>
<option value ="15">補15級(含·以上)</option>
<option value ="18">限制級</option>
</select>
</div>
</div>
</div>
<div class="ani-setting-item ani-flex">
<div class="ani-setting-label">
<span class="ani-setting-label__mian">空降座標</span>
</div>
<div class="ani-setting-value ani-set-flex-right">
<div class="plus-keyword-header">
<input type="text" id="plus-video-fastforward-minute" class="plus-video-fastforward ani-input--keyword" disabled placeholder="00" onKeypress="if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;">:
<input type="text" id="plus-video-fastforward-second" class="plus-video-fastforward ani-input--keyword" disabled placeholder="00" onKeypress="if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;">
<input id="plus-video-fastforward-sendout" class="plus-bluebtn" value="降落" disabled type="submit" style="border:2px blue none;">
</div>
</div>
</div>
<div class="ani-setting-item">
<div class="ani-setting-label">
<span class="ani-setting-label__mian">空降足跡<font size="2"> (點擊降落)</font></span>
<button class="plus_refresh"><i class="plus_material-icons">refresh</i></button>
</div>
<div class="plus_time_body"><ul class="plus_no_sub"><img src="https://i2.bahamut.com.tw/anime/no_sub.png"style="width: 35%;"><br>目前沒有人嘗試空降!<br>發個彈幕報告空降座標吧!</ul></div>
</div>

`);
$('.video').append(`
<div class="plus-frame">
<div class="plus-message">
<div class="plus-box">
<input type="password" id="plus-password3"  class="plus-input plus-input--keyword" placeholder="輸入密碼解除鎖定">
<a id="plus-password-enter" href="#" role="button" class="pluss-bluebtn" >確定</a>
</div>
</div>
</div>
`);

$('head').append(`
<style>
.ani-select {
display: inline-block;
padding: 0 8px;
height: 30px;
border: 1px solid #ddd;
box-sizing: border-box;
border-radius: 4px;
font-size: 16px;
vertical-align: middle;
}
.plus-keyword-header {
display: flex;

}
.plus-keyword-header .plus-bluebtn {
flex: 0 0 auto;
position: relative;
display: inline-block;
padding: 6px 12px;
font-size: 13px;
border-radius: 4px;
vertical-align: middle;
}
.plus-bluebtn {
border-radius: 10px;
padding: 12px;
text-align: center;
text-decoration: none;
color: #fff;
background: #00B4D8;
display: inline-block;
font-size: 1.3em;
}
.plus-input {
display: inline-block;
margin: 0 8px 0 0;
padding: 0 8px;
height: 30px;
border: 1px solid #ddd;
box-sizing: border-box;
border-radius: 4px;
font-size: 16px;
vertical-align: middle;
width: 165px;
}
.plus-message {
z-index: 1000;
top: 310px;
width: 100%;
height: 538px;
padding: 10px;
background: #000000cf;
box-shadow: 0 0 5px 0px rgba(0, 0, 0, 0.2);
left: 0px !important;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
}
.plus-frame {
position: relative;
z-index: 72;
}
.pluss-bluebtn{
width: 55px;
height: 30px;
padding: 10px 12px;
font-size: 13px;
border-radius: 4px;
vertical-align: middle;
text-align: center;
text-decoration: none;
color: #fff;
background: #00B4D8;
}
.plus-box {
height: 100px;
background: #fff;
width: 415px;
display: flex;
justify-content: center;
align-items: center;
border-radius: 4px;
}

.plus-input.plus-input--keyword {
max-width: 300px;
margin: 0px 8px 0px 8px;
}


.plus-video-fastforward {
display: inline-block;
margin: 0 8px 0 0;
padding: 0 8px;
height: 30px;
border: 1px solid #ddd;
box-sizing: border-box;
border-radius: 4px;
font-size: 16px;
vertical-align: middle;
width: 71px;
}

</style>
`);

/*
$('head').append(`
<style>
.cmt {
font-family: unset !important;
}
</style>
`);
$(".cmt").addClass("cmt");
*/



$(function (){

    var Switch = true;
    window.qtimer = setInterval(function(){
        if($(".R18").length == 0 && $(".plus-frame").length == 0){
            $(".vjs-fullscreen-control").after('<label><div class="plus_Web_fullscreen_icon" id="plus_Web_fullscreen" title="網頁全螢幕"><span>網頁全螢幕</span><input type="button" id="Web_fullscreen" style="display: none;" value="網頁全螢幕"></div></label>');
            clearInterval(window.qtimer);
        }

        $("#Web_fullscreen").click(function(){
            if(Switch){
                Switch = false;
                var win_height = $(window).height();
                var win_width = $(window).width();
                $("body").after('<div id="Web_fullscreen_style"></div>');
                $("#animeTip").css("bottom","-40px");
                $("html").css("overflow-y","hidden");
                $("html").css("overflow-x","hidden");
                $(".vjs-indent-button").css("display","none");
                $(".plus_Web_fullscreen_icon").css("color","#fff");
                $(".plus_Web_fullscreen_icon").css("background","#333");
            }else{
                Switch = true;
                $("#Web_fullscreen_style").remove();
                $("#animeTip").css("bottom","0px");
                $("html").css("overflow-y","unset");
                $("html").css("overflow-x","unset");
                $(".videoframe").css("height","");
                $(".videoframe").css("width","");
                $(".videoframe").css("margin","");
                $(".vjs-indent-button").css("display","unset");
                $(".plus_Web_fullscreen_icon").css("color","");
                $(".plus_Web_fullscreen_icon").css("background","");
                $(".vjs-danmu").css("perspective","");
            }

            $(document).keydown(function(e) {
                if(e.keyCode == 27 && !Switch){
                    Switch = true;
                    $("#Web_fullscreen_style").remove();
                    $("#animeTip").css("bottom","0px");
                    $("html").css("overflow-y","unset");
                    $("html").css("overflow-x","unset");
                    $(".videoframe").css("height","");
                    $(".videoframe").css("width","");
                    $(".videoframe").css("margin","");
                    $(".vjs-indent-button").css("display","unset");
                    $(".plus_Web_fullscreen_icon").css("color","");
                    $(".plus_Web_fullscreen_icon").css("background","");
                    $(".vjs-danmu").css("perspective","");
                }
            });


            $(window).resize(function() {
                if(!Switch){
                    var win_height = $(window).height();
                    $(".videoframe").css("height",(win_height-40)+"px");
                }
            });


            $('#Web_fullscreen_style').append(`
<style>


.container-player {
max-width: unset !important;

}

.player {
padding-top: 0 !important;
margin-top: 0 !important;
z-index: 999 !important;
position: fixed !important;
}

.videoframe {
width: 100% !important;
height: `+(win_height-40)+`px;
margin: auto !important;
}


.video {
width: 100% !important;
height: 100% !important;
position: unset !important;
padding-bottom: unset !important;
}

.BH_background {
margin-top: unset !important;
position: relative position: fixed
}

@media (min-width: 1000px)
.BH_background {
margin-top: unset !important;
}

.sky {
display: none !important;
}

.mainmenu {
display: none !important;
}

.subtitle {
display: none !important;
}

</style>
`);
        });
    },2000);


    var ncc_warning_save = localStorage.getItem("ncc_warning");
    var ad_skip_save = localStorage.getItem('ad_skip');
    //var acceleration_save = localStorage.getItem('acceleration');
    var font_save = localStorage.getItem('font');
    var password_save = localStorage.getItem('password_save');
    var grading_save = localStorage.getItem('grading_save');

    if(ncc_warning_save == null){ncc_warning_save = localStorage.setItem('ncc_warning','false');}
    if(ad_skip_save == null){ad_skip_save = localStorage.setItem('ad_skip','false');}
    if(font_save == null){font_save = localStorage.setItem('font','unset');}
    if(grading_save == null){grading_save = localStorage.setItem('grading_save','none');}
    //if(acceleration_save == null){acceleration_save = localStorage.setItem('acceleration','false');}

    if(password_save != null  ){
        $("#plus-value").remove();
        $("#plus-value2").css("display",'');
    }

    if(grading_save == null){
        $(".plus-frame").remove();
    }

    var grading_selected = $('#grading-password').val(grading_save);
    var grading =  $("#grading-password").find(":selected").val();

    if($('#grading-password').val() != "none"){
        var rating_img = $(".rating > img").attr("src");
        var rating_img_cut = rating_img.substr(30);
        switch (grading_save) {
            case '6':
                if(rating_img_cut == "TW-ALL.gif"){
                    $(".plus-frame").remove();
                }
                break;
            case '12':
                if(rating_img_cut == "TW-ALL.gif" || rating_img_cut == "TW-6TO12.gif"){
                    $(".plus-frame").remove();
                }
                break;
            case '15':
                if(rating_img_cut == "TW-ALL.gif" || rating_img_cut == "TW-6TO12.gif" || rating_img_cut == "TW-12TO18.gif"){
                    $(".plus-frame").remove();
                }
                break;
            case '18':
                if(rating_img_cut != "TW-18UP.gif"){
                    $(".plus-frame").remove();
                }
                break;
        }
    }else{
        $(".plus-frame").remove();
    }

    $("#grading-password").change(function(){
        grading =  $("#grading-password").find(":selected").val();
        localStorage.setItem('grading_save',grading);
    });

    /*$("#font").val(font_save);
$(".vjs-danmu").css("font-family",font_save);

$("#font").change(function(){
    $(document).on('DOMSubtreeModified',function () {
        var font = $("#font").find(":selected").val();
        $(".vjs-danmu").css("font-family",font);
        var font_selected = $("#font").find(":selected").val();
        localStorage.setItem('font',font_selected);
    });
});*/

    var ad_bool = false;
    $("#advertising").change(function() {
        localStorage.setItem('ad_skip',!ad_bool);
        ad_bool = !ad_bool;
    });


    if(ad_skip_save == 'true'){
        ad_bool = true;
        $("#advertising").prop("checked",true);
        var sn = animefun.videoSn;
        var adid = getAd()[0];
        $.ajax({
            url: 'ajax/videoCastcishu.php',
            data: { sn: sn, s: adid},
            type: "GET"
        });
        $.ajax({
            url: 'ajax/videoCastcishu.php',
            data: { sn: sn, s: adid, ad: 'end' },
            type: "GET"
        });
    }

    var grading_bool = false;
    $("#grading").change(function() {
        localStorage.setItem('ncc_warning',!grading_bool);
        grading_bool = !grading_bool;
    });

    if(ncc_warning_save == 'true'){
        grading_bool = true;
        $("#grading").prop("checked",true);
        //$('head').append('<style>.R18 {display: none !important;}</style>');
        window.timer = setInterval(function(){
            if($(".ncc-choose-btn").length > 0 && $(".plus-frame").length == 0){
                $("#adult").trigger("click");
                clearInterval(window.timer);
            }
        },1000);
    }

    $("#acceleration").change(function() {
        if(this.checked){
            var src = $("#ani_video_html5_api").attr("src");
            if($("#ani_video_html5_api").get(0)!=null){$("#ani_video_html5_api").get(0).playbackRate = 10;}
            window.rrimer = window.setInterval(function(){
                var src2 = $("#ani_video_html5_api").attr("src");
                if($("#ani_video_html5_api").get(0).ended || src != src2){
                    $("#acceleration").attr("checked",false);
                    window.clearInterval(window.rrimer);
                }
            },1000);
        } else {
            window.clearInterval(window.rrimer);
            if($("#ani_video_html5_api").get(0)!=null){$("#ani_video_html5_api").get(0).playbackRate = 1;}
        }
    });

    window.uutimer = setInterval(function(){
        if($(".R18").length == 0 && $(".vast-skip-button").length == 0 && $(".plus-frame").length == 0){
            $("#plus-video-fastforward-minute").attr("disabled",false);
            $("#plus-video-fastforward-second").attr("disabled",false);
            $("#plus-video-fastforward-sendout").attr("disabled",false);
            $(".plus_keyword-label").css("cursor","pointer");
            clearInterval(window.uutimer);
        }
    },2000);

    function fastforward(minute,second){
        var video_fastforward_minute = parseInt(minute) || 0;
        var video_fastforward_second = parseInt(second) || 0;
        if((video_fastforward_minute*60) + video_fastforward_second < $("#ani_video_html5_api").get(0).duration){
            $("#ani_video_html5_api").get(0).currentTime = (video_fastforward_minute*60) + video_fastforward_second;
        }else{
            alert("未知的座標,空降失敗");
        }
        $("#plus-video-fastforward-minute").val("");
        $("#plus-video-fastforward-second").val("");
    }


    $('#plus-video-fastforward-sendout').on('click', function() {
        var minute = $("#plus-video-fastforward-minute").val();
        var second = $("#plus-video-fastforward-second").val();
        fastforward(minute,second)
    });


    function Asc(obj){
        var text = obj;
        var asciiTable = "!\"#$%&\’()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
        var big5Table = "%uFF01%u201D%uFF03%uFF04%uFF05%uFF06%u2019%uFF08%uFF09%uFF0A%uFF0B%uFF0C%uFF0D%uFF0E%uFF0F%uFF10%uFF11%uFF12%uFF13%uFF14%uFF15%uFF16%uFF17%uFF18%uFF19%uFF1A%uFF1B%uFF1C%uFF1D%uFF1E%uFF1F%uFF20%uFF21%uFF22%uFF23%uFF24%uFF25%uFF26%uFF27%uFF28%uFF29%uFF2A%uFF2B%uFF2C%uFF2D%uFF2E%uFF2F%uFF30%uFF31%uFF32%uFF33%uFF34%uFF35%uFF36%uFF37%uFF38%uFF39%uFF3A%uFF3B%uFF3C%uFF3D%uFF3E%uFF3F%u2018%uFF41%uFF42%uFF43%uFF44%uFF45%uFF46%uFF47%uFF48%uFF49%uFF4A%uFF4B%uFF4C%uFF4D%uFF4E%uFF4F%uFF50%uFF51%uFF52%uFF53%uFF54%uFF55%uFF56%uFF57%uFF58%uFF59%uFF5A%uFF5B%uFF5C%uFF5D%uFF5E";
        var result = "";
        for (var i = 0; i < text.length; i++) {
            var val = escape(text.charAt(i));
            var j = big5Table.indexOf(val);
            result += (((j > -1) && (val.length == 6)) ? asciiTable.charAt(j / 6) : text.charAt(i));
        }
        return result;
    }

    function fastforward_skip(asc,key){
        $("#fastforward_id_"+key).click(function(){
            if($(".R18").length == 0 && $(".vast-skip-button").length == 0 && $(".plus-frame").length == 0){
                var string = asc;
                var split = string.split(":");
                fastforward(split[0],split[1]);
            }
        });

    }

    function danmuGet(){
        var settings = {
            "async": true,
            "crossDomain": true,
            "url": "https://ani.gamer.com.tw/ajax/danmuGet.php",
            "method": "POST",
            "data": {
                "sn": animefun.videoSn
            }
        }

        $.ajax(settings).done(function (response) {
            var content='';
            for(var key in response){
                var string = response[key].text;
                var a = string.match(/^[^/-]*[\uFF10-\uFF19]*:[\uFF10-\uFF19]*[^\u4e00-\u9fa5_a-zA-Z\s]$|^[^/-]*[\uFF10-\uFF19]*:[\uFF10-\uFF19]*[^\u4e00-\u9fa5_a-zA-Z\s]$|^[/-]*[0-9]*:[0-9]*[^\u4e00-\u9fa5_a-zA-Z\s]$|^[/-]*[0-9]*:[0-9]*[^\u4e00-\u9fa5_a-zA-Z\s]$/);
                if( string.indexOf("空降") == "0" || string.indexOf("座標") == "0"|| string.indexOf("空降座標") == "0" || a){
                    var match = string.match(/[\uFF10-\uFF19]{1,}:[\uFF10-\uFF19]{1,}|[\uFF10-\uFF19]{1,}:[\uFF10-\uFF19]{1,}|[0-9]{1,}:[0-9]{1,}|[0-9]{1,}:[0-9]{1,}/);
                    if(match){
                        $(".plus_no_sub").remove();
                        var asc = Asc(match[0]);
                        var split = asc.split(":");
                        var match1 = split[0].match(/[0-9]{2}/);
                        var match2 = split[1].match(/[0-9]{2}/);
                        var minute = (!match1)? "0"+split[0]:split[0];
                        var second = (!match2)? "0"+split[1]:split[1];
                        $(".plus_time_body").append('<span class="plus_keyword-label" id="fastforward_id_'+key+'"><span>'+minute+":"+second+'</span></span>')
                        fastforward_skip(asc,key);
                    }
                }
            }
        });
    }

    danmuGet();

    $(".plus_refresh").click(function(){
        $(".plus_keyword-label").remove();
        danmuGet();
    });



    //首次設定密碼
    $('#plus-password-setup').on('click', function() {
        var first_time_password = $("#plus-password").val();
        var password_save = localStorage.getItem('password_save');
        if(first_time_password != "" ){
            $("#plus-value").remove();
            $("#plus-value2").css("display",'unset');
            localStorage.setItem('password_save',btoa(first_time_password));
        }else{
            alert("請輸入密碼");
        }
    });

    //輸入密碼設定
    $('#plus-password-enter-setup').on('click', function() {
        var enter_password_setting = $("#plus-password2").val();
        if(!enter_password_setting){
            alert("請輸入密碼");
        }else {
            var password_save = localStorage.getItem('password_save');
            if(password_save == btoa(enter_password_setting)){
                $("#plus-value2").remove();
                $("#ncc-password").css("display",'unset');
            }else{
                alert("密碼錯誤");
            }
        }
    });

    //輸入密碼解除
    $('#plus-password-enter').on('click', function() {
        var enter_the_password = $("#plus-password3").val();
        var password_save = localStorage.getItem('password_save');
        if(!enter_the_password){
            alert("請輸入密碼");
        }else if(password_save == btoa(enter_the_password)){
            $(".plus-frame").remove();
        }else{
            alert("密碼錯誤");
        }
    });

    //添加分級圖片
    var rating_img1 = $(".rating > img").attr("src");
    $('.plus-box').prepend('<img src="'+rating_img1+'">');

});