
本人每次更换电脑或系统都要重新找现成脚本但总是旧版本已经不适应最新B站环境需要重新修改太过繁琐所以自己修改了记录一下javascript: (function () { var hostname window.location.hostname; var pathname window.location.pathname; if (hostname ! www.bilibili.com || !pathname.startsWith(/video/BV)) { alert(该代码仅在 B站视频页面 (https://www.bilibili.com/video/BV...) 上运行); return; } var hour 0; var minute 0; var second 0; var amtEl document.querySelector(.video-pod .amt); var page 0; var amtEl document.querySelector(.video-pod .amt); if (amtEl) { var match amtEl.textContent.match(/\/(\d)/); if (match) { page parseInt(match[1]); } } var durations document.getElementsByClassName(duration); if (!page) { page durations.length; } function f1() { hour 0; minute 0; second 0; var min 0; var sec 0; if (document.getElementById(divChild)) { document.getElementById(divChild).remove(); } if ( parseInt(input1.value) 1 parseInt(input1.value) page parseInt(input2.value) page parseInt(input1.value) parseInt(input2.value) ) { for (var i parseInt(input1.value) - 1; i parseInt(input2.value); i) { var time durations[i].innerHTML.trim(); var t time.split(:).map(Number); if (t.length 3) { var h t[0]; var m t[1]; var s t[2]; } else { var h 0; var m t[0]; var s t[1]; } hour h; minute m; sec s; } minute Math.floor(sec / 60); second sec % 60; minute min; hour Math.floor(minute / 60); minute minute % 60; if (input3.value ! 1) { var total hour * 3600 minute * 60 second; total total / input3.value; hour Math.floor(total / 3600); minute Math.floor((total % 3600) / 60); second Math.floor(total % 60); } var d1 document.createElement(div); d1.style.cssText margin-top:15px; d1.setAttribute(id, divChild); d.appendChild(d1); var t1 document.createTextNode( 全 (parseInt(input2.value) - parseInt(input1.value) 1) 集: hour 时 minute 分 parseInt(second) 秒 ); d1.appendChild(t1); } else { var d1 document.createElement(div); d1.style.cssText margin-top:15px; d1.setAttribute(id, divChild); d.appendChild(d1); var t1 document.createTextNode(输入与实际集数不符); d1.appendChild(t1); } } function over() { btn.style.backgroundColor #E4E4E4; } function out() { btn.style.backgroundColor #F4F4F4; } function closePanel() { var panel document.getElementById(statPanel); if (panel) { panel.remove(); } } function makeDraggable(element) { var isDragging false; var offsetX 0, offsetY 0; element.addEventListener(mousedown, function (e) { isDragging true; offsetX e.clientX - element.offsetLeft; offsetY e.clientY - element.offsetTop; element.style.cursor move; }); document.addEventListener(mousemove, function (e) { if (isDragging) { element.style.left e.clientX - offsetX px; element.style.top e.clientY - offsetY px; } }); document.addEventListener(mouseup, function () { isDragging false; element.style.cursor default; }); } var body document.body; var d document.createElement(div); d.style.cssText padding-top:15px;width:145px;height:165px;background-color:#F4F4F4;position:absolute;right:20px;top:218px;border:1px solid #00A1D6;color:#00A1D6;z-index:999;text-align:center;font-size:14px; d.setAttribute(id, statPanel); body.appendChild(d); var d2 document.createElement(div); d.appendChild(d2); var t2 document.createTextNode(第); d2.appendChild(t2); var input1 document.createElement(input); input1.setAttribute(type, number); input1.style.cssText border: 1px solid deepskyblue;width:40px; input1.value 1; d2.appendChild(input1); var t3 document.createTextNode(集到); d2.appendChild(t3); var input2 document.createElement(input); input2.setAttribute(type, number); input2.style.cssText border: 1px solid deepskyblue;width:40px; input2.value page; d2.appendChild(input2); var t4 document.createTextNode(集); d2.appendChild(t4); var btn document.createElement(input); btn.setAttribute(type, button); btn.setAttribute(value, 计算); btn.style.cssText width:50px;margin-top:15px;border: 1px solid #00A1D6;cursor:pointer; d.appendChild(btn); btn.onclick f1; btn.onmouseover over; btn.onmouseout out; var t5 document.createTextNode(倍速); d2.appendChild(t5); var input3 document.createElement(input); input3.setAttribute(type, number); input3.setAttribute(step, 0.1); input3.setAttribute(min, 0.1); input3.style.cssText border: 1px solid deepskyblue;width:50px;margin-top:15px;margin-right:10px; input3.value 1; d2.appendChild(input3); var t6 document.createTextNode(倍); d2.appendChild(t6); var closeBtn document.createElement(input); closeBtn.setAttribute(type, button); closeBtn.setAttribute(value, 关闭); closeBtn.style.cssText width:50px;margin-top:10px;border: 1px solid red;cursor:pointer;color:red; closeBtn.onclick closePanel; d.appendChild(closeBtn); makeDraggable(d); })();本人根据原来博主略微修改能使用更舒适效果如下窗口可以拖动携带关闭红色按钮默认集数【1-总集数】倍速默认1步进0.1使用方法和注释参考原博主参考博主地址-携带注释