Bilibili-中文AI字幕(加载网页3秒后自动点击一次)

自动打开B站中文AI字幕

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Bilibili-中文AI字幕(加载网页3秒后自动点击一次)
// @namespace    http://tampermonkey.net/
// @version      1.1
// @date         2025-11-26
// @description  自动打开B站中文AI字幕
// @author       GFred
// @match        https://www.bilibili.com/*
// @icon         https://i0.hdslb.com/bfs/static/jinkela/long/images/favicon.ico
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    const delayTime=3800; //延迟时间
    setTimeout(()=>{
        try{
            //1.打开网页的时候切换中文AI字幕
            let zhongwen = document.querySelector('.bpx-player-ctrl-subtitle-language-item-text');
            zhongwen.click();
            //2.点击分P的时候会刷新,切换中文AI字幕
            let playListItems = document.querySelectorAll('.title-txt');
            playListItems.forEach((n,m)=>{
                n.addEventListener('mouseup',()=>{
                    //点击分P后又要加载,所以再加一个定时器
                    setTimeout(()=>{
                        zhongwen.click();
                    },delayTime)
                })
            })
            //3.视频自动切集的时候,切换中文AI字幕
            let vdo = document.querySelector(".bpx-player-video-wrap>video");
            vdo.addEventListener('durationchange',()=>{
                setTimeout(()=>{
                    zhongwen.click();
                },delayTime)
            })
        }catch(e){
            console.log(e)
        }
    },delayTime)
})();