您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds the overall playlist length.
// ==UserScript== // @name YouTube Playlist Time Length // @namespace https://violentmonkey.github.io/ // @version 1.0.0 // @description Adds the overall playlist length. // @description Adapted from script https://gf.qytechs.cn/en/scripts/439291-youtube-playlist-length // @author André Augusto // @match *://www.youtube.com/playlist?list=* // @grant none // @require https://code.jquery.com/jquery-2.2.4.min.js // @license MIT // ==/UserScript== (function() { document.onreadystatechange = function () { if (document.readyState === 'complete') { setTimeout(function() { function convertS(sec) {var hrs = Math.floor(sec / 3600); var min = Math.floor((sec - (hrs * 3600)) / 60); var seconds = sec - (hrs * 3600) - (min * 60); seconds = Math.round(seconds * 100) / 100;var result = (hrs < 10 ? "0" + hrs : hrs) + ':'; result += (min < 10 ? "0" + min : min) + ":"; result += (seconds < 10 ? "0" + seconds : seconds); return result; }; var ytp = document.querySelectorAll("ytd-playlist-video-list-renderer > #contents > ytd-playlist-video-renderer");var time = 0; for (var i = 0; i < ytp.length; i++) {var a = ytp[i].getElementsByTagName('ytd-thumbnail-overlay-time-status-renderer')[0].innerText;var tx = a.split(':'); if (tx.length < 3) {time = time + Number(tx[0]) * 60 + Number(tx[1]);} else if (tx.length = 3) {time = time + Number(tx[0]) * 60 * 60 + Number(tx[1]) * 60 + Number(tx[2]);}}; var ytpT = convertS(time); time=document.createElement('span'); time.innerText=ytpT; time.className='testing'; time.style='color:#AAAAAA; font-family:"Roboto","Arial",sans-serif; font-size:1.4rem; line-height:2rem;'; const stats = document.getElementById('stats'); stats.appendChild(time); let timestyle = document.createElement('style'); timestyle.innerText='.testing::before {content: "•"; margin: 0 4px}' time.appendChild(timestyle); }, 2000) } } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址