您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically selects the YouTube subtitles with the text "English (auto-generated)"
当前为
// ==UserScript== // @name Auto-Select YouTube Subtitles by Sapioit // @namespace Sapioit // @copyright Sapioit, 2020 - Present // @author sapioitgmail.com // @license GPL-2.0-only; http://www.gnu.org/licenses/gpl-2.0.txt // @version 2.4 // @description Automatically selects the YouTube subtitles with the text "English (auto-generated)" // @match https://*.youtube.com/* // @match https://youtube.com/* // @match https://youtu.be/* // @icon https://youtube.com/favicon.ico // @grant none // ==/UserScript== (function() { 'use strict'; // Delay function to add a short delay between clicks function delay(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } // Find the gear icon const gearIcon = document.querySelector('.ytp-settings-button'); // Click the gear icon to open the menu gearIcon.click(); // Wait for the menu to open setTimeout(() => { // Find the third menu item const menuItems = document.querySelectorAll('.ytp-menuitem-label span'); let thirdMenuItem; for (let j = 0; j < menuItems.length; j++) { const menuItem = menuItems[j].closest('.ytp-menuitem'); if (menuItem && menuItem.querySelector('.ytp-menuitem-label span:first-child').textContent.trim() === 'Subtitles/CC') { thirdMenuItem = menuItem; break; } } // Click the third menu item thirdMenuItem.click(); // Wait for the "Subtitles/CC" menu to open setTimeout(() => { // Find the "English (auto-generated)" menu item const menuLabels = document.querySelectorAll('.ytp-menuitem-label'); let autoGeneratedMenuItem; for (let i = 0; i < menuLabels.length; i++) { if (menuLabels[i].textContent.trim() === 'English (auto-generated)') { autoGeneratedMenuItem = menuLabels[i]; break; } } // Click the "English (auto-generated)" menu item autoGeneratedMenuItem.click(); setTimeout(() => { // Click the gear icon to open the menu gearIcon.click(); }, 30); // Adjust the delay (in milliseconds) if needed }, 30); // Adjust the delay (in milliseconds) if needed }, 30); // Adjust the delay (in milliseconds) if needed })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址