// ==UserScript== // @name 哔哩哔哩小助手 // @namespace https://greasyfork.org/zh-CN/scripts/424638 // @homepage https://greasyfork.org/zh-CN/scripts/424638 // @version 0.7 // @description 视频自动点赞,网页自动宽屏播放 // @author 木羊羽 // @match https://www.bilibili.com/video/* // @match https://www.bilibili.com/bangumi/play/* // @run-at document-end // @grant none // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js // @license GPL-3.0 License // ==/UserScript== // 更新日志 // v0.7 修复按下enter键无法搜索的bug,增加视频窗口居中功能 // v0.6 增加按下enter键全屏功能 // v0.5 优化逻辑,新增点赞按钮 // v0.4 修复bug // v0.3 增加番剧、综艺宽屏,优化逻辑 // v0.2 新增自动调节页面至合适位置 // v0.1 自动点击宽屏、点赞按钮,点赞默认为关闭 (function () { function tool_1() { const widescreenFunction = true const likeFunction = false let count = 0 if (widescreenFunction) { let widescreen_id = setInterval(function () { let widescreen_one = document.querySelector('.bilibili-player-video-btn-widescreen') let widescreen_two = document.querySelector('.squirtle-video-widescreen') if (widescreen_one) { if (widescreen_one.className.includes('closed') === false) { widescreen_one.click() scrollTo(0, 90) clearInterval(widescreen_id) } } if (widescreen_two) { if (widescreen_two.className.includes('active') === false) { widescreen_two.click() scrollTo(0, 50) clearInterval(widescreen_id) } } }, 3000) } if (likeFunction) { let like_id = setInterval(function () { let like = document.querySelector("#arc_toolbar_report > div.ops > span.like") if (like === null) { console.log('未找到点赞button!') } else if (like.className.includes('on') === false) { like.click() clearInterval(like_id) } else { console.log('当前视频已经点赞') clearInterval(like_id) } }, 3000) } } function tool_2() { let body = document.getElementsByTagName('body')[0] let ops = document.querySelector('.ops') var color = '#757575' if ($(ops.children[0]).attr('class') == 'like on') { color = '#479fd1' } $(body).after( `