YouTube Studio Scheduled Date Visual Enhancer

Sort YouTube Studio videos by scheduled and published date easier through visual cues (border and bgcolor)

当前为 2021-05-23 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name     YouTube Studio Scheduled Date Visual Enhancer
// @description Sort YouTube Studio videos by scheduled and published date easier through visual cues (border and bgcolor)
// @version  2
// @grant    none
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @match https://studio.youtube.com/channel/*/videos/upload*
// @namespace ปวัตน
// ==/UserScript==
console.log("YouTube Studio Scheduled Date Visual Enhancer running");
window.addEventListener('load', function() {

this.$ = this.jQuery = jQuery.noConflict(true);
var timerVar    = setInterval (function() {DoMeEverySecond (); }, 5000);

function isOdd(num) { return num % 2;}
  
function DoMeEverySecond ()
{
  dayPrev=0;
  $("ytcp-content-section#video-list div.video-table-content ytcp-video-row").each(function() {
  	cell = $(this).find("div#row-container div.tablecell-date")
  	description = $(cell).find("div.cell-description").text().trim();
    visibility = $(this).find("#row-container div.tablecell-visibility span.label-span").text().trim();
    console.log(visibility);
    if (description == "Scheduled" || description == "Published") {
      day = $(cell).text().trim().split(",")[0].split(" ")[1];
      // border
      if (day != dayPrev) {
        $(this).find("#row-container").css("border-top", "solid black 3px");
      } else {
        $(this).find("#row-container").css("border-top", "solid black 0px");
      }
      dayPrev = day;
      // bg
      if (isOdd(day)) {
        if (visibility == "Public") {
          $(this).find("#row-container").css("background-color", "#ada");
        } else {
          $(this).find("#row-container").css("background-color", "#ddd");
        }
      } else {
        if (visibility == "Public") {
          $(this).find("#row-container").css("background-color", "#dfd");
        } else {
        	$(this).find("#row-container").css("background-color", "transparent");
        }
      }
    }
  });
}

//--- When ready to stop the timer, run this code:
//clearInterval (timerVar);
//timerVar        = "";
  
}, false);