牙刷科技,还原B站播放器,
当前为
// ==UserScript==
// @name bilibili toothbrush
// @namespace http://www.icycat.com
// @description 牙刷科技,还原B站播放器,
// @include *www.bilibili.tv/video/*
// @include *bilibili.kankanews.com/video/*
// @version 1.1
// ==/UserScript==
(function(){
var player = document.getElementById('bofqi').getElementsByTagName('embed');
if (player.length>0){
//获取cid
var flashvars = player[0].getAttribute('flashvars');
var cid_reg = /cid=(\d+)/ig;
var cid_array = cid_reg.exec(flashvars);
var cid = cid_array===null ? '':cid_array[1];
//获取aid
var url = document.location.href;
var aid_reg = /av(\d+)/ig;
var aid_array = aid_reg.exec(url);
var aid = aid_array===null ? '':aid_array[1];
//替换
document.getElementById('bofqi').innerHTML = '<embed id="bofqi_embed" quality="high" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" src="https://static-s.bilibili.tv/play.swf" flashvars="cid='+cid+'&aid='+aid+'" allowfullscreeninteractive="true" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" width=950 height=482;">';
} else {
return;
}
})();