HBLB 「Hit Bilibili Like Button」

哔哩哔哩辅助脚本: 视频,专栏自动点赞,解放双手 /

目前为 2021-06-11 提交的版本。查看 最新版本

// ==UserScript==
// @name         HBLB 「Hit Bilibili Like Button」
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  哔哩哔哩辅助脚本: 视频,专栏自动点赞,解放双手 /
// @author       rubmle
// @copyright    2021, Rubmle (https://github.com/rubmle)
// @license      MIT
// @match        *://*.bilibili.com/video/av*
// @match        *://*.bilibili.com/video/BV*
// @match        *://*.bilibili.com/read/cv*
// @grant        none
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAYAAAA4TnrqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFFmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDggNzkuMTY0MDM2LCAyMDE5LzA4LzEzLTAxOjA2OjU3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEu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==
function sleep (time) {
    return new Promise((resolve) => setTimeout(resolve, time));
}
//视频点赞
function videoLike(video_Like,video_LikeOn,title){
    if(video_Like.className == 'like'){
        video_Like.click();
        title.innerText ='👍'+title.text;
    }else if(video_Like.className == 'like on' || video_LikeOn.className == 'like on'){
        title.innerText ='[已赞]'+title.text;
        return;
    }
}
//专栏点赞
function readLike(read_Like,read_LikeOn,title){
    if(read_Like.className == 'iconfont icon-like'){
        read_Like.click();
        title.innerText ='👍'+title.text;
    }else if(read_Like.className == 'iconfont icon-like_p' || read_LikeOn.className == 'iconfont icon-like_p'){
        title.innerText ='[已赞]'+title.text;
        return;
    }
}

(function() {
    'use strict';
    //域名判断
    var host = window.location.href;
    //获取视频点赞的class
    var video_Like = document.getElementsByClassName('like')[0];
    var video_LikeOn = document.getElementsByClassName('like on')[0];
    //获取专栏点赞的class
    var read_Like = document.getElementsByClassName('iconfont icon-like')[0];
    var read_LikeOn = document.getElementsByClassName('iconfont icon-like_p')[0];
    var title = document.getElementsByTagName("title")[0];

    sleep(10000).then(() => {
        if(host.match("read")){
            readLike(read_Like,read_LikeOn,title)
        }
        if(host.match("video")){
            videoLike(video_Like,video_LikeOn,title)
        }
    })

})();

QingJ © 2025

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