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

try to take over the world!

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

  1. // ==UserScript==
  2. // @require http://code.jquery.com/jquery-3.4.1.min.js
  3. // @name Youtube 字幕翻譯重疊修復(半自動) 、 字幕字形改微軟正黑體
  4. // @namespace http://tampermonkey.net/
  5. // @version 1.0
  6. // @description try to take over the world!
  7. // @author You
  8. // @grant GM_addStyle
  9. // @include http*://*.youtube.com/*
  10. // @include http*://youtube.com/*
  11. // @include http*://*.youtu.be/*
  12. // @include http*://youtu.be/*
  13. // ==/UserScript==
  14.  
  15.  
  16. //字體更改
  17. //font-family:字型清單
  18. //font-weight:字型樣式
  19. //webkit-text-stroke:字型外框
  20. GM_addStyle(`
  21. .ytp-caption-segment{
  22. font-family: "Microsoft JhengHei","Monotype Corsiva", "URW Chancery L", "Apple Chancery", "Dancing Script", cursive !important;
  23. font-weight: bold !important;
  24. -webkit-text-stroke: 1.5px black !important;
  25. }
  26. ` );
  27.  
  28. var $ = window.jQuery;
  29. 'use strict';
  30.  
  31.  
  32. $(document).ready(function () {
  33. setInterval(CCFixs, 10); //檢查字幕重疊頻率(10ms)
  34. });
  35.  
  36.  
  37. function CCFixs() {
  38. var temp1 = ["", ""];
  39.  
  40. $(".caption-window").each(function (index, element) {
  41. temp1[index] = $(this).attr('id').replace("caption-window-_", "");
  42. })
  43. if (parseInt(temp1[0]) > parseInt(temp1[1])) {
  44. $("#caption-window-_" + temp1[1]).remove();
  45. } else if (parseInt(temp1[0]) < parseInt(temp1[1])) {
  46. $("#caption-window-_" + temp1[0]).remove();
  47. }
  48. }
  49. function CCFix() {
  50. if ($(".html5-video-player").getElementsByClassName("caption-window ytp-caption-window-bottom").length == 2) {
  51. $(".html5-video-player").getElementsByClassName("caption-window ytp-caption-window-bottom")[0].remove();
  52. }
  53. }

QingJ © 2025

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