// ==UserScript== // @name 動畫瘋·Plus // @namespace https://home.gamer.com.tw/homeindex.php?owner=xu3u04u48 // @version 1.21.3 // @description 分級標識自動同意、自動切換至下一集、自動點此跳過廣告、影片空降座標、網頁全螢幕、子母畫面 // @author xu3u04u48 // @match *://ani.gamer.com.tw/animeVideo.php?sn=* // @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 // @grant GM_setValue // @grant GM_getValue // @run-at document-end // @downloadURL none // ==/UserScript== (function() { 'use strict'; //禁止檔廣告警告視窗彈出 blockalert("廣告"); //設定值初始化 var fun = {'ncc_warning':false,'video_next':true,'ad_skip':true}; var ncc_warning_save = GM_getValue('ncc_warning') == undefined ? fun.ncc_warning : GM_getValue('ncc_warning'); var video_next_skip = GM_getValue('video_next') == undefined ? fun.video_next : GM_getValue('video_next'); var ad_skip_save = GM_getValue('ad_skip') == undefined ? fun.ad_skip : GM_getValue('ad_skip'); //取得動畫瘋 animefun Function var deviceid = animefun.getdeviceid(); var sn = animefun.videoSn; //取得用戶狀態 var token = Token(); //使用者介面 var aniplusui_html = '
'; aniplusui_html += ''; aniplusui_html += '
'; $('.sub_top').append(aniplusui_html); $('.ani-tab-content').append(''); $.fn.plus_ui = function(){ $(".ani-tab-content__item").css("display","none"); $("#ani-tab-content").css("display","block"); $('.ani-tabs-link').removeClass('is-active'); $(this).addClass("is-active"); }; //使用者介面CSS $('head').append(` `); //使用者介面HTML var version = GM_info.script.version; var ui_html = '
'; ui_html += ''; ui_html += '

動畫瘋·Plus '; ui_html += '
此插件設計是為了給短時間大量補番的人使用的,並加入一些沒用的功能
如果您覺得此插件好用,請付費支持動畫瘋讓此插件能持續為本平台服務'; ui_html += '
'; ui_html += '
' + version + '使用者介面調整。
'; ui_html += '

'; ui_html += '
'; ui_html += '
'; ui_html += 'Google Chrome擴充插件'; ui_html += '
'; ui_html += '
'; ui_html += '前往安裝'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '自動同意分級標識警告'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += ''; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '自動切換至下一集'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += ''; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '自動點此跳過廣告'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += ''; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '彈幕開關 按鍵設定'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += ''; ui_html += ''; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '空降座標'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += ':'; ui_html += ''; ui_html += ''; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '空降足跡(點擊降落)'; ui_html += '說明:
運作原理是取所有彈幕文字並利用關鍵字篩選
如果有在自訂過濾關鍵字新增"空降"or"座標"和開啟自動過濾
結果會不同
'; ui_html += '
'; ui_html += '確認座標說明:已回報的座標'; ui_html += '其它座標說明:
其它座標又稱未確定座標,有可能的原因是紀念觀賞時間
或未放入"空降"or"座標"關鍵字
'; ui_html += ''; ui_html += '
'; ui_html += '
'; ui_html += '
'; ui_html += '

    正在努力尋找中···
'; ui_html += '
'; ui_html += '
'; ui_html += '
'; $("#ani-tab-content").append(ui_html); var Firefox_w = '因Firefox瀏覽器的政策【禁止自動播放聲音】,如果啟動此選項後無法正常播放影片
'; Firefox_w +='請在瀏覽器權限【防止網站自動播放聲音】將【ani.gamer.com.tw】加入例外網站
'; if(BrowserCheck("Firefox")[0] != null )$("#firefox_w").after(Firefox_w); //網頁全螢幕 window.Webfullscreen = setInterval(function(){ let webfullscreen_h = ''; if($(".control-bar-rightbtn").length == 1 && $(".plus_Web_fullscreen_icon").length == 0){ $(".vjs-fullscreen-control").after(webfullscreen_h); }else if($(".plus_Web_fullscreen_icon").length == 1){ clearInterval(window.Webfullscreen); } },500); var webfullscreen_s = true; $.fn.web_fullscreen = function(){ let win_height = $(window).height(); let win_width = $(window).width(); if(webfullscreen_s){ webfullscreen_s = false; $("body").after('
'); $("#animeTip").css("bottom","-40px"); $("html").css({"overflow-y":"hidden","overflow-x":"hidden"}); $(".vjs-indent-button").css("display","none"); $(".vjs-danmu").css("perspective","805.536px"); $(".videoframe").css("height", win_height + "px"); }else{ webfullscreen_s = true; $("#Web_fullscreen_style").remove(); $("#animeTip").css("bottom","0px"); $("html").css({"overflow-y":"unset","overflow-x":"unset"}); $(".videoframe").css({"height":"","width":"","margin":""}); $(".vjs-indent-button").css("display","unset"); $(".vjs-danmu").css("perspective","401.09px"); } $(document).keydown(function(e) { if(e.keyCode == 27 && !webfullscreen_s){ webfullscreen_s = true; $("#Web_fullscreen_style").remove(); $("#animeTip").css("bottom","0px"); $("html").css({"overflow-y":"unset","overflow-x":"unset"}); $(".videoframe").css({"height":"","width":"","margin":""}); $(".vjs-indent-button").css("display","unset"); $(".vjs-danmu").css("perspective",""); } }); $(window).resize(function() { if(!webfullscreen_s){ let win_height = $(window).height(); $(".videoframe").css("height",win_height+"px"); } }); //網頁全螢幕CSS $('#Web_fullscreen_style').append(` `); videojs.getPlayer("ani_video").danmu.DanmuManager.onResize(); }; //全螢幕偵測 $(document).on("mozfullscreenchange webkitfullscreenchange fullscreenchange", fullscreenChange); function fullscreenChange(){ let isFullScreen = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen; setTimeout(function () { if (isFullScreen) { $(".plus_Web_fullscreen_icon").css("display", "none"); $(".plus_picture_in_picture_icon").css("display", "none"); } else { $(".plus_Web_fullscreen_icon").css("display", ""); $(".plus_picture_in_picture_icon").css("display", ""); } },500); } //偵測分級標識警告&廣告狀態 setTimeout(function(){ window.initial = setInterval(function(){ if ($("#ani_video_html5_api")[0] == null) return; let src = $("#ani_video_html5_api").attr("src"); let readyState = $("#ani_video_html5_api")[0].readyState; if($(".R18").length == 0 && $(".vast-skip-button").length == 0 && src.indexOf("fbcdn.net") == -1 && readyState != 0){ $("#plus-video-skip-minute").attr("disabled",false); $("#plus-video-skip-second").attr("disabled",false); $("#plus-video-skip-sendout").attr("disabled",false); $("#void_speed").attr("disabled",false); if(video_next_skip){video_ended();} danmuGetload(); video_danmun(); clearInterval(window.initial); } },1000); },1000); var countdown = 5; //5秒後切換至下一集 var repeate = true //防止計時器重複執行 //自動切換至下一集 $("#video_next_skip").change(function() { GM_setValue('video_next',$(this).prop("checked")); $("#plussetup").css("display","block"); setTimeout(function(){$("#plussetup").css("display","none")},3000); }); if(video_next_skip){ $("#video_next_skip").prop("checked",true); window.next_button = setInterval(function () { if($("#ani_video-next").length == 0){ $("#ani_video").append(''); }else{ clearInterval(window.next_button); } },1000); } function video_ended(){ $("#ani_video-next").html('

X

'); $("#ani_video_html5_api").on( 'ended', function() { countdown = 5; let nextplayer = $('.playing').next().html(); let match = (nextplayer != null) ? nextplayer.match('')[1] : null; if(match != null && repeate){ video_next(); repeate = false; } }); $("#stop_video-next").click(function () { repeate = true; $("#ani_video-next").css("display", 'none'); clearInterval(window.videoend); }); } function video_next(){ window.videoend = window.setInterval(function () { let ended = $("#ani_video_html5_api")[0].ended; let nextplayer = $('.playing').next().html(); let match = (nextplayer!=null)?nextplayer.match('')[1]:null; if (ended && match != null) { $("#ani_video-next").css("display", ''); $("#video_next_countdown").text(countdown.toString().padStart(2, "0") + " 秒後切換至下一集"); if (countdown == 1){ document.location.href = "https://ani.gamer.com.tw/animeVideo.php" + match }else if (countdown < 1){ countdown = 1; $("#ani_video-next").css("display", 'none'); } countdown -= 1; } else { repeate = true; $("#ani_video-next").css("display", 'none'); clearInterval(window.videoend); } }, 1000) } //自動同意分級標識警告 $("#grading").change(function() { GM_setValue('ncc_warning',$(this).prop("checked")); $("#plussetup").css("display","block"); setTimeout(function(){$("#plussetup").css("display","none")},3000); }); if(ncc_warning_save){ let rating_img = $(".rating > img").attr("src"); let img_cut = rating_img.substr(30); $("#grading").prop("checked",true); window.ncc = setInterval(function(){ if($("#adult").length > 0){ if(img_cut != 'TW-18UP.gif'|| token[1] == 1){ setTimeout(function () {$("#adult").click();},1000); } clearInterval(window.ncc); } },1000); } //自動點此跳過廣告 $("#ad_skip").change(function() { GM_setValue('ad_skip',$(this).prop("checked")); $("#plussetup").css("display","block"); setTimeout(function(){$("#plussetup").css("display","none")},3000); }); if(ad_skip_save){ $("#ad_skip").prop("checked",true); window.ad_skip_checker = setInterval(function(){ var aniad = ($(".nativeAD-skip-button,.vast-skip-button").length == 1)?$(".nativeAD-skip-button,.vast-skip-button")[0].innerText:null if($("video").length && $(".R18").length == 0 && $(".nativeAD-skip-button,.vast-skip-button,#an_skip_button").length == 0) { clearInterval(window.ad_skip_checker); }else if($("video").length && aniad == "點此跳過廣告"){ $("#adSkipButton , .nativeAD-skip-button").click(); clearInterval(window.ad_skip_checker); } },1000); } //空降座標 $('#plus-video-skip-sendout').on('click', function() { var minute = $("#plus-video-skip-minute").val(); var second = $("#plus-video-skip-second").val(); $("#plus-video-skip-minute").val(""); $("#plus-video-skip-second").val(""); if($("#ani_video_html5_api")[0].paused != true){ $(".vjs-play-control").click(); } fast_forward(minute,second); }); //改變影片時間 function fast_forward(minute,second){ let video_minute = parseInt(minute) || 0; let video_second = parseInt(second) || 0; if((video_minute*60) + video_second < $("#ani_video_html5_api")[0].duration){ $("#ani_video_html5_api")[0].currentTime = (video_minute*60) + video_second; if($("#ani_video_html5_api")[0].paused == true){$(".vjs-play-control").click();} }else{ if($("#ani_video_html5_api")[0].paused == true){$(".vjs-play-control").click();} alert("未知的座標,空降失敗"); } } //空降足跡-解析影片時間 function time_parse(stringasc,array,bool){ var match = stringasc.match(/[0-9]+:[0-9]+/g); for(var id in match){ var split = match[id].split(":"); var match1 = split[0].match(/[0-9]{2,3}/g),match2 = split[1].match(/[0-9]{2,3}/g); var minute = (!match1)? "0"+split[0]:split[0], second = (!match2)? "0"+split[1]:split[1]; var addjson = {"airborne":bool,"time":minute+":"+second}; array.push(addjson); } } //空降足跡 function danmuGet(){ var array= []; var settings = { "async": true, "crossDomain": true, "url": "ajax/danmuGet.php", "method": "POST", "data": { "sn": animefun.videoSn } } $.ajax(settings).done(function (response) { $(".plus_time_body").html(''); for(var key in response){ let stringasc = tobig5(response[key].text); let match = stringasc.match(/[0-9]{1,3}:[0-9]{1,3}/g); if( stringasc.indexOf("空降") != "-1" || stringasc.indexOf("座標") != "-1"){ time_parse(stringasc,array,true); }else if(match){ time_parse(stringasc,array,false); } } var deduped = filter_r(array,'time'); //清除重複 var json = jsonsort(deduped,'time'); //排序 if(json.length){ for(var arrayid in json){ let airborne = (json[arrayid].airborne)?"":"background:#bbbbbb;" $(".plus_no_sub").append('
  • '+json[arrayid].time+'
  • '); } }else{ $(".plus_time_body").html('') } }); } //空降足跡-改變影片時間 $.fn.fast_forward_skip = function (match){ let src = $("#ani_video_html5_api").attr("src"); let readyState = $("#ani_video_html5_api")[0].readyState; if($(".R18").length == 0 && $(".vast-skip-button").length == 0 && src.indexOf("fbcdn.net") == -1 && readyState != 0){ if($("#ani_video_html5_api")[0].paused != true){$(".vjs-play-control").click();} let split = match.split(":"); fast_forward(split[0],split[1]); } } function danmuGetload() { setTimeout(function () { danmuGet();//載入空降足跡 //空降足跡重整 $(".plus_refresh,#bahablack,.bluebtn").click(function () { setTimeout(function () { danmuGet() }, 1000) }); }, 1000) } //子母畫面 window.picture = setInterval(function () { let picture = '