// ==UserScript== // @name Bilibili Vesiter // @name:zh-TW Bilibili Vesiter // @name:en Bilibili Vesiter // @namespace sheep-realms // @version 1.3 // @description 哔哩哔哩(bilibili)移除主站广告、移除播放页广告、自动宽屏、自动全屏、自动播放、逐帧播放 // @description:zh-tw 嗶哩嗶哩(bilibili)移除主站廣告、移除播放頁廣告、自動寬屏、自動全屏、自動播放、逐幀播放 // @description:en Bilbili remove the main station advertisement, remove the broadcast page advertisement, automatic widescreen, automatic full screen, automatic play, frame advance // @author Sheep-realms // @match *.bilibili.com/* // @run-at document-body // @require http://libs.baidu.com/jquery/2.0.0/jquery.min.js // @license CC 0 // @downloadURL none // ==/UserScript== var config = { //广告屏蔽等级 // 0 - 关闭 // 1 - 基础屏蔽 ad_block: 1, biliplayer: { //自动脚本执行延时(如果您的网络环境较差,请视情况延长时间,1000刻为1秒) timeout: 1000, //自动播放(true启用,false禁用) auto_play: false, //自动宽屏 auto_widescreen: false, //自动网页全屏 auto_web_fullscreen: false, //自动全屏 auto_fullscreen: false, //按J跳过片头默认时长(秒) jump_op: 90, //按逗号和句号逐帧播放默认时长(秒) frame: 0.016, //Shift按逗号和句号变速默认倍率 rate: 0.25, //虽然这个没啥可以配置的,但我还是要说一下按M静音 } } //////////////////////////////////////////////////////////////////////////////////////////////////// var video = $('.bilibili-player-video video')[0]; if(config.ad_block==1) { var csslist = ""; csslist += ".ad-report, #slide_ad, #bili_live>.banner-card, #bili_anime>.banner-card, #live_recommand_report.pop-live {display: none!important;}"; $('head').append(''); $('#reportFirst1').ready(function() { $('.bypb-icon').parents('.item').find('img').replaceWith('
广告内容已被屏蔽
'); $('.bypb-icon').parents('.item').find('p.title').replaceWith(''); }); $('#reportFirst2').ready(function() { $('.video-card-common.ex-card-common:contains("广告")').remove(); }); $('#bili_report_live .live-tabs .recommend-activity').ready(function() { setTimeout(function(){ $('.recommend-activity').remove(); $('#bili_report_live .live-tabs .tab-switch .tab-switch-item')[0].click(); }, 500); }); } $('body').ready(function() { setTimeout(function(){ if(config.biliplayer.auto_widescreen) $('.bilibili-player-iconfont-widescreen-off').click(); if(config.biliplayer.auto_web_fullscreen) $('.bilibili-player-iconfont-web-fullscreen-off').click(); if(config.biliplayer.auto_fullscreen) $('.bilibili-player-iconfont-fullscreen-off').click(); }, config.biliplayer.timeout); setTimeout(function(){ if(config.biliplayer.auto_play) $('.bilibili-player-dm-tip-wrap').click(); }, config.biliplayer.timeout+500); document.onkeydown=function(event){ if(event.which==74) video.currentTime += 90; if(event.which==188 && event.shiftKey==0) video.currentTime -= config.biliplayer.frame; if(event.which==190 && event.shiftKey==0) video.currentTime += config.biliplayer.frame; if(event.which==188 && event.shiftKey==1) video.playbackRate -= config.biliplayer.rate; if(event.which==190 && event.shiftKey==1) video.playbackRate += config.biliplayer.rate; if(event.which==77) $('.bilibili-player-video-btn-volume>button').click(); } });