B站自动点赞关注主播

在B站(bilibili)观看关注主播的视频超过30秒后,自动点赞

当前为 2021-10-19 提交的版本,查看 最新版本

// ==UserScript==
// @name B站自动点赞关注主播
// @namespace http://tampermonkey.net/
// @version 1.0
// @description 在B站(bilibili)观看关注主播的视频超过30秒后,自动点赞
// @author 王泥巴
// @match https://www.bilibili.com/video/*
// @grant none
// @icon https://www.bilibili.com/favicon.ico
// ==/UserScript==

(function() {
var delayTimeMS = 30 * 1000; //30秒后才点赞
setTimeout(function(){
// 自动给关注的up主点赞
if (document.getElementsByClassName("already-btn")[0] != undefined) { // 是否关注主播

var likeBtn = document.getElementsByClassName("like")[0];
if (likeBtn.className == "like") {
likeBtn.click();
console.log("已自动为up主点赞");
};

// 不自动投币

// // 获取今日投币情况
// var httpRequest = new XMLHttpRequest();
// httpRequest.open('GET', 'https://www.bilibili.com/plus/account/exp.php', true);
// httpRequest.send();//第三步:发送请求 将请求参数写在URL中
// /**
// * 获取数据后的处理程序
// */
// httpRequest.onreadystatechange = function () {
// if (httpRequest.readyState == 4 && httpRequest.status == 200) {
// var json = httpRequest.responseText;//获取到json字符串,还需解析
// var today = JSON.parse(json).number;
// console.log("今日已投币:", today);
// if (today < 40) {
// document.getElementsByClassName("coin")[0].click();
// setTimeout(function(){
// document.getElementsByClassName("bi-btn")[0].click();
// }, 200);
// }
// if (today == 40) {
// document.getElementsByClassName("coin")[0].click();
// setTimeout(function(){
// document.getElementsByClassName("mc-box left-con")[0].click();
// }, 200);
// setTimeout(function(){
// document.getElementsByClassName("bi-btn")[0].click();
// }, 400);
// }
// }
// };
}
}, delayTimeMS)
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址