您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Stop video 12 seconds before the end for Secular Talk videos on YouTube
// ==UserScript== // @name Stop video 12 seconds before the end for Secular Talk videos to avoid the ad at the end // @namespace http://tampermonkey.net/ // @version 0.3 // @description Stop video 12 seconds before the end for Secular Talk videos on YouTube // @author Your name // @match *://www.youtube.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // define the username of the channel you want to target const targetChannel = 'Secular Talk'; const targetVideoDuration = 12; // Stop the video 12 seconds before the end console.log('Script loaded'); // check if the video is from the target channel function isTargetVideo() { const channelNameElement = document.querySelector('.ytd-channel-name a'); if (channelNameElement) { const channelName = channelNameElement.textContent.trim(); return channelName === targetChannel; } return false; } let video = null; let videoDuration = 0; function init() { setInterval(checkVideo, 500); } function checkVideo() { video = document.querySelector('video.html5-main-video'); if (video) { if (!video.paused && isTargetVideo()) { videoDuration = video.duration; if (videoDuration - video.currentTime <= targetVideoDuration) { console.log('Stopping video'); video.pause(); } } } } init(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址