去除手机版 6 分钟限制,添加网页跳转
当前为
// ==UserScript==
// @name 哔哩哔哩去除 6 分钟限制及 APP 下载
// @namespace http://tampermonkey.net/
// @version 0.4.3
// @description 去除手机版 6 分钟限制,添加网页跳转
// @author sl00p
// @match https://m.bilibili.com/video/*
// @grant none
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
var herfs = document.location.href.split("/");
var bvid = herfs[herfs.length - 1];
var relate = "https://api.bilibili.com/x/web-interface/archive/related?bvid=" + bvid;
;
console.log("start parse....");
(function() {
if(window.localStorage && window.localStorage.getItem("window.bsource") != "wechat") {
window.localStorage.setItem("window.bsource", "wechat");
}
if(document.cookie.indexOf("wechat") == -1) {
document.cookie = "bsource=wechat";
}
})();
console.log("window.bsource ==> ", window.localStorage.getItem("window.bsource"));
function HttpGet(url,success){
var xmlhttp = null;
if(window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
}
xmlhttp.open("GET",url,true);
xmlhttp.timeout = 4000;
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 504 ) {
console.log("服务器请求超时..");
xmlhttp.abort();
}else if(xmlhttp.status == 200){
success(xmlhttp.responseText);
}
xmlhttp = null;
}
}
xmlhttp.ontimeout = function () {
console.log("客户端请求超时..");
}
xmlhttp.send();
}
HttpGet(relate, function(res) {
var data = JSON.parse(res).data;
var nodesInterval = setInterval(function() {
var nodes = document.getElementsByClassName("index__title__src-videoPage-related2Col-videoItem-");
if (nodes !== undefined) {
for(var i = 0; i < nodes.length; ++i) {
console.log("parse node " + i + " ...");
nodes[i].innerHTML="<p><a href=\"" + data[i].bvid + "\">" + data[i].title + "</a></p>";
// clearInterval(nodesInterval);
};
}
}, 1000);
var appInterval = setInterval(function() {
var nodeList = ["index__openAppBtn__src-commonComponent-topArea-", "index__svgaOpenAppBtn__src-videoPage-svgaOpenAppBtn-", "index__downLoadBtn__src-videoPage-commentArea-"];
var appList = ["index__openAppLabel__src-videoPage-related2Col-videoItem- index__pink__src-videoPage-related2Col-videoItem-", "index__openApp__src-videoPage-related2Col-videoItem-"];
for(var i = 0; i < appList.length; ++i) {
var app = document.getElementsByClassName(appList[i]);
if (app !== undefined) {
app.onclick = function() { return false };
for(var j = 0; j < app.length; ++j) {
app[j].innerText = data[j].owner.name;
}
for(var k = 0; k < nodeList.length; ++k) {
if(document.getElementsByClassName(nodeList[k]).length > 0) {
document.getElementsByClassName(nodeList[k])[0].remove();
}
}
// clearInterval(appInterval);
}
}
}, 1000);
});
})();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址