Youtube 字幕翻譯重疊修復(半自動) 、 字幕字形改微軟正黑體

try to take over the world!

目前为 2020-02-27 提交的版本。查看 最新版本

// ==UserScript==
// @require http://code.jquery.com/jquery-3.4.1.min.js
// @name         Youtube 字幕翻譯重疊修復(半自動) 、 字幕字形改微軟正黑體
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  try to take over the world!
// @author       You
// @grant        GM_addStyle
// @include      http*://*.youtube.com/*
// @include      http*://youtube.com/*
// @include      http*://*.youtu.be/*
// @include      http*://youtu.be/*
// ==/UserScript==


//字體更改
//font-family:字型清單
//font-weight:字型樣式
//webkit-text-stroke:字型外框
GM_addStyle(`
    .ytp-caption-segment{
            font-family: "Microsoft JhengHei","Monotype Corsiva", "URW Chancery L", "Apple Chancery", "Dancing Script", cursive !important;
            font-weight: bold !important;
            -webkit-text-stroke: 1.5px black !important;
    }
` );

var $ = window.jQuery;
'use strict';


$(document).ready(function () {
    setInterval(CCFixs, 10); //檢查字幕重疊頻率(10ms)
});


function CCFixs() {
    var temp1 = ["", ""];

    $(".caption-window").each(function (index, element) {
        temp1[index] = $(this).attr('id').replace("caption-window-_", "");
    })
    if (parseInt(temp1[0]) > parseInt(temp1[1])) {
        $("#caption-window-_" + temp1[1]).remove();
    } else if (parseInt(temp1[0]) < parseInt(temp1[1])) {
        $("#caption-window-_" + temp1[0]).remove();
    }
}
function CCFix() {
    if ($(".html5-video-player").getElementsByClassName("caption-window ytp-caption-window-bottom").length == 2) {
        $(".html5-video-player").getElementsByClassName("caption-window ytp-caption-window-bottom")[0].remove();
    }
}

QingJ © 2025

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