// ==UserScript== // @name StarTube // @namespace http://tampermonkey.net/ // @version 2.1.0 // @description Adds a bunch of customization options to V3 // @author lightbeam24 // @match *://*.youtube.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; let currStarVer = "2.1.0"; let starTubeConfigCreated = localStorage.getItem("starTubeConfigCreated"); if (starTubeConfigCreated == null) { starTubeConfigCreated = currStarVer; } var $ = a => document.querySelector(a); var STH = { WMR_ACTIONS: `
Share
Save
` }; let forceC4 = false; let globalDataPoints = { dummy: "" }; window.globalDataPoints = globalDataPoints; let bannerNo = getRndInteger(1,4); let closedEFYTBanner = false; let closedWelcomeBanner = false; let gdp = globalDataPoints; var V3_SETTINGS = localStorage.getItem("v3_local_db"); V3_SETTINGS = JSON.parse(V3_SETTINGS); var V3_SETTINGS_CONF = V3_SETTINGS.config.db.yt; var STS = localStorage.getItem("ST_SETTINGS"); var defaultConfigs = { "expAdaptiveLayout": false, "expAdaptiveLayout2017Cap": false, "polymerWarningBanner": true, "showWelcomeBanner": false, "expRelatedThumbsSizeMedium": true, "expRelatedThumbsSizeLarge": false, "expRelatedThumbsSizeStupid": false, "expAlwaysShowCompactDate": true, "expMoveGuideMainSectionToTop": false, "expMoreTooltips": true, "expMoveGuideButtonToTopbar": false, "expRelatedTabs": true, "expRelatedTabsHoldsSubscribe": true, "expWatch9": true, "expWatch9NoOwner": true, "expWatch9TrueExpander": false, "expVerticalWatch9": false, "expWatch9SidebarBus": false, "expWatch9StickyColumns": false, "expWatch9ReportTab": true, "expRelatedGrid": false, "expWatch8": false, "expWatch8NoMore": false, "expMoveCountsToButtons": false, "expSharrow": false, "expGuideAlwaysPinned": false, "expWatch7AboutTabRename": false, "expWatch7AboutTabRename2": false, "expTwoColumnSearchResults": false, "configNoTabTopBorder": true, "configWatch7SidebarCardShadow": true, "expFlatLogo": false, "expInvertLogo": false, "expGlossyLogo": false, "expClassicTitle": false, "expClassicGuide": false, "expClassicSubscribe": false, "expClassicStyles": false, "expClassicLtod": false, "expClassicButtons": false, "expBigSearchThumbs": false, "expBiggerSearchThumbs": false, "expNoVideosLink": false, "expModernStyles": false, "expModernNotifIcon": false, "expModernTopbar": false, "expModernUpload": false, "expModernGuideButton": false, "expModernSearchIcon": false, "expSearchText": false, "expModernTitle": false, "expModernGuide": false, "expModernHome": false, "expModernPlaylists": false, "expModernPlaylistThumbnails": false, "expPlaylistRedBorder": false, "expPlaylistTimestamps": true, "expTrueScrollableGuide": false, "expModernPlayer": false, "expModernPlayerV2": false, "expViewsString": true, "expGoogleApps": false, "expCommentsFullWidth": true, "expNoByText": false, "expAccountMenu": false, "expStaticSite": false, "expHideAppbar": false, "expEpicWatch7": false, "expEpicWatch7Flat": false, "expEpicHeader": false, "expEpicStyling": false, "expEpicFeeds": false, "expCosmicHeader": false, "expCosmicBG": false, "expCosmicButtons": false, "expCosmicStyles": false, "expCosmicBanners": false, "expCosmicBannersV2": false, "expCosmicComments": false, "expCosmicGuideStyle": false, "expCosmicGuideLayout": false, "expCosmicFeedsV1": false, "expCosmicFeedsThirdColumn": false, "expWatch5D": false, "expChannels3": false, "expChannels3BGVerticalRepeat": false, "expChannels3BGHorizontalRepeat": false, "expNoGuide": false, "expGuideOnFeedsOnly": false, "expAozoraHome": false, "expAozoraHeader": false, "expAozoraBG": false, "expAozoraStyles": false, "expAozoraSubscribe": false, "expAozoraTopbarLinks": false, "expWatch5C": false, "expHomeTab": false, "expRoboto": false, "expCenteredSearch": false, "expBigSearch": false, "expSecondarySearchIcon": false, "expMaterialSearch": false, "expPolymerShell": false, "expEarlyPolymerShell": false, "expEarlyPolymerGuide": false, "expPolymerGen2Colors": false, "expPolymerSubscribe": false, "expPolymerGen2Subscribe": false, "expPolymerStyles": false, "expPolymerChannels": false, "expPolymerComments": false, "expPolymerTooltips": false, "expMaterialSignIn": false, "expWatch9A": false, "expWatch9B": false, "expWatch10Beta": false, "expWMRButtonsLowercase": false, "expOutlineIcons": false, "expRichGridHome": false, "expRoundedTopbarPfp": false, "expUploadIcon": false, "presetAozora2011": false, "presetEpicPanda": false, "presetCosmicPanda": false, "presetHitchhiker2013_1": false, "presetHitchhiker2013_1Alt": false, "presetHitchhiker2013_2": false, "presetHitchhiker2013_2Alt": false, "presetHitchhiker2013_3": false, "presetHitchhiker2013_3Alt": false, "presetHitchhiker2014": false, "presetHitchhiker2014Alt": false, "presetHitchhiker2015": false, "presetHitchhiker2015Alt": false, "presetHitchhiker2016": false, "presetHitchhiker2016Alt": false, "presetHitchhiker2017": false, "presetHitchhiker2017Alt": false, "presetHitchhiker2017Ultra": false, "presetPolymer2016": false, "presetPolymer2019": false, "presetPolymer2020": false, "presetPolymer2021": false, "presetPolymer2022": false, "presetHitchhiker2015_Early": false, "presetHitchhiker2016_Early": false, "presetHitchhiker2016_Mid": false, "presetHitchhiker2017_Early": false, "STPresetsAlsoSetV3Settings": true, "expHomepageRedirectsToFeed": false, "expLogoLinksToFeed": false, "expLogoLinksToSubs": false, "show2point1": true, "expHideYoodles": false, "expFixedShareIcons": true, "expFixedXIcon": true, "expMaterialGbar": false, "ironSettings": {} }; if (STS == null) { STS = defaultConfigs; } else { try { STS = JSON.parse(STS); applyNewSettings(); } catch(err) { console.log("It looks like you had a bad config. Your settings have been reset."); STS = defaultConfigs; applySettings(); } } function applySettings() { localStorage.setItem("ST_SETTINGS",JSON.stringify(STS)); } function applyNewSettings() { if (STS.show2point1 == null) { STS.show2point1 = true; } if (STS.ironSettings == null) { STS.ironSettings = {}; } if (STS.showWelcomeBanner == null) { STS.showWelcomeBanner = false; } if (STS.expNoVideosLink == null) { STS.expNoVideosLink = false; if (STS.show2point1 == false) { STS.show2point1 = true; } } if (STS.expModernPlaylists == null) { STS.expModernPlaylists = false; if (presetHitchhiker2014 == true || presetHitchhiker2015 == true || presetHitchhiker2016 == true || presetHitchhiker2017 == true) { STS.expModernPlaylists = true; } } if (STS.expModernPlaylistThumbnails == null) { STS.expModernPlaylistThumbnails = false; if (presetHitchhiker2015 == true || presetHitchhiker2016 == true || presetHitchhiker2017 == true) { STS.eexpModernPlaylistThumbnails = true; } } if (STS.expPlaylistRedBorder == null) { STS.expPlaylistRedBorder = false; if (presetHitchhiker2014 == true || presetHitchhiker2015 == true) { STS.expPlaylistRedBorder = true; } } if (STS.expPlaylistTimestamps == null) { STS.expPlaylistTimestamps = true; } if (STS.expAdaptiveLayout == null) { STS.expAdaptiveLayout = false; } if (STS.expAdaptiveLayout2017Cap == null) { STS.expAdaptiveLayout2017Cap = false; } if (STS.expMateralSignIn == null) { STS.expMateralSignIn = false; } if (STS.expModernNotifIcon == null) { STS.expModernNotifIcon = false; if (presetHitchhiker2016 == true || presetHitchhiker2017 == true) { STS.expModernNotifIcon = true; } } if (STS.expEpicFeeds == null) { STS.expEpicFeeds = false; if (STS.presetEpicPanda == true) { STS.expEpicFeeds = true; } } if (STS.expCosmicBanners == null) { STS.expCosmicBanners = false; STS.expCosmicBannersV2 = false; if (STS.presetCosmicPanda == true) { STS.expCosmicBanners = true; STS.expCosmicBannersV2 = true; applySettings(); } } if (STS.expCosmicFeedsThirdColumn == null) { STS.expCosmicFeedsThirdColumn = false; if (STS.presetCosmicPanda == true) { STS.expCosmicFeedsThirdColumn = true; applySettings(); } } if (STS.presetHitchhiker2015_Early == null) { STS.presetHitchhiker2015_Early = false; } if (STS.presetHitchhiker2016_Early == null) { STS.presetHitchhiker2016_Early = false; } if (STS.presetHitchhiker2016_Mid == null) { STS.presetHitchhiker2016_Mid = false; } if (STS.presetHitchhiker2017_Early == null) { STS.presetHitchhiker2017_Early = false; } if (STS.presetHitchhiker2017Ultra == null) { STS.presetHitchhiker2017Ultra = false; } if (STS.expChannels3 == null) { STS.expChannels3 = false; STS.expChannels3BGVerticalRepeat = false; STS.expChannels3BGHorizontalRepeat = false; if (STS.presetCosmicPanda == true || STS.presetEpicPanda == true || STS.presetHitchhiker2013_1 == true || STS.presetHitchhiker2013_1Alt == true) { STS.expChannels3 = true; applySettings(); } } } getIronSettings(); function getIronSettings() { let irons = Object.entries(STS.ironSettings); irons.forEach(i => { let name = i[0]; let value = i[1]; STS[name] = value; }); } let arra = Object.entries(STS); async function checkSetting(settingName) { let value = STS[settingName]; return value; } if (window.location.href == "https://www.youtube.com/" && STS.expHomepageRedirectsToFeed == true) { window.location = "https://www.youtube.com/feed/what_to_watch/recommended"; } function getRndInteger(min, max) { return Math.floor(Math.random() * (max - min)) + min; } var canGo = false; var html = document.querySelector('html'); function timeout(durationMs) { return new Promise((resolve, reject) => { setTimeout(function() { resolve(); }, durationMs); }); } async function waitForElement500(elm) { while (null == document.querySelector(elm)) { await new Promise(r => requestAnimationFrame(r)); } await timeout(500).then(function() { canGo = true; return document.querySelector(elm); }); } async function waitForElement(elm) { while (null == document.querySelector(elm)) { await new Promise(r => requestAnimationFrame(r)); } await timeout(50).then(function() { canGo = true; return document.querySelector(elm); }); } async function waitForElement10(elm) { while (null == document.querySelector(elm)) { await new Promise(r => requestAnimationFrame(r)); } await timeout(10).then(function() { canGo = true; return document.querySelector(elm); }); } function grabData() { if ($("#yt-masthead-user")) { gdp.lowPfp = $("#yt-masthead-user .yt-thumb-27 img").src; gdp.pfp = $("#yt-masthead-user .yt-thumb-27 img").src; gdp.pfp = gdp.pfp.split("=s")[0] + "=s108"; } if ($("#yt-masthead-signin")) { gdp.loggedIn = false; } else { gdp.loggedIn = true; } //console.log(globalDataPoints); } function getSapisidhash() { /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* SHA-1 (FIPS 180-4) implementation in JavaScript (c) Chris Veness 2002-2019 */ /* MIT Licence */ /* www.movable-type.co.uk/scripts/sha1.html */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /** * SHA-1 hash function reference implementation. * * This is an annotated direct implementation of FIPS 180-4, without any optimisations. It is * intended to aid understanding of the algorithm rather than for production use. * * While it could be used where performance is not critical, I would recommend using the ‘Web * Cryptography API’ (developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest) for the browser, * or the ‘crypto’ library (nodejs.org/api/crypto.html#crypto_class_hash) in Node.js. * * See csrc.nist.gov/groups/ST/toolkit/secure_hashing.html * csrc.nist.gov/groups/ST/toolkit/examples.html */ class Sha1 { /** * Generates SHA-1 hash of string. * * @param {string} msg - (Unicode) string to be hashed. * @param {Object} [options] * @param {string} [options.msgFormat=string] - Message format: 'string' for JavaScript string * (gets converted to UTF-8 for hashing); 'hex-bytes' for string of hex bytes ('616263' ≡ 'abc') . * @param {string} [options.outFormat=hex] - Output format: 'hex' for string of contiguous * hex bytes; 'hex-w' for grouping hex bytes into groups of (4 byte / 8 character) words. * @returns {string} Hash of msg as hex character string. * * @example * import Sha1 from './sha1.js'; * const hash = Sha1.hash('abc'); // 'a9993e364706816aba3e25717850c26c9cd0d89d' */ static hash(msg, options) { const defaults = { msgFormat: 'string', outFormat: 'hex' }; const opt = Object.assign(defaults, options); switch (opt.msgFormat) { default: // default is to convert string to UTF-8, as SHA only deals with byte-streams case 'string': msg = utf8Encode(msg); break; case 'hex-bytes':msg = hexBytesToString(msg); break; // mostly for running tests } // constants [§4.2.1] const K = [ 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 ]; // initial hash value [§5.3.1] const H = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]; // PREPROCESSING [§6.1.1] msg += String.fromCharCode(0x80); // add trailing '1' bit (+ 0's padding) to string [§5.1.1] // convert string msg into 512-bit/16-integer blocks arrays of ints [§5.2.1] const l = msg.length/4 + 2; // length (in 32-bit integers) of msg + ‘1’ + appended length const N = Math.ceil(l/16); // number of 16-integer-blocks required to hold 'l' ints const M = new Array(N); for (let i=0; i>> 32, but since JS converts // bitwise-op args to 32 bits, we need to simulate this by arithmetic operators M[N-1][14] = ((msg.length-1)*8) / Math.pow(2, 32); M[N-1][14] = Math.floor(M[N-1][14]); M[N-1][15] = ((msg.length-1)*8) & 0xffffffff; // HASH COMPUTATION [§6.1.2] for (let i=0; i>> 0' to emulate UInt32 variables) for (let t=0; t<80; t++) { const s = Math.floor(t/20); // seq for blocks of 'f' functions and 'K' constants const T = (Sha1.ROTL(a, 5) + Sha1.f(s, b, c, d) + e + K[s] + W[t]) >>> 0; e = d; d = c; c = Sha1.ROTL(b, 30) >>> 0; b = a; a = T; } // 4 - compute the new intermediate hash value (note 'addition modulo 2^32' – JavaScript // '>>> 0' coerces to unsigned UInt32 which achieves modulo 2^32 addition) H[0] = (H[0]+a) >>> 0; H[1] = (H[1]+b) >>> 0; H[2] = (H[2]+c) >>> 0; H[3] = (H[3]+d) >>> 0; H[4] = (H[4]+e) >>> 0; } // convert H0..H4 to hex strings (with leading zeros) for (let h=0; h prev + String.fromCharCode(curr), ''); } catch (e) { // no TextEncoder available? return unescape(encodeURIComponent(str)); // monsur.hossa.in/2012/07/20/utf-8-in-javascript.html } } function hexBytesToString(hexStr) { // convert string of hex numbers to a string of chars (eg '616263' -> 'abc'). const str = hexStr.replace(' ', ''); // allow space-separated groups return str=='' ? '' : str.match(/.{2}/g).map(byte => String.fromCharCode(parseInt(byte, 16))).join(''); } } /** * Function 'f' [§4.1.1]. * @private */ static f(s, x, y, z) { switch (s) { case 0: return (x & y) ^ (~x & z); // Ch() case 1: return x ^ y ^ z; // Parity() case 2: return (x & y) ^ (x & z) ^ (y & z); // Maj() case 3: return x ^ y ^ z; // Parity() } } /** * Rotates left (circular left shift) value x by n positions [§3.2.5]. * @private */ static ROTL(x, n) { return (x<>>(32-n)); } } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ function gethash() { function getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i 's attributes "reset" halfway through loading, causing some settings to not apply, this should correct that when it happens. Done twice until I find a better way to do it. setTimeout(everyLoad, 3000); setTimeout(everyLoad, 6000); setTimeout(everyLoad, 10000); setTimeout(everyLoad, 15000); setTimeout(everyLoad, 20000); setTimeout(checkContentMargin, 1500); setTimeout(checkContentMargin, 3000); var elm = "#page"; waitForElement10(elm).then(function(elm) { if (canGo != false) { if (STS.expMoveGuideMainSectionToTop == true) { var elm = ".guide-section"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var guideSection0 = document.querySelectorAll(".guide-section")[1]; var guideSection1 = document.querySelectorAll(".guide-section")[0]; var guideSection2 = document.querySelectorAll(".guide-section")[2]; var guideSection3 = document.querySelectorAll(".guide-section")[3]; var newHome = document.querySelector('.guide-toplevel'); newHome.appendChild(guideSection0); newHome.appendChild(guideSection1); newHome.appendChild(guideSection2); newHome.appendChild(guideSection3); } }); } } }); var interval = setInterval(function() { if (STS.expViewsString == true) { if ($(".watch-view-count") != null) { if (!$(".watch-view-count").textContent.includes('view') && !$(".watch-view-count").textContent.includes('wa')) { var tC = $(".watch-view-count").textContent; $(".watch-view-count").textContent = tC + " views"; } } } }, 500); setTimeout(interval, 10); function createWelcomeAlert() { let container = document.querySelector("#alerts"); var newElem = document.createElement("div"); newElem.id = "st-welcome-alert"; newElem.innerHTML = `
Alert icon
`; container.insertBefore(newElem, container.children[0]); newElem.querySelector(".close").addEventListener("click", function() { newElem.style.display = "none"; closedWelcomeBanner = true; STS.showWelcomeBanner = false; applySettings(); }); } function createEFYTAlert() { let container = document.querySelector("#alerts"); var newElem = document.createElement("div"); newElem.id = "st-efyt-alert"; newElem.innerHTML = `
Alert icon
`; container.insertBefore(newElem, container.children[0]); newElem.querySelector(".close").addEventListener("click", function() { newElem.style.display = "none"; closedEFYTBanner = true; }); switch (bannerNo) { case 1: newElem.querySelector(".yt-alert").classList.add("yt-alert-info"); break; case 2: newElem.querySelector(".yt-alert").classList.add("yt-alert-warn"); break; case 3: newElem.querySelector(".yt-alert").classList.add("yt-alert-error"); break; } } function createThirdColumn() { if ( $("#page.home") && STS.expAozoraHome == true ) { // $(".branded-page-v2-secondary-col").innerHTML = ``; let stolenRecoms = ""; if ($(".lohp-newspaper-shelf")) { stolenRecoms = document.querySelectorAll(".feed-item-container")[1]; } else { stolenRecoms = $(".feed-item-container"); } let newHome = $(".branded-page-v2-secondary-col .branded-page-box"); stolenRecoms.style.display = "block"; newHome.appendChild(stolenRecoms); let container = document.querySelector(".branded-page-v2-secondary-col"); var newElem = document.createElement("div"); newElem.id = "epic-panda-rules"; newElem.innerHTML = ` `; container.insertBefore(newElem, container.children[0]); var elm = ".feed-item-container:nth-child(10) img"; waitForElement500(elm).then(function(elm) { if (canGo != false) { let arrayShelves = document.querySelectorAll(".compact-shelf"); // console.log(arrayShelves); arrayShelves.forEach(itemRoot => { if (itemRoot) { itemRoot.classList.add("rule-added"); var newElem = document.createElement("div"); newElem.setAttribute("class","horizontal-rule"); newElem.innerHTML = ` `; itemRoot.insertBefore(newElem, itemRoot.children[0]); // console.log(newElem); } }); } }); } } function createFeedText() { if (document.querySelector(".epic-panda-header") == null) { var elm = ".branded-page-v2-subnav-container"; waitForElement10(elm).then(function(elm) { if (canGo != false) { let container = document.querySelector('.feed-item-container'); var newElem = document.createElement("div"); newElem.class = "epic-panda-header"; newElem.innerHTML = ` From YouTube `; container.insertBefore(newElem, container.children[0]); } }); } } if (document.querySelector("#st-settings-button") == null) { var elm = "#footer"; waitForElement10(elm).then(function(elm) { if (canGo != false) { $(".oz-expand-debugger-icon").addEventListener("click", function() { if (document.querySelector("#st-settings-button") == null) { createExpandedFooter(); } }); } }); } function deleteTitleOnTop() { if ( $("#watch5-above-container") ) { $("#watch5-above-container").remove(); } } function guideAlwaysPinned() { if (document.querySelector(".guide-pinning-enabled") == null) { document.querySelector("body").classList.add("guide-pinning-enabled"); } if (document.querySelector(".guide-pinned") == null) { document.querySelector("body").classList.add("guide-pinned"); } if (document.querySelector(".guide-guide") == null) { document.querySelector("body").classList.add("show-guide"); } } function hideYoodles() { if ($("#logo-container.doodle")) { $("#logo-container.doodle").classList.remove("doodle"); $("#logo-container img").src = "//s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif"; if ($(".content-region")) { $(".content-region").removeAttribute("style"); } } } function createRelatedTabsPrep() { if (document.querySelector(".watch") != null) { if (document.querySelector(".live_chat_box_iframe_holder") != null) { if (document.querySelector("#related-tabs") == null) { createRelatedTabs(1); } } else { if (document.querySelector("#related-tabs") == null) { createRelatedTabs(0); } } } else { var elm = ".watch"; waitForElement10(elm).then(function(elm) { if (canGo != false) { if (document.querySelector("#alt-watch9-container") == null) { if (document.querySelector(".live_chat_box_iframe_holder") != null) { if (document.querySelector("#related-tabs") == null) { createRelatedTabs(1); } } else { if (document.querySelector(".watch") != null) { if (document.querySelector("#related-tabs") == null) { createRelatedTabs(0); } } } } } }); } } function createWatch9Prep() { if (document.querySelector("#watch7-content.watch-content .yt-uix-button") != null) { if (document.querySelector("#alt-watch9-container") == null) { if (document.querySelector("#watch7-creator-bar") != null) { createWatch9(1); } else { createWatch9(0); } } } else { var elm = "#watch7-content.watch-content .yt-uix-button"; waitForElement10(elm).then(function(elm) { if (canGo != false) { if (document.querySelector("#alt-watch9-container") == null) { if (document.querySelector("#watch7-creator-bar") != null) { createWatch9(1); } else { createWatch9(0); } } } }); } } function createWatch8Prep() { if (document.querySelector("#watch7-content.watch-content .yt-uix-button") != null) { if (document.querySelector("#watch8-container") == null) { if (document.querySelector("#watch7-creator-bar") != null) { createWatch8(2); } else { createWatch8(1); } } } else { var elm = "#watch7-content.watch-content .yt-uix-button"; waitForElement10(elm).then(function(elm) { if (canGo != false) { if (document.querySelector("#watch8-container") == null) { if (document.querySelector("#watch7-creator-bar") != null) { createWatch8(2); } else { createWatch8(1); } } } }); } } function createWatch5Prep() { var elm = "#watch7-content.watch-content .yt-uix-button"; waitForElement10(elm).then(function(elm) { if (canGo != false) { if (document.querySelector("#watch5-container") == null) { if (document.querySelector("#watch7-creator-bar") != null) { createWatch5(1, "d"); } else { createWatch5(0, "d"); } } } }); } function createRealWatch9Prep() { if (document.querySelector("#watch7-content.watch-content .yt-uix-button") != null) { if (document.querySelector("#watch9-container") == null) { if (document.querySelector("#watch7-creator-bar") != null) { createRealWatch9(1); } else { createRealWatch9(0); } } } else { var elm = "#watch7-content.watch-content .yt-uix-button"; waitForElement10(elm).then(function(elm) { if (canGo != false) { if (document.querySelector("#watch9-container") == null) { if (document.querySelector("#watch7-creator-bar") != null) { createRealWatch9(1); } else { createRealWatch9(0); } } } }); } } function createWatch10Prep() { if (document.querySelector("#watch7-content.watch-content .yt-uix-button") != null) { if (document.querySelector("#watch10-container") == null) { if (document.querySelector("#watch7-creator-bar") != null) { createWatch10(1); } else { createWatch10(0); } } } else { var elm = "#watch7-content.watch-content .yt-uix-button"; waitForElement10(elm).then(function(elm) { if (canGo != false) { if (document.querySelector("#watch10-container") == null) { if (document.querySelector("#watch7-creator-bar") != null) { createWatch10(1); } else { createWatch10(0); } } } }); } } function moveGuideButtonToTopbar() { var elm = "#appbar-guide-button"; waitForElement10(elm).then(function(elm) { if (canGo != false) { if (document.querySelector("#yt-masthead #appbar-guide-button") == null) { var theBtn = document.querySelector("#appbar-guide-button"); var newHome = document.querySelector('#yt-masthead'); newHome.insertBefore(theBtn, newHome.children[1]); } } }); } function moveCountsToButtons() { var elm = ".watch"; waitForElement10(elm).then(function(elm) { if (canGo != false) { if (document.querySelector(".likes-count") != null) { var likeCount = document.querySelector(".likes-count").textContent; var dislikeCount = document.querySelector(".dislikes-count").textContent; document.querySelector("#watch-like .run").textContent = likeCount; document.querySelector("#watch-dislike .yt-uix-button-content").innerHTML = ` Dislike `; document.querySelector("#watch-dislike .run").textContent = dislikeCount; document.querySelector("#watch-dislike").classList.remove("yt-uix-button-empty"); } } }); } function createMoreTooltips() { var elm = ".watch"; waitForElement10(elm).then(function(elm) { if (canGo != false) { if (document.querySelector(".video-extras-sparkbars") != null) { if (document.querySelector(".video-extras-sparkbars.yt-uix-tooltip") == null) { var percent = document.querySelector(".video-extras-sparkbar-likes").style.width; document.querySelector(".video-extras-sparkbars").setAttribute("title", percent + " of viewers like this video"); document.querySelector(".video-extras-sparkbars").classList.add("yt-uix-tooltip"); } } if (document.querySelector("#watch7-user-header .yt-user-name") != null) { if (document.querySelector("#watch7-user-header .yt-user-name.yt-uix-tooltip") == null) { var user = document.querySelector("#watch7-user-header .yt-user-name").textContent; document.querySelector("#watch7-user-header .yt-user-name").setAttribute("title", "View " + user + "'s channel"); document.querySelector("#watch7-user-header .yt-user-name").classList.add("yt-uix-tooltip"); document.querySelector("#watch7-user-header .yt-user-videos").setAttribute("title", "View " + user + "'s videos"); document.querySelector("#watch7-user-header .yt-user-videos").classList.add("yt-uix-tooltip"); } } if (document.querySelector(".yt-uix-button-subscribe-branded:not([disabled='True'])") != null) { if (document.querySelector(".yt-uix-button-subscribe-branded:not([disabled='True']):not(.yt-uix-tooltip)") != null) { document.querySelector(".yt-uix-button-subscribe-branded:not([disabled='True']):not(.yt-uix-tooltip)").setAttribute("title", "Subscribe"); document.querySelector(".yt-uix-button-subscribe-branded:not([disabled='True']):not(.yt-uix-tooltip)").classList.add("yt-uix-tooltip"); } } if (document.querySelector(".yt-uix-button-subscribed-branded:not([disabled='True'])") != null) { if (document.querySelector(".yt-uix-button-subscribed-branded:not([disabled='True']):not(.yt-uix-tooltip)") != null) { document.querySelector(".yt-uix-button-subscribed-branded:not([disabled='True']):not(.yt-uix-tooltip)").setAttribute("title", "Unsubscribe"); document.querySelector(".yt-uix-button-subscribed-branded:not([disabled='True']):not(.yt-uix-tooltip)").classList.add("yt-uix-tooltip"); } } if (document.querySelector("#watch7-secondary-actions .start") != null) { if (document.querySelector("#watch7-secondary-actions .start.yt-uix-tooltip") == null) { document.querySelector("#watch7-secondary-actions .start").setAttribute("title", "Video info"); document.querySelector("#watch7-secondary-actions .start").classList.add("yt-uix-tooltip"); if (STS.expWatch7AboutTabRename == true) { document.querySelector("#watch7-secondary-actions .start span").textContent = "Video info"; } if (STS.expWatch7AboutTabRename2 == true) { document.querySelector("#watch7-secondary-actions .start span").textContent = "Details"; } } } } }); if (document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(2)") != null) { if (document.querySelector("#watch7-secondary-actions .yt-uix-button.yt-uix-tooltip:nth-child(2)") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(2)").setAttribute("title", "Share"); document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(2)").classList.add("yt-uix-tooltip"); } } if (document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(3)") != null) { if (document.querySelector("#watch7-secondary-actions .yt-uix-button.yt-uix-tooltip:nth-child(3)") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(3)").setAttribute("title", "Add to"); document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(3)").classList.add("yt-uix-tooltip"); } } } function createSearchText() { if ($("#masthead-search-term") != null) { $("#masthead-search-term").setAttribute("placeholder","Search"); } } function doModernGuide() { if ($("#FEwhat_to_watch-guide-item.startube") == null) { if ($("#FEwhat_to_watch-guide-item") != null) { $("#FEwhat_to_watch-guide-item .display-name span").textContent = "Home"; $("#FEwhat_to_watch-guide-item").classList.add("startube"); let container = $("#FEwhat_to_watch-guide-item .yt-valign-container"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-svg thumb"); container.classList.add("startube-has-icon"); newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[0]); } } if ($("#FEsubscriptions-guide-item.startube") == null) { if ($("#FEsubscriptions-guide-item") != null) { $("#FEsubscriptions-guide-item .display-name span").textContent = "Subscriptions"; let container = $("#FEsubscriptions-guide-item .yt-valign-container"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-svg thumb"); container.classList.add("startube-has-icon"); newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[0]); $("#FEsubscriptions-guide-item").classList.add("startube"); } } if ($("#FEhistory-guide-item.startube") == null) { if ($("#FEhistory-guide-item") != null) { $("#FEhistory-guide-item .display-name span").textContent = "History"; let container = $("#FEhistory-guide-item .yt-valign-container"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-svg thumb"); container.classList.add("startube-has-icon"); newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[0]); $("#FEhistory-guide-item").classList.add("startube"); } } if ($("#FEtrending-guide-item.startube") == null) { if ($("#FEtrending-guide-item") != null) { let container = $("#FEtrending-guide-item .yt-valign-container"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-svg thumb"); container.classList.add("startube-has-icon"); newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[0]); $("#FEtrending-guide-item").classList.add("startube"); } } if ($("#FEsocial-guide-item.startube") == null) { if ($("#FEsocial-guide-item") != null) { let container = $("#FEsocial-guide-item .yt-valign-container"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-svg thumb"); container.classList.add("startube-has-icon"); newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[0]); $("#FEsocial-guide-item").classList.add("startube"); } } if ($("#VLWL-guide-item.startube") == null) { if ($("#VLWL-guide-item") != null) { let container = $("#VLWL-guide-item .yt-valign-container"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-svg thumb"); container.classList.add("startube-has-icon"); newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[0]); $("#VLWL-guide-item").classList.add("startube"); } } if ($("#VLLL-guide-item.startube") == null) { if ($("#VLLL-guide-item") != null) { let container = $("#VLLL-guide-item .yt-valign-container"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-svg thumb"); container.classList.add("startube-has-icon"); newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[0]); $("#VLLL-guide-item").classList.add("startube"); } } if ($(".guide-user-links .guide-channel[id^='UC']") != null) { if ($(".startube-mychan > a") == null) { let container1 = $(".guide-user-links .guide-channel[id^='UC']"); container1.classList.add("startube-mychan"); let container = container1.querySelector(".yt-valign-container"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-svg thumb"); container.classList.add("startube-has-icon"); newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[0]); container1.classList.add("startube"); let newHome = $(".guide-user-links"); newHome.insertBefore(container1, newHome.children[1]); } } if ($(".guide-channel[id^='VLP']:not(.startube)")) { let list = document.querySelectorAll(".guide-channel[id^='VLP']:not(.startube)"); list.forEach(item => { let container = item.querySelector(".yt-valign-container"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-svg thumb"); container.classList.add("startube-has-icon"); newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[0]); item.classList.add("startube"); }); } if ($("#appbar-guide-button.startube") == null) { if ($("#appbar-guide-button") != null) { let container = $("#appbar-guide-button"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-svg thumb"); container.classList.add("startube-has-icon"); newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[0]); $("#appbar-guide-button").classList.add("startube"); } } if ($("#logo-container.startube") == null) { if ($("#logo-container") != null) { let container = $("#logo-container"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-svg thumb"); container.classList.add("startube-has-icon"); newElem.innerHTML = ` `; container.insertBefore(newElem, container.children[0]); $("#logo-container").classList.add("startube"); } } if ( $(".appbar-nav-menu") != null && !window.location.href.includes("feed/history") && !window.location.href.includes("distiller_post_history") ) { if ( $(".home") != null || $(".feed") != null ) { var elm = ".epic-nav-item-heading"; waitForElement(elm).then(function(elm) { if (canGo != false) { if ($(".appbar-nav-menu li:nth-child(1) .epic-nav-item-heading") != null) { $(".appbar-nav-menu li:nth-child(1) .epic-nav-item-heading").textContent = "Home"; } else { $(".appbar-nav-menu li:nth-child(1) .yt-uix-button-content span").textContent = "Home"; } if ($(".appbar-nav-menu li:nth-child(2) .epic-nav-item-heading") != null) { $(".appbar-nav-menu li:nth-child(2) .epic-nav-item-heading").textContent = "Subscriptions"; } else { $(".appbar-nav-menu li:nth-child(2) .yt-uix-button-content span").textContent = "Subscriptions"; } } }); } if ( $("[location='feed-recs']") != null && $("[exp-cosmic-guide-layout]") != null ) { var elm = ".epic-nav-item-heading"; waitForElement(elm).then(function(elm) { if (canGo != false) { if ($(".appbar-nav-menu li:nth-child(1) .epic-nav-item-heading") != null) { $(".appbar-nav-menu li:nth-child(1) .epic-nav-item-heading").textContent = "From YouTube"; } else { $(".appbar-nav-menu li:nth-child(1) .yt-uix-button-content span").textContent = "From YouTube"; } } }); } } } function doScrollableGuide() { if ($("#guide-library-section")) { $("#guide-library-section").data.guideSubscriptionsSectionRenderer.navigationEndpoint = ""; } if ($(".startube-fixed-guide-item") == null) { var elm = "#guide-library-container"; waitForElement(elm).then(function(elm) { if (canGo != false) { if ($("#guide-library-container .guide-flyout") && $("#startube-library-expander-container") == null) { let container = $("#guide-library-container"); let newElem = document.createElement("div"); newElem.id = "startube-library-expander-container"; newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[5]); var theFlyout = document.querySelector("#guide-library-container .guide-flyout .guide-channels-list"); var newHome = document.querySelector("#guide-library-container .startube-guide-expander-items"); newHome.insertBefore(theFlyout, newHome.children[0]); newHome.classList.add("startube-fixed-guide-item"); } if ($("#guide-subscriptions-container .guide-flyout") && $("#startube-subs-expander-container") == null) { let container = $("#guide-subscriptions-container"); let newElem = document.createElement("div"); newElem.id = "startube-subs-expander-container"; newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[4]); theFlyout = document.querySelector("#guide-subscriptions-container .guide-flyout .guide-channels-list"); newHome = document.querySelector("#guide-subscriptions-container .startube-guide-expander-items"); newHome.insertBefore(theFlyout, newHome.children[0]); } newHome.classList.add("startube-fixed-guide-item"); } }); } } function doModernPlayer() { if (STS.expModernPlayer == true || STS.expModernPlayerV2 == true) { document.querySelector("html").setAttribute("exp-modern-player", ""); if (STS.expModernPlayerV2 == true) { document.querySelector("html").setAttribute("exp-modern-player-v2", ""); } if ($("#page.watch") || $("#page.channel")) { var elm = ".html5-player-chrome"; waitForElement10(elm).then(function(elm) { if (canGo != false) { $("#movie_player").classList.add("autohide-controls"); if ($(".ytp-button-play.startube-has-icon") == null && $(".ytp-button-pause.startube-has-icon") == null) { let container; if ($(".ytp-button-play")) { container = $(".ytp-button-play"); } else { container = $(".ytp-button-pause"); } let newElem = document.createElement("div"); newElem.setAttribute("class","startube-player-svg"); container.classList.add("startube-has-icon"); container.classList.add("startube-player-icon"); container.id = "startube-playpause"; if (STS.expModernPlayerV2 == true) { newElem.innerHTML = ` `; } else { newElem.innerHTML = ` `; } container.insertBefore(newElem, container.children[0]); let currPlayerState = "paused"; // Select the node that will be observed for mutations const targetNode = document.querySelector("#movie_player"); // Options for the observer (which mutations to observe) const config = { attributes: true }; // Callback function to execute when mutations are observed const callback = (mutationList, observer) => { for (const mutation of mutationList) { if ($(".playing-mode") && currPlayerState == "paused") { $("#st-playing").beginElement(); currPlayerState = "playing"; } if ($(".paused-mode") && currPlayerState == "playing") { $("#st-pausing").beginElement(); currPlayerState = "paused"; } } }; // Create an observer instance linked to the callback function const observer = new MutationObserver(callback); // Start observing the target node for configured mutations observer.observe(targetNode, config); } if ($(".ytp-button-volume.startube-has-icon") == null) { let container = $(".ytp-button-volume"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-player-svg"); container.classList.add("startube-has-icon"); container.classList.add("startube-player-icon"); container.id = "startube-volume"; newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[0]); } if ($("#subtitles_button.startube-has-icon") == null && $("#subtitles_button")) { let container = $("#subtitles_button"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-player-svg"); container.classList.add("startube-has-icon"); container.classList.add("startube-player-icon"); if (STS.expModernPlayerV2 == true) { newElem.innerHTML = ` `; } else { newElem.innerHTML = ` `; } container.insertBefore(newElem, container.children[1]); } if ($("#settings_button.startube-has-icon") == null) { let container = $("#settings_button"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-player-svg"); container.classList.add("startube-has-icon"); container.classList.add("startube-player-icon"); if (STS.expModernPlayerV2 == true) { newElem.innerHTML = ` `; } else { newElem.innerHTML = ` `; } container.insertBefore(newElem, container.children[1]); } if ($(".ytp-size-toggle-large.startube-has-icon") == null && $(".ytp-size-toggle-small.startube-has-icon") == null) { let container; if ($(".ytp-size-toggle-large")) { container = $(".ytp-size-toggle-large"); } else { container = $(".ytp-size-toggle-small"); } let newElem = document.createElement("div"); newElem.setAttribute("class","startube-player-svg"); container.classList.add("startube-has-icon"); container.classList.add("startube-player-icon"); container.id = "startube-theater"; if (STS.expModernPlayerV2 == true) { newElem.innerHTML = `
`; } else { newElem.innerHTML = `
`; } container.insertBefore(newElem, container.children[0]); } if ($(".ytp-button-fullscreen-enter.startube-has-icon") == null && $(".ytp-button-fullscreen-exit.startube-has-icon") == null) { let container; if ($(".ytp-button-fullscreen-enter")) { container = $(".ytp-button-fullscreen-enter"); } else { container = $(".ytp-button-fullscreen-exit"); } let newElem = document.createElement("div"); newElem.setAttribute("class","startube-player-svg"); container.classList.add("startube-has-icon"); container.classList.add("startube-player-icon"); container.id = "startube-fullscreen"; if (STS.expModernPlayerV2 == true) { newElem.innerHTML = `
`; } else { newElem.innerHTML = `
`; } container.insertBefore(newElem, container.children[0]); } if ($(".ytp-action-buttons .ytp-button-watch-later") == null) { var theBtn = document.querySelector(".ytp-button-watch-later"); var newHome = document.querySelector('.ytp-action-buttons'); newHome.insertBefore(theBtn, newHome.children[2]); } if ($(".ytp-button-watch-later.startube-has-icon") == null) { let container = $(".ytp-button-watch-later"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-player-svg"); container.classList.add("startube-has-icon"); container.classList.add("startube-player-icon"); newElem.innerHTML = ` `; container.insertBefore(newElem, container.children[0]); } if ($(".ytp-button-share.startube-has-icon") == null) { let container = $(".ytp-button-share"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-player-svg"); container.classList.add("startube-has-icon"); container.classList.add("startube-player-icon"); newElem.innerHTML = ` `; container.insertBefore(newElem, container.children[0]); } if ($(".ytp-button-prev.startube-has-icon") == null) { let container = $(".ytp-button-prev"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-player-svg"); container.classList.add("startube-has-icon"); container.classList.add("startube-player-icon"); if (STS.expModernPlayerV2 == true) { newElem.innerHTML = ` `; } else { newElem.innerHTML = ` `; } container.insertBefore(newElem, container.children[0]); } if ($(".ytp-button-next.startube-has-icon") == null) { let container = $(".ytp-button-next"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-player-svg"); container.classList.add("startube-has-icon"); container.classList.add("startube-player-icon"); if (STS.expModernPlayerV2 == true) { newElem.innerHTML = ` `; } else { newElem.innerHTML = ` `; } container.insertBefore(newElem, container.children[0]); } } }); } } } function createGoogleApps() { if (document.querySelector("#yt-masthead-content") != null) { if (document.querySelector("#google-apps") == null) { createApps(); } } else { var elm = "#yt-masthead-content"; waitForElement10(elm).then(function(elm) { if (canGo != false) { if (document.querySelector("#google-apps") == null) { createApps(); } } }); } } function createMenus() { if ($("#st-menus") == null) { let container = $("body"); let newElem = document.createElement("div"); newElem.id = "st-menus-container"; newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[0]); $("#st-menus-fence").addEventListener("click", function() { $("#st-menus-container").classList.remove("menu-visible"); }); } } function createSpace() { if ($("#st-space") == null) { let container = $("body"); let newElem = document.createElement("div"); newElem.id = "st-space"; newElem.innerHTML = ` `; container.insertBefore(newElem, container.children[0]); } } function createAccountMenu() { if ($("#st-account-menu") == null && $(".yt-masthead-user-icon") != null && $(".yt-masthead-user-icon.startube-evented") == null) { $(".yt-masthead-user-icon").classList.add("startube-evented"); $(".yt-masthead-user-icon").addEventListener("click", function() { if ($("#st-account-menu") == null) { $("#masthead-expanded [href='#']").click(); let container = $("#st-menus"); let newElem = document.createElement("div"); newElem.id = "st-account-menu"; newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[0]); constructAccountMenu(); } if ($("#st-menus-container.menu-visible")) { $("#st-menus-container").classList.remove("menu-visible"); } else { $("#st-menus-container").classList.add("menu-visible"); } }); } } function constructAccountMenu() { var elm = "#masthead-expanded .yt-uix-clickcard-card"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var elem = $(".masthead-card-switch-account .yt-uix-clickcard-card-body"); var newHome = $("#st-account-menu-other .st-account-menu-content"); newHome.insertBefore(elem, newHome.children[0]); var elem = $("#yt-masthead-multilogin-actions"); var newHome = $("#st-account-menu-footer"); newHome.insertBefore(elem, newHome.children[0]); let guideUrl = $(".guide-user-links .guide-channel[id^='UC'] a").getAttribute("href"); gdp.myChanUrl = guideUrl; let guideId = guideUrl.split("/channel/")[1]; gdp.myChanId = guideId; $("#yt-masthead-multilogin-actions a:nth-child(2)").textContent = "Add channel"; $("#yt-masthead-multilogin-actions a").classList.add("yt-uix-button"); $("#yt-masthead-multilogin-actions a:nth-child(2)").classList.add("yt-uix-button"); $("#yt-masthead-multilogin-actions a").classList.add("yt-uix-button-default"); $("#yt-masthead-multilogin-actions a:nth-child(2)").classList.add("yt-uix-button-default"); gdp.email = $("#masthead-expanded-menu-email").textContent; gdp.name = $("#masthead-expanded-menu-account-info p").textContent; gdp.subs = $(".yt-masthead-multilogin-user-content span:nth-of-type(2)").textContent; $("#st-account-menu-main .st-account-menu-header span").textContent = gdp.email; $("#st-account-menu-username span").textContent = gdp.name; $("#st-account-menu-sub-count span").textContent = gdp.subs; $("#st-account-menu-pfp img").src = gdp.pfp; $("#st-account-menu-pfp").href = gdp.myChanUrl; $("#st-account-menu-pfp").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: gdp.myChanId, canonicalBaseUrl: gdp.myChanUrl }, commandMetadata: { webCommandMetadata: { url: gdp.myChanUrl } } } } } } }); } function createCosmicGuide() { if ($("#appbar-guide-menu") && $(".show-guide") && $("#startube-guide-top-left") == null) { let container = $("#appbar-guide-menu"); let newElem = document.createElement("div"); newElem.id = "startube-guide-cosmic-section"; newElem.innerHTML = ` `; container.insertBefore(newElem, container.children[0]); let container2 = $(".guide-toplevel"); let newElem2 = document.createElement("div"); newElem2.id = "startube-guide-z-section"; newElem2.innerHTML = ` `; container2.insertBefore(newElem2, container2.children[0]); var theBtn = document.querySelector("#FEwhat_to_watch-guide-item"); var newHome = document.querySelector('#startube-guide-z-section .guide-channels-list'); newHome.insertBefore(theBtn, newHome.children[1]); if ($("#yt-masthead-user .yt-thumb-27 img")) { var theBtn = document.querySelector("#FEsubscriptions-guide-item"); var newHome = document.querySelector('#guide-channels').parentNode; newHome.insertBefore(theBtn, newHome.children[0]); var theBtn = document.querySelector("#guide-subscriptions-section"); var newHome = document.querySelector('.guide-toplevel'); newHome.insertBefore(theBtn, newHome.children[0]); let guideUrl = $(".guide-user-links .guide-channel[id^='UC'] a").getAttribute("href"); gdp.myChanUrl = guideUrl; let guideId = guideUrl.split("/channel/")[1]; gdp.myChanId = guideId; let guideUrlVids = guideUrl + "/videos"; $("#startube-guide-pfp img").src = gdp.pfp; $("#startube-guide-pfp").href = guideUrl; $("#st-g-my-channel").href = guideUrl; $("#st-g-my-videos").href = guideUrlVids; $("#recommended-guide-item").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: "FEwhat_to_watch", canonicalBaseUrl: "/feed/what_to_watch/recommended" }, commandMetadata: { webCommandMetadata: { url: "/feed/what_to_watch/recommended" } } } } } $("#startube-guide-browse-button").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: "FEguide_builder", canonicalBaseUrl: "/feed/guide_builder" }, commandMetadata: { webCommandMetadata: { url: "/feed/guide_builder" } } } } } $("#st-g-history").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: "FEhistory", canonicalBaseUrl: "/feed/history" }, commandMetadata: { webCommandMetadata: { url: "/feed/history" } } } } } $("#st-g-watch-later").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: "VLWL", canonicalBaseUrl: "/playlist?list=WL" }, commandMetadata: { webCommandMetadata: { url: "/playlist?list=WL" } } } } } $("#st-g-likes").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: "VLLL", canonicalBaseUrl: "/playlist?list=LL" }, commandMetadata: { webCommandMetadata: { url: "/playlist?list=LL" } } } } } $("#st-g-my-channel").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: guideId, canonicalBaseUrl: guideUrl }, commandMetadata: { webCommandMetadata: { url: guideUrl } } } } } $("#startube-guide-pfp").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: guideId, canonicalBaseUrl: guideUrl }, commandMetadata: { webCommandMetadata: { url: guideUrl } } } } } $("#st-g-my-videos").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: guideId, canonicalBaseUrl: guideUrlVids, params: "EgZ2aWRlb3PyBgQKAjoA" }, commandMetadata: { webCommandMetadata: { url: guideUrlVids } } } } } if ($("#FEsubscriptions-guide-item.startube") == null) { if ($("#FEsubscriptions-guide-item") != null) { $("#FEsubscriptions-guide-item .display-name span").textContent = "Subscriptions"; $("#FEsubscriptions-guide-item").classList.add("startube"); } } } else { $("#startube-guide-profile-section").style.display = "none"; } } } // EXfunct function doRichGridHome() { if ($("#page.home")) { let list = document.querySelectorAll(".yt-shelf-grid-item"); $("#content").classList.add("yt-rich-grid"); list.forEach(item => { if (item.querySelector(".yt-lockup-user-photo") == null) { let pfp; let data; let url; if (item.data.richItemRenderer) { pfp = item.data.richItemRenderer.content.gridVideoRenderer.contextItemData.authorAvatar; data = item.data.richItemRenderer.content.gridVideoRenderer.contextItemData.authorNavigationEndpoint; url = item.data.richItemRenderer.content.gridVideoRenderer.contextItemData.authorNavigationEndpoint.browseEndpoint.canonicalBaseUrl; } else if (item.data.compactVideoRenderer) { pfp = item.data.compactVideoRenderer.channelThumbnail.thumbnails[0].url; data = item.data.compactVideoRenderer.contextItemData.authorNavigationEndpoint; url = item.data.compactVideoRenderer.contextItemData.authorNavigationEndpoint.browseEndpoint.canonicalBaseUrl; } data = { abstractVorElement: { navigationEndpoint: data } } let container = item.querySelector(".yt-lockup-content"); let newElem = document.createElement("a"); newElem.setAttribute("class","yt-lockup-user-photo"); newElem.href = url; newElem.data = data; newElem.innerHTML = ` `; container.insertBefore(newElem, container.children[0]); container = item.querySelector(".yt-lockup-content"); newElem = document.createElement("div"); newElem.setAttribute("class","yt-lockup-details"); container.insertBefore(newElem, container.children[1]); let newHome = item.querySelector(".yt-lockup-details"); let toMove = item.querySelector(".yt-lockup-title"); let toMove2 = item.querySelector(".yt-lockup-meta"); newHome.appendChild(toMove); newHome.appendChild(toMove2); if (item.querySelector(".yt-lockup-badges")) { let toMove3 = item.querySelector(".yt-lockup-badges"); newHome.appendChild(toMove3); } item.classList.add("yt-rich-lockup-item"); } }); } } // EXfunct function doThirdColumnVideosPrep() { if ($(".feed")) { doThirdColumnVideos(); } else { if ($("[location='feed-recs']")) { var elm = ".feed"; waitForElement10(elm).then(function(elm) { if (canGo != false) { doThirdColumnVideos(); } }); } } } function doThirdColumnVideos() { if ($(".feed .branded-page-v2-secondary-col #startube-third-column") == null && $(".feed .branded-page-v2-secondary-col .branded-page-box")) { let container = $(".feed .branded-page-v2-secondary-col .branded-page-box"); let newElem = document.createElement("div"); newElem.id = "startube-third-column"; newElem.innerHTML = `

Trending

`; container.insertBefore(newElem, container.children[0]); if (gdp.thirdColVideos == null) { EXFetch("none","single","browse","browseId","FEtrending","params","6gQJRkVleHBsb3Jl").then(result => { fillThirdCol(result); gdp.thirdColVideos = result; }); } else { fillThirdCol(gdp.thirdColVideos); } } } function fillThirdCol(result) { let shelf = result.contents.twoColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents[3].itemSectionRenderer.contents[0].shelfRenderer.content.expandedShelfContentsRenderer.items; shelf.forEach(i => { if (i.videoRenderer) { createRenderer(i.videoRenderer, "thirdColCompactVideo"); } }); } // EXfunct function createUploadIcon() { if ($("#yt-masthead-content") && $("#startube-upload-icon") == null) { let container = $("#yt-masthead-content"); let newElem = document.createElement("a"); newElem.id = "startube-upload-icon"; newElem.setAttribute("class","startube-show-svgs yt-uix-tooltip"); newElem.setAttribute("title","Upload"); newElem.href = "/upload"; newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[2]); } } // EXfunct function createSearchTumor() { if ($("#yt-masthead-content") && $("#startube-search-tumor") == null) { let container = $("#masthead-search-terms"); let newElem = document.createElement("div"); newElem.id = "startube-search-tumor"; newElem.setAttribute("class","startube-svg thumb"); container.classList.add("startube-has-icon"); newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[0]); } } // EXfunct function createSearchIcon() { if ($("#yt-masthead-content") && $("#startube-search-icon") == null) { let container = $("#search-btn"); let newElem = document.createElement("div"); newElem.id = "startube-search-icon"; newElem.setAttribute("class","startube-svg thumb"); container.classList.add("startube-has-icon"); newElem.innerHTML = `
`; container.insertBefore(newElem, container.children[0]); } } // EXfunct function searchButtonLowercase() { if ($("#search-btn")) { $("#search-btn .run").textContent = "Search"; } } // EXfunct function createAozoraTopbarLinks() { if ($("#yt-masthead-content") && $("#aozora-topbar-links") == null) { let container = $("#yt-masthead-content"); let newElem = document.createElement("div"); newElem.id = "aozora-topbar-links"; newElem.setAttribute("class","flex-bar"); newElem.innerHTML = ` Browse Movies Upload `; container.insertBefore(newElem, container.children[2]); } } // EXfunct function changeCommentPlaceholder(n) { if ($("#page.watch") && $(".widget_bounds .yt-spinner-message") == null && $(".share.focus_caller.startube") == null) { var elm = ".focus_caller"; waitForElement10(elm).then(function(elm) { if (canGo != false && $("#page.watch")) { if (n == 1) { $(".share.focus_caller").textContent = "Add a public comment"; } else if (n == 0) { $(".share.focus_caller").textContent = "Add a comment"; } $(".share.focus_caller").classList.add("startube"); } }); } } // EXfunct function changeCommentHeader(n) { if ($("#page.watch") && $(".distiller_yt_headline.startube") == null) { var elm = ".distiller_yt_headline"; waitForElement10(elm).then(function(elm) { if (canGo != false && $("#page.watch")) { gdp.commentCount = $(".distiller_yt_headline span:nth-child(2)").textContent.split("(")[1].split(")")[0]; $(".distiller_yt_headline").innerHTML = ` Comments Comments `; $(".distiller_yt_headline .comment-count").textContent = gdp.commentCount; $(".distiller_yt_headline").classList.add("startube"); } }); } } // EXfunct function doCosmicFeedHeader() { if ($(".epic-feed-header") == null) { if ($("[location='feed-recs']")) { var elm = ".branded-page-v2-subnav-container"; waitForElement10(elm).then(function(elm) { if (canGo != false) { $(".branded-page-v2-subnav-container").innerHTML = `
From YouTube
`; } }); } if ($("[location='feed-subs']")) { var elm = ".branded-page-v2-subnav-container"; waitForElement10(elm).then(function(elm) { if (canGo != false) { $(".branded-page-v2-subnav-container").innerHTML = `
Subscriptions
`; } }); } } } // EXfunct function TheEXFetch(condition, type, endpoint, avar, id, modifier, modContent, modifier2, mod2Content) { if (type == "nomod") { //if (endpoint == "browse") { fetch("https://www.youtube.com/youtubei/v1/" + endpoint + "?key=AIzaSyDCU8hByM-4DrUqRUYnGn-3llEO78bcxq8", { "headers": { "accept": "application/json, text/plain, /", "accept-language": "en-US,en;q=0.9", "Content-type": "application/json", "sec-ch-ua-mobile": "?0", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "x-goog-authuser": "0", "x-origin": "https://www.youtube.com/" }, "referrer": "https://www.youtube.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": JSON.stringify({ "context": { "client": { "clientName": "TVHTML5", "clientVersion": "7.20240701.16.00", "hl": "en", "gl": "US" } }, [avar]: id }), "method": "POST", "mode": "cors", "credentials": "include" }).then(response => response.json()).then(data => { doChannelBanner(data); }); } } function EXFetch(condition, type, endpoint, avar, id, modifier, modContent, modifier2, mod2Content) { return new Promise((resolve, reject) => { if (condition) { if (type == "nomod") { //if (endpoint == "browse") { fetch("https://www.youtube.com/youtubei/v1/" + endpoint + "?key=AIzaSyDCU8hByM-4DrUqRUYnGn-3llEO78bcxq8", { "headers": { "accept": "application/json, text/plain, /", "accept-language": "en-US,en;q=0.9", "Content-type": "application/json", "sec-ch-ua-mobile": "?0", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "x-goog-authuser": "0", "x-origin": "https://www.youtube.com/" }, "referrer": "https://www.youtube.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": JSON.stringify({ "context": { "client": { "clientName": "TVHTML5", "clientVersion": "2.20240726.00.00", "hl": "en", "gl": "US" } }, [avar]: id }), "method": "POST", "mode": "cors", "credentials": "include" }).then(response => response.json()).then(data => { doChannelBanner(data); }); } if (type == "single") { //if (endpoint == "browse") { fetch("https://www.youtube.com/youtubei/v1/" + endpoint + "?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", { "headers": { "accept": "application/json, text/plain, /", "accept-language": "en-US,en;q=0.9", "Content-type": "application/json", "sec-ch-ua-mobile": "?0", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "x-goog-authuser": "0", "x-origin": "https://www.youtube.com/" }, "referrer": "https://www.youtube.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": JSON.stringify({ "context": { "client": { "clientName": "WEB", "clientVersion": "2.20240726.00.00", "hl": "en", "gl": "US" } }, [avar]: id, [modifier]: modContent }), "method": "POST", "mode": "cors", "credentials": "include" }).then(response => response.json()).then(data => { resolve(data); }); } if (type == "double") { //if (endpoint == "browse") { fetch("https://www.youtube.com/youtubei/v1/" + endpoint + "?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", { "headers": { "accept": "application/json, text/plain, /", "accept-language": "en-US,en;q=0.9", "Content-type": "application/json", "sec-ch-ua-mobile": "?0", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "x-goog-authuser": "0" }, "referrer": "https://www.youtube.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": JSON.stringify({ "context": { "client": { "clientName": "WEB", "clientVersion": "2.20240726.00.00", "hl": "en", "gl": "US" } }, [modifier]: modContent, [modifier2]: mod2Content }), "method": "POST", "mode": "cors", "credentials": "include" }).then(response => response.json()).then(data => { resolve(data); }); } if (type == "doubleLoggedIn") { //if (endpoint == "browse") { fetch("https://www.youtube.com/youtubei/v1/" + endpoint + "?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", { "headers": { "accept": "application/json, text/plain, /", "accept-language": "en-US,en;q=0.9", "authorization": aion, "Content-type": "application/json", "sec-ch-ua-mobile": "?0", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "x-goog-authuser": "0" }, "referrer": "https://www.youtube.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": JSON.stringify({ "context": { "client": { "clientName": "WEB", "clientVersion": "2.20240726.00.00", "hl": "en", "gl": "US" } }, [modifier]: modContent, [modifier2]: mod2Content }), "method": "POST", "mode": "cors", "credentials": "include" }).then(response => response.json()).then(data => { resolve(data); }); } // } } }); } // EXfunct var currPlaylistData = ""; var currChanData = ""; function getActiveTab(d) { return new Promise((resolve, reject) => { d.tabs.forEach(i => { if ( i.tabRenderer && i.tabRenderer.selected == true ) { if (i.tabRenderer.title == "" && i.tabRenderer.icon == "yt-uix-button-icon-c4-home") { resolve(i.tabRenderer.content.sectionListRenderer.contents); } if (i.tabRenderer.title == "Videos" && i.tabRenderer.richGridInfo) { resolve(i.tabRenderer.richGridInfo.contents[0].gridRenderer.items); } if (i.tabRenderer.title == "Feed" || i.tabRenderer.icon == "yt-uix-button-icon-c4-home-feed") { resolve(i.tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents); } if (i.tabRenderer.title == "Backstage" && i.tabRenderer.content) { resolve(i.tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents); } if (i.tabRenderer.title == "Playlists" && i.tabRenderer.content && i.tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].gridRenderer.items) { resolve(i.tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].gridRenderer.items); } } else if (i.expandableTabRenderer && i.expandableTabRenderer.content) { resolve(i.expandableTabRenderer.content.sectionListRenderer.contents); } }); }); } function numberWithCommas(x) { return x.toString().replace(/\B(? { gdp.currChan.content = result; }); } else { $("html").setAttribute("playlist-data-done","false"); let desc = "No description available."; let header = d.header.playlistHeaderRenderer; let name = header.ownerText.runs[1].text; let playlistName = header.title.simpleText; let viewCount = header.viewCountText.simpleText; let shortViewCount = viewCount.split(" v")[0]; let videoCount = header.briefStats[0].runs[0].text; let shortVideoCount = videoCount.split(" v")[0]; if (header.descriptionText && header.descriptionText.simpleText) { desc = header.descriptionText.simpleText.replaceAll("\n","
"); } let tvB = ""; /* if (gdp.currChan && lastId == id && c4h.banner) { tvB = gdp.currChan.header.tvBanner; } else if (c4h.banner) { if (c4h.tvBanner) { tvB = c4h.tvBanner.thumbnails; tvB.forEach(i => { tvB = i.url; }); } else { TheEXFetch(gdp.currChan == null,"nomod","browse","browseId",id); } } else { tvB = "none"; }*/ gdp.currPlaylist = { "title": playlistName, "viewCount": viewCount, "shortVideoCount": shortVideoCount, "shortViewCount": shortViewCount, "description": desc, "id": plId, "firstVideoId": firstVideoId }; gdp.currChan = { "currPage": "playlist", "id": id, "shortId": shortId, "header": { "name": name }, "sidebar": {} }; TheEXFetch(gdp.currChan == null,"nomod","browse","browseId",id); let test = await(d.newChannelInfoRequest.then(function(r) { $("html").setAttribute("channel-about-fetched","true"); gdp.currChan.header.subscribeButton = r.fullAboutObject.subscribeButton; if (r.fullAboutObject.videoCountText) { gdp.currChan.sidebar.videoCount = r.fullAboutObject.videoCountText; gdp.currChan.sidebar.shortVideoCount = r.fullAboutObject.videoCountText.split(" v")[0]; } else { gdp.currChan.sidebar.videoCount = "No videos"; gdp.currChan.sidebar.shortVideoCount = "0"; } if (r.fullAboutObject.viewCountText) { gdp.currChan.header.viewCount = r.fullAboutObject.viewCountText; gdp.currChan.header.shortViewCount = r.fullAboutObject.viewCountText.split(" v")[0]; } else { gdp.currChan.header.viewCount = "No views"; gdp.currChan.header.shortViewCount = "0"; } if (r.fullAboutObject.description) { gdp.currChan.sidebar.description = r.fullAboutObject.description.replaceAll("\n","
"); } if (r.avatar) { let avatar = r.avatar.split("=s")[0] + "=s108"; gdp.currChan.header.pfp = avatar; } gdp.currChan.header.subCount = numberWithCommas(r.subscriberCount); gdp.currChan.header.shortSubCount = numberWithCommas(r.subscriberCount); if (r.fullAboutObject.joinedDateText) { gdp.currChan.sidebar.joinedDate = r.fullAboutObject.joinedDateText.content; gdp.currChan.sidebar.shortJoinedDate = r.fullAboutObject.joinedDateText.content.split("d ")[1]; } else { gdp.currChan.sidebar.joinedDate = "Joined Dec 31, 1969"; gdp.currChan.sidebar.shortJoinedDate = "Dec 31, 1969"; } $("html").setAttribute("playlist-data-done","true"); return r.fullAboutObject; })); } } async function grabChannelData(x) { currChanData = $("#content").data.twoColumnBrowseResultsRenderer.items[0].brandedPageV2Renderer; let d = currChanData; let c4h = d.header.c4TabbedHeaderRenderer; let meta = d.metadata.channelMetadataRenderer; //let ncir = d.newChannelInfoRequest.value; let currPage = d.channelSubpage; let desc = meta.description; desc = desc.replaceAll("\n","
"); let name = meta.title; let pfp = meta.avatar.thumbnails[0].url; let id = meta.externalId; let shortId = id.split("UC")[1]; let lastId; if (gdp.currChan) { lastId = gdp.currChan.id; } if (lastId == id && x !== "x" && gdp.currChan.currPage !== "playlist") { gdp.currChan.content = ""; gdp.currChan.currPage = d.channelSubpage; getActiveTab(d).then(result => { gdp.currChan.content = result; }); } else { $("html").setAttribute("channel-about-fetched","false"); let tvB = ""; if (gdp.currChan && lastId == id && c4h.banner) { tvB = gdp.currChan.header.tvBanner; } else if (c4h.banner) { if (c4h.tvBanner) { tvB = c4h.tvBanner.thumbnails; tvB.forEach(i => { tvB = i.url; }); } else { TheEXFetch(gdp.currChan == null,"nomod","browse","browseId",id); /*EXFetch(gdp.currChan == null,"nomod","browse","browseId",id).then(result => { console.log(result); let thumbs = result.contents.tvBrowseRenderer.content.tvSurfaceContentRenderer.header.channelHeaderRenderer.backgroundImage.thumbnails; let thumbsL = thumbs.length - 1; tvB = thumbs[thumbsL].url; console.log(tvB); gdp.currChan.header.tvBanner = tvB; if ($("#page.channel")) { $("html").style.setProperty("--tvbg",'no-repeat url(' + tvB + ')'); } });*/ } } else { tvB = "none"; } //let aboutChan = c4h.tagline.channelTaglineRenderer.moreEndpoint.showEngagementPanelEndpoint.engagementPanel.engagementPanelSectionListRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].continuationItemRenderer.continuationEndpoint.continuationCommand.token; gdp.currChan = { "id": id, "shortId": shortId, "currPage": currPage, "header": { "name": name, "pfp": pfp, "banner": "", "tvBanner": tvB }, "sidebar": { "description": desc } }; getActiveTab(d).then(result => { gdp.currChan.content = result; }); let test = await(d.newChannelInfoRequest.then(function(r) { $("html").setAttribute("channel-about-fetched","true"); gdp.currChan.header.subscribeButton = r.fullAboutObject.subscribeButton; if (r.fullAboutObject.videoCountText) { gdp.currChan.sidebar.videoCount = r.fullAboutObject.videoCountText; gdp.currChan.sidebar.shortVideoCount = r.fullAboutObject.videoCountText.split(" v")[0]; } else { gdp.currChan.sidebar.videoCount = "No videos"; gdp.currChan.sidebar.shortVideoCount = "0"; } if (r.fullAboutObject.viewCountText) { gdp.currChan.header.viewCount = r.fullAboutObject.viewCountText; gdp.currChan.header.shortViewCount = r.fullAboutObject.viewCountText.split(" v")[0]; } else { gdp.currChan.header.viewCount = "No views"; gdp.currChan.header.shortViewCount = "0"; } gdp.currChan.header.subCount = numberWithCommas(r.subscriberCount); gdp.currChan.header.shortSubCount = numberWithCommas(r.subscriberCount); if (r.fullAboutObject.joinedDateText) { gdp.currChan.sidebar.joinedDate = r.fullAboutObject.joinedDateText.content; gdp.currChan.sidebar.shortJoinedDate = r.fullAboutObject.joinedDateText.content.split("d ")[1]; } else { gdp.currChan.sidebar.joinedDate = "Joined Dec 31, 1969"; gdp.currChan.sidebar.shortJoinedDate = "Dec 31, 1969"; } return r.fullAboutObject; })); } } function doChannelBanner(result) { let thumbs = result.contents.tvBrowseRenderer.content.tvSurfaceContentRenderer.header.channelHeaderRenderer.backgroundImage.thumbnails; let thumbsL = thumbs.length - 1; let tvB = thumbs[thumbsL].url; gdp.currChan.header.tvBanner = tvB; $("html").style.setProperty("--tvbg",'no-repeat url(' + tvB + ')'); } // EXfunct async function createChannels3Prep() { if ($("#page.channel")) { createChannels3(); } else { if ($("[playlist-data-done='true']")) { createChannels3(); } else { var elm = "[playlist-data-done='true']"; waitForElement10(elm).then(function(elm) { if (canGo != false) { createChannels3(); } }); } } } // EXfunct async function createChannels3() { if ($("#c3-sidebar") == null) { if ($("#page.channel") || $("[location='playlist']")) { let version; if ($("#page.channel")) { version = "channel"; } else { version = "playlist"; } let container = $("#content"); let newElem = document.createElement("div"); newElem.id = "c3-container"; newElem.innerHTML = ` `; container.insertBefore(newElem,container.children[0]); //$("#content").style.background = "repeat-y url(" + gdp.currChan.header.tvBanner + ")"; $("html").style.setProperty("--tvbg",'no-repeat url(' + gdp.currChan.header.tvBanner + ')'); const img = new Image(); img.onload = function() { $("html").style.setProperty("--tvbanner-width",this.width + "px"); } $("#c3-channel-pfp img").src = gdp.currChan.header.pfp; $("#c3-channel-name .c3-name").textContent = gdp.currChan.header.name; $("#c3-channel-name .c3-name-link").textContent = gdp.currChan.header.name; if (version == "playlist") { $("#c3-playlist-title span").textContent = gdp.currPlaylist.title; $(".c3-playall a").href = "/watch?v=" + gdp.currPlaylist.firstVideoId + "&list=" + gdp.currPlaylist.id; } img.src = gdp.currChan.header.tvBanner; if ($(".c4-module-is-editable") == null) { var elm = "#c4-primary-header-contents .yt-uix-button-subscription-container"; waitForElement10(elm).then(function(elm) { if (canGo != false) { let btn = $("#c4-primary-header-contents .yt-uix-button-subscription-container"); let newHome = $("#st-space"); if (btn !== null) { newHome.append(btn); btn = $("#st-space .yt-uix-button-subscription-container"); if (version == "channel") { newHome = $("#c3-subscribe"); } else { newHome = $("#c3-sidebar-subscribe"); } newHome.append(btn); } } }); } if ($(".c4-player-container")) { var elm = ".video-player-view-component video"; waitForElement10(elm).then(function(elm) { if (canGo != false) { //$(".c4-player-container video").remove(); let btn = $(".video-player-view-component"); let newHome = $("#st-space"); if (btn !== null) { newHome.append(btn); btn = $("#st-space .video-player-view-component"); newHome = $("#c3-featured-slot"); newHome.append(btn); } } }); } if (version == "playlist") { var elm = ".pl-video-list"; waitForElement10(elm).then(function(elm) { if (canGo != false) { //$(".c4-player-container video").remove(); let btn = $(".pl-video-list"); let newHome = $("#st-space"); if (btn !== null) { newHome.append(btn); btn = $("#st-space .pl-video-list"); newHome = $("#c3-content-items"); newHome.append(btn); } } }); } switch (gdp.currChan.currPage) { case "featured": $("#c3-featured-tab").classList.add("active"); break; case "videos": $("#c3-videos-tab").classList.add("active"); $("#c3-uploads-nav").classList.add("active"); $(".c3").classList.add("is-videos"); fillC3Page("videos"); break; case "playlists": $("#c3-videos-tab").classList.add("active"); $("#c3-playlists-nav").classList.add("active"); $(".c3").classList.add("is-videos"); fillC3Page("playlists"); break; case "community": $("#c3-feed-tab").classList.add("active"); $("#c3-backstage-nav").classList.add("active"); $(".c3").classList.add("is-feed"); fillC3Page("backstage"); break; case "feed": $("#c3-feed-tab").classList.add("active"); $(".c3").classList.add("is-feed"); break; case "search": $("#c3-search").classList.add("active"); $(".c3").classList.add("is-search"); fillC3Page("search"); break; case "about": $("#c3-featured-tab").classList.add("active"); $(".c3").classList.add("is-home"); break; case "playlist": $(".c3").classList.add("is-playlist"); fillC3Page("playlist"); break; default: } if ($('[channel-location="feed"]')) { $("#c3-feed-tab").classList.add("active"); $("#c3-activity-nav").classList.add("active"); $("#c3-featured-tab").classList.remove("active"); $(".c3").classList.add("is-feed"); fillC3Page("feed"); } if ($('[channel-location="home"]')) { $("#c3-featured-tab").classList.add("active"); $(".c3").classList.add("is-home"); fillC3Page("home"); } let homeData = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: gdp.currChan.id, canonicalBaseUrl: "/channel/" + gdp.currChan.id }, commandMetadata: { webCommandMetadata: { url: "/channel/" + gdp.currChan.id } } } } } $("#c3-channel-pfp").data = homeData; $(".c3-name-link").data = homeData; $("#c3-featured-tab").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: gdp.currChan.id, canonicalBaseUrl: "/channel/" + gdp.currChan.id + "/featured" }, commandMetadata: { webCommandMetadata: { url: "/channel/" + gdp.currChan.id + "/featured" } } } } } let c3FeedData = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: gdp.currChan.id, canonicalBaseUrl: "/channel/" + gdp.currChan.id + "/feed", params: "EghmZWF0dXJlZPIGBAoCMgA%3D" }, commandMetadata: { webCommandMetadata: { url: "/channel/" + gdp.currChan.id + "/feed" } } } } } let c3VidsData = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: gdp.currChan.id, canonicalBaseUrl: "/channel/" + gdp.currChan.id + "/videos?view=0", params: "EgZ2aWRlb3PyBgQKAjoA" }, commandMetadata: { webCommandMetadata: { url: "/channel/" + gdp.currChan.id + "/videos?view=0" } } } } } $("#c3-playlists-nav").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: gdp.currChan.id, canonicalBaseUrl: "/channel/" + gdp.currChan.id + "/playlists", params: "EglwbGF5bGlzdHPyBgQKAkIA" }, commandMetadata: { webCommandMetadata: { url: "/channel/" + gdp.currChan.id + "/playlists" } } } } } $("#c3-backstage-nav").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: gdp.currChan.id, canonicalBaseUrl: "/channel/" + gdp.currChan.id + "/community", params: "Egljb21tdW5pdHnyBgQKAkoA" }, commandMetadata: { webCommandMetadata: { url: "/channel/" + gdp.currChan.id + "/community" } } } } } $("#c3-videos-tab").data = c3VidsData; $("#c3-uploads-nav").data = c3VidsData; $("#c3-feed-tab").data = c3FeedData; $("#c3-activity-nav").data = c3FeedData; if ($("[channel-about-fetched='true']")) { fillC3Blanks(); } else { var elm = "[channel-about-fetched='true']"; waitForElement10(elm).then(function(elm) { if (canGo != false) { fillC3Blanks(); } }); } } } } function fillC3Page(page, n, api) { let number; if (n == null) { number = 0; } else { number = n; } if (page == "search") { gdp.currChan.content.forEach(i => { if (i.itemSectionRenderer) { if (i.itemSectionRenderer.contents[0].videoRenderer) { createRenderer(i.itemSectionRenderer.contents[0].videoRenderer, "channelGridVideo", number, gdp.currChan.content.length); } } number++; }); } if (page == "playlist") { let container = $("#c3-content-header"); let newElem = document.createElement("div"); newElem.classList = "c3-playlist-desc"; newElem.innerHTML = ` ${gdp.currPlaylist.description} `; container.insertBefore(newElem,container.children[0]); } if (page == "videos") { gdp.currChan.content.forEach(i => { if (i.richItemRenderer) { i = i.richItemRenderer.content.videoRenderer; let i2 = i.contextItemData; let href; let viewCount; let publishDate; let title; let thumbnail = i.thumbnail.thumbnails[0].url; if (api == "innertube") { href = i.navigationEndpoint.commandMetadata.webCommandMetadata.url; viewCount = i.viewCountText.simpleText; publishDate = i.publishedTimeText.simpleText; title = i.title.runs[0].text; } else { href = i2.href; viewCount = i2.viewCount; publishDate = i2.publishDate; title = i2.title; } if (i.thumbnail.thumbnails[3]) { thumbnail = i.thumbnail.thumbnails[3].url; } let container = $("#c3-content-items"); let newElem = document.createElement("div"); newElem.classList = "channels-content-item yt-shelf-grid-item"; newElem.innerHTML = `

${title}

  • ${viewCount}
  • ${publishDate}
`; container.insertBefore(newElem,container.children[number]); newElem.querySelector(".yt-uix-sessionlink").setAttribute("title",title); newElem.querySelector("a").data = { abstractVorElement: { navigationEndpoint: { watchEndpoint: { videoId: i.videoId, canonicalBaseUrl: href }, commandMetadata: { webCommandMetadata: { url: href } } } } }; newElem.querySelectorAll("a")[1].data = { abstractVorElement: { navigationEndpoint: { watchEndpoint: { videoId: i.videoId, canonicalBaseUrl: href }, commandMetadata: { webCommandMetadata: { url: href } } } } }; } if (i.continuationItemRenderer) { //continuationEndpoint.continuationCommand let container = $("#c3-content-items"); let newElem = document.createElement("div"); newElem.classList = "c3-continuation"; newElem.innerHTML = ` `; container.insertBefore(newElem,container.children[number]); if (!window.location.href.includes("view=0")) { $(".c3-continuation button").setAttribute("disabled",""); $(".c3-continuation .run").textContent = "Please go to /videos?view=0 to load more videos."; } else { newElem.querySelector("button").addEventListener("click", function() { let key = i.continuationItemRenderer.continuationEndpoint.continuationCommand.token; if (gdp.loggedIn == true) { EXFetch("none","doubleLoggedIn","browse","browseId",gdp.currChan.id,"params","EghjaGFubmVsc_IGBAoCUgA%3D","continuation",key).then(result => { newElem.remove(); gdp.currChan.content = result.onResponseReceivedActions[0].appendContinuationItemsAction.continuationItems; fillC3Page("videos",number,"innertube"); }); } else { EXFetch("none","double","browse","browseId",gdp.currChan.id,"params","EghjaGFubmVsc_IGBAoCUgA%3D","continuation",key).then(result => { newElem.remove(); gdp.currChan.content = result.onResponseReceivedActions[0].appendContinuationItemsAction.continuationItems; fillC3Page("videos",number,"innertube"); }); } }); } } number++; }); if ($("#c3-content-items .c3-loading")) { $("#c3-content-items .c3-loading").remove(); } } if (page == "playlists") { gdp.currChan.content.forEach(i => { if (i.gridPlaylistRenderer) { i = i.gridPlaylistRenderer; //console.log(i); let i2 = i.contextItemData; let href; let videoId; if (i2 == null) { href = i.navigationEndpoint.commandMetadata.webCommandMetadata.url; videoId = i.navigationEndpoint.watchEndpoint.videoId; } else { href = i2.href; videoId = i.originalNavigationEndpoint.watchEndpoint.videoId; } let container = $("#c3-content-items"); let newElem = document.createElement("div"); newElem.classList = "channels-content-item yt-shelf-grid-item"; newElem.innerHTML = ` `; container.insertBefore(newElem,container.children[number]); let numberT = 0; newElem.querySelector(".yt-pl-thumb-link").data = { abstractVorElement: { navigationEndpoint: { watchEndpoint: { videoId: videoId, playlistId: i.playlistId, canonicalBaseUrl: href }, commandMetadata: { webCommandMetadata: { url: href } } } } } newElem.querySelector(".yt-uix-sessionlink").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: "VL" + i.playlistId }, commandMetadata: { webCommandMetadata: { url: "/playlist?list=" + i.playlistId } } } } } if (i.sidebarThumbnails) { i.sidebarThumbnails.forEach(xl => { if (xl.empty == null) { newElem.querySelectorAll(".sidethumb img")[numberT].src = xl.thumbnails[0].url; } else { newElem.querySelectorAll(".sidethumb")[numberT].classList.add("empty"); } numberT++; }); } else { newElem.querySelectorAll(".sidethumb").forEach(c => { c.classList.add("empty"); }); } //i.sidebarThumbnails[0].thumbnails[0].url ?? null } if (i.continuationItemRenderer) { let container = $("#c3-content-items"); let newElem = document.createElement("div"); newElem.classList = "c3-continuation"; newElem.innerHTML = ` `; container.insertBefore(newElem,container.children[number]); newElem.querySelector("button").addEventListener("click", function() { let key = i.continuationItemRenderer.continuationEndpoint.continuationCommand.token; if (gdp.loggedIn == true) { EXFetch("none","doubleLoggedIn","browse","browseId",gdp.currChan.id,"params","EghjaGFubmVsc_IGBAoCUgA%3D","continuation",key).then(result => { newElem.remove(); gdp.currChan.content = result.onResponseReceivedActions[0].appendContinuationItemsAction.continuationItems; fillC3Page("playlists",number,"innertube"); }); } else { EXFetch("none","double","browse","browseId",gdp.currChan.id,"params","EghjaGFubmVsc_IGBAoCUgA%3D","continuation",key).then(result => { newElem.remove(); gdp.currChan.content = result.onResponseReceivedActions[0].appendContinuationItemsAction.continuationItems; fillC3Page("playlists",number,"innertube"); }); } }); } number++; }); } if (page == "feed") { gdp.currChan.content.forEach(i => { if (i.__DOM_REFERENCE && i.feedItemRenderer) { setTimeout(function() { createFeedItem(i, number, "feed"); }, 500); } else if (i.continuationItemRenderer) { setTimeout(function() { //createFeedItem(i, number, "cont"); }, 1000); } else if (i.continuationItemRenderer == null) { setTimeout(function() { createFeedItem(i, number, "feed"); }, 1250); } number++; }); } if (page == "backstage") { let container = $("#c3-content-items"); let newElem = document.createElement("div"); newElem.classList = "c3-warning-banner"; newElem.id = "c3-backstage-warning"; newElem.innerHTML = `
Alert icon
`; container.insertBefore(newElem,container.children[number]); $("#c3-backstage-warning .close").addEventListener("click", function() { $("#c3-backstage-warning").remove(); }); $("#c3-redir").href = "/channel/" + gdp.currChan.id + "/community?force-c4"; $("#c3-redir").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: gdp.currChan.id, canonicalBaseUrl: "/channel/" + gdp.currChan.id + "/community?force-c4", params: "Egljb21tdW5pdHnyBgQKAkoA" }, commandMetadata: { webCommandMetadata: { url: "/channel/" + gdp.currChan.id + "/community?force-c4" } } } } }; gdp.currChan.content.forEach(i => { if (i.__DOM_REFERENCE && i.backstagePostThreadRenderer) { setTimeout(function() { createBackstagePost(i, number); }, 500); } number++; }); } if (page == "home") { EXFetch("none","single","browse","browseId",gdp.currChan.id,"params","EgZ2aWRlb3PyBgQKAjoA").then(result => { buildFeaturedList(result.contents.twoColumnBrowseResultsRenderer.tabs[1].tabRenderer.content.richGridRenderer.contents, number); }); gdp.currChan.content.forEach(i => { if (i.itemSectionRenderer) { if (i.itemSectionRenderer.contents[0].channelFeaturedContentRenderer) { buildFeaturedContent(i.itemSectionRenderer.contents[0].channelFeaturedContentRenderer, number); } if (i.itemSectionRenderer.contents[0].channelVideoPlayerRenderer) { //buildChannelPlayer(i.itemSectionRenderer.contents[0].channelVideoPlayerRenderer, number); } if ( i.itemSectionRenderer.contents[0].shelfRenderer && i.itemSectionRenderer.contents[0].shelfRenderer.content.horizontalListRenderer && i.itemSectionRenderer.contents[0].shelfRenderer.content.horizontalListRenderer.items[0].gridChannelRenderer ) { var elm = "#c3-featured-channels-slot"; waitForElement10(elm).then(function(elm) { if (canGo != false) { buildFeaturedChannels(i.itemSectionRenderer.contents[0].shelfRenderer, number); } }); } if ( i.itemSectionRenderer.contents[0].shelfRenderer && i.itemSectionRenderer.contents[0].shelfRenderer.content.horizontalListRenderer && i.itemSectionRenderer.contents[0].shelfRenderer.content.horizontalListRenderer.items[0].gridPlaylistRenderer ) { var elm = "#c3-featured-playlists-slot"; waitForElement10(elm).then(function(elm) { if (canGo != false) { buildFeaturedPlaylists(i.itemSectionRenderer.contents[0].shelfRenderer, number); } }); } } /*if (i.__DOM_REFERENCE.classList[6] == "expanded-shelf-content-list") { buildFeaturedList(i.itemSectionRenderer.contents[0].shelfRenderer.content, number); }*/ number++; }); } } function buildChannelPlayer(Bdata, number) { let id = Bdata.videoId; let container = $("#c3-featured-slot"); let newElem = document.createElement("div"); newElem.classList = "c3-featured-content"; newElem.id = "c3-player-container"; newElem.innerHTML = `
`; container.insertBefore(newElem,container.children[0]); /*let href = newElem.querySelector(".yt-lockup-title a").href; let id = href.split("/watch?v=")[1]; let data = { abstractVorElement: { navigationEndpoint: { watchEndpoint: { videoId: id, canonicalBaseUrl: href }, commandMetadata: { webCommandMetadata: { url: href } } } } }; let authorHref = newElem.querySelector(".yt-user-name").href; let authorId = authorHref.split("/channel/")[1]; let authorData = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: authorId, canonicalBaseUrl: authorHref }, commandMetadata: { webCommandMetadata: { url: authorHref } } } } }; newElem.querySelector(".yt-lockup-title a").data = data; newElem.querySelector(".yt-lockup-thumbnail a").data = data; newElem.querySelector(".yt-user-name").data = authorData;*/ } function buildFeaturedList(Bdata, number) { if ($(".c3-featured-list") == null) { let container = $("#c3-content-items"); let newElem = document.createElement("div"); newElem.classList = "c3-featured-list"; newElem.innerHTML = ` `; container.insertBefore(newElem,container.children[0]); /*let featuredList = Bdata.horizontalListRenderer.items; let newNumber = 0; featuredList.forEach(i => { if (i.gridVideoRenderer) { buildFeaturedContent(i.gridVideoRenderer, "bigListVideo", umber); } newNumber++; });*/ let newNumber = 0; Bdata.forEach(i => { if (i.richItemRenderer) { createRenderer(i.richItemRenderer.content.videoRenderer, "bigListVideo", newNumber, Bdata.length); } newNumber++; }); } } function buildFeaturedChannels(Bdata, number) { if ($(".c3-featured-channels") == null) { let title = Bdata.title.runs[0].text; let list = Bdata.content.horizontalListRenderer.items; let container = $("#c3-featured-channels-slot"); let newElem = document.createElement("div"); newElem.classList = "c3-featured-channels"; newElem.innerHTML = `
${title}
`; container.insertBefore(newElem,container.children[0]); let newNumber = 0; list.forEach(i => { if (i.gridChannelRenderer) { createRenderer(i.gridChannelRenderer, "featuredChannel", newNumber); } newNumber++; }); } } function buildFeaturedPlaylists(Bdata, number) { if ($(".c3-featured-playlists") == null) { let title = Bdata.title.runs[0].text; let list = Bdata.content.horizontalListRenderer.items; let container = $("#c3-featured-playlists-slot"); let newElem = document.createElement("div"); newElem.classList = "c3-featured-playlists"; newElem.innerHTML = `
${title}
`; container.insertBefore(newElem,container.children[0]); let newNumber = 0; list.forEach(i => { if (i.gridPlaylistRenderer) { createRenderer(i.gridPlaylistRenderer, "featuredPlaylist", newNumber); } newNumber++; }); } } function createRenderer(Bdata, renderer, number, length) { if (number == null) { number = 0; } let i = Bdata; if (renderer == "thirdColCompactVideo") { let id = i.navigationEndpoint.watchEndpoint.videoId; let href = "/watch?v=" + id; let date = i.publishedTimeText.simpleText; let viewCount = i.viewCountText.simpleText; let owner = i.ownerText.runs[0].text; let container = $("#thirdcol-videos"); let title = i.title.runs[0].text; let time = i.lengthText.simpleText; let thumbnail = i.thumbnail.thumbnails[2].url; let newElem = document.createElement("li"); newElem.classList = "thirdcol-video video-list-item related-list-item context-data-item"; newElem.innerHTML = ` Thumbnail ${time} ${title} by ${owner}${viewCount}${date} `; container.insertBefore(newElem,container.children[number]); newElem.querySelector("a").data = { abstractVorElement: { navigationEndpoint: { watchEndpoint: { videoId: id, canonicalBaseUrl: href }, commandMetadata: { webCommandMetadata: { url: href } } } } }; } if (renderer == "channelGridVideo") { let i2 = i.contextItemData; let href; let viewCount; let publishDate; let title; let thumbnail = i.thumbnail.thumbnails[0].url; href = i2.href; viewCount = i2.viewCount; publishDate = i2.publishDate; title = i2.title; if (i.thumbnail.thumbnails[3]) { thumbnail = i.thumbnail.thumbnails[3].url; } let container = $("#c3-content-items"); let newElem = document.createElement("div"); newElem.classList = "channels-content-item yt-shelf-grid-item"; newElem.innerHTML = `

${title}

  • ${viewCount}
  • ${publishDate}
`; container.insertBefore(newElem,container.children[number]); newElem.querySelector(".yt-uix-sessionlink").setAttribute("title",title); newElem.querySelector("a").data = { abstractVorElement: { navigationEndpoint: { watchEndpoint: { videoId: i.videoId, canonicalBaseUrl: href }, commandMetadata: { webCommandMetadata: { url: href } } } } }; newElem.querySelectorAll("a")[1].data = { abstractVorElement: { navigationEndpoint: { watchEndpoint: { videoId: i.videoId, canonicalBaseUrl: href }, commandMetadata: { webCommandMetadata: { url: href } } } } }; } if (renderer == "featuredPlaylist") { let id = i.contextItemData.playlistId; let href = "/playlist?list=" + id; let href2 = i.contextItemData.href; let author = i.contextItemData.authorNavigationEndpoint.browseEndpoint.browseId; let href3 = "/channel/" + author; let videoId = href2.split("v=")[1].split("&")[0]; let thumb1 = i.thumbnail.thumbnails[0].url; let vidCount = i.videoCountShortText.simpleText; let title = i.title.runs[0].text; let byline = i.contextItemData.byLine; let container = $("#c3-featured-playlists-slot .c3-sidebar-content"); let newElem = document.createElement("div"); newElem.classList = "c3-featured-playlist c3-playlist"; newElem.innerHTML = `
Play all
(${vidCount})
${vidCount}
videos
`; container.insertBefore(newElem,container.children[number]); newElem.querySelector(".c3-playlist-thumbnails").data = { abstractVorElement: { navigationEndpoint: { watchEndpoint: { videoId: videoId, playlistId: i.contextItemData.playlistId, canonicalBaseUrl: href2 }, commandMetadata: { webCommandMetadata: { url: href2 } } } } } newElem.querySelector(".c3-playlist-title").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: "VL" + id }, commandMetadata: { webCommandMetadata: { url: href } } } } } newElem.querySelector(".c3-playlist-byline").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: author, canonicalBaseUrl: href3 }, commandMetadata: { webCommandMetadata: { url: href3 } } } } } if (vidCount == 1) { newElem.querySelector(".c3-videos-string").textContent = "video"; } let numberT = 0; if (i.sidebarThumbnails) { i.sidebarThumbnails.forEach(xl => { if (xl.empty == null && newElem.querySelectorAll(".c3-sidethumb:not(.c3-first-thumb)")[numberT]) { newElem.querySelectorAll(".c3-sidethumb:not(.c3-first-thumb) img")[numberT].src = xl.thumbnails[0].url; } else if (newElem.querySelectorAll(".c3-sidethumb:not(.c3-first-thumb)")[numberT]) { newElem.querySelectorAll(".c3-sidethumb:not(.c3-first-thumb)")[numberT].classList.add("empty"); newElem.classList.add("c3-not-full-playlist"); } numberT++; }); } else { newElem.querySelectorAll(".c3-sidethumb:not(.c3-first-thumb)").forEach(c => { c.classList.add("empty"); }); newElem.classList.add("c3-not-full-playlist"); } } if (renderer == "featuredChannel") { let container = $("#c3-featured-channels-slot .c3-sidebar-content"); let newElem = document.createElement("div"); newElem.classList = "c3-featured-channel"; newElem.innerHTML = ` ${i.title.simpleText} ${i.subscriberCountText.simpleText} `; container.insertBefore(newElem,container.children[number]); newElem.querySelector("a").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: i.channelId, canonicalBaseUrl: "/channel/" + i.channelId }, commandMetadata: { webCommandMetadata: { url: "/channel/" + i.channelId } } } } }; } if (renderer == "bigListVideo") { let desc = ""; let id = i.navigationEndpoint.watchEndpoint.videoId; if (i.descriptionSnippet) { desc = i.descriptionSnippet.runs[0].text; } let container = $(".c3-featured-list-items"); let newElem = document.createElement("div"); newElem.classList = "c3-featured-list-item"; newElem.innerHTML = `
  • Thumbnail
${i.title.runs[0].text} ${gdp.currChan.header.name} ${i.viewCountText.simpleText} ${i.publishedTimeText.simpleText} ${desc}
  • `; container.insertBefore(newElem,container.children[number]); newElem.querySelector(".video-overview").setAttribute("title",i.title.runs[0].text); newElem.querySelector("a").data = { abstractVorElement: { navigationEndpoint: { watchEndpoint: { videoId: id, canonicalBaseUrl: "/watch?v=" + id }, commandMetadata: { webCommandMetadata: { url: "/watch?v=" + id } } } } }; if (number == 0) { if (length == 31) { length = 30; } var elm = "[channel-about-fetched='true']"; waitForElement10(elm).then(function(elm) { if (canGo != false && $(".c3-featured-header") == null) { container = $("#c3-content-header"); newElem = document.createElement("div"); newElem.classList = "c3-featured-header"; newElem.innerHTML = `
    `; container.insertBefore(newElem,container.children[0]); newElem.querySelector("a").data = { abstractVorElement: { navigationEndpoint: { watchEndpoint: { videoId: id, playlistId: "UU" + gdp.currChan.shortId, canonicalBaseUrl: "/watch?v=" + id + "&list=UU" + gdp.currChan.shortId }, commandMetadata: { webCommandMetadata: { url: "/watch?v=" + id + "&list=UU" + gdp.currChan.shortId } } } } } } }); } } } function buildFeaturedContent(Bdata, number) { let html = Bdata.items[1].__DOM_REFERENCE.outerHTML; let container = $("#c3-featured-slot"); let newElem = document.createElement("div"); newElem.classList = "c3-featured-content"; newElem.innerHTML = html; container.insertBefore(newElem,container.children[0]); var elm = ".c3-featured-content"; waitForElement10(elm).then(function(elm) { if (canGo != false) { let href = newElem.querySelector(".yt-lockup-title a").href; let id = href.split("/watch?v=")[1]; let data = { abstractVorElement: { navigationEndpoint: { watchEndpoint: { videoId: id, canonicalBaseUrl: href }, commandMetadata: { webCommandMetadata: { url: href } } } } }; let authorHref = newElem.querySelector(".g-hovercard .run-link").href; let authorId = authorHref.split("/channel/")[1]; let authorData = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: authorId, canonicalBaseUrl: authorHref }, commandMetadata: { webCommandMetadata: { url: authorHref } } } } }; newElem.querySelector(".yt-lockup-title a").data = data; newElem.querySelector(".yt-lockup-thumbnail a").data = data; newElem.querySelector(".g-hovercard .run-link").data = authorData; } }); } function createFeedItem(i, number, type) { let html = i.__DOM_REFERENCE.outerHTML; let container = $("#c3-content-items"); let newElem = document.createElement("div"); newElem.classList = "c3-feed-item"; newElem.innerHTML = html; container.insertBefore(newElem,container.children[number]); setTimeout(function() { if (type == "feed") { if (newElem.querySelector(".yt-lockup-title a")) { let href = newElem.querySelector(".yt-lockup-title a").href; let id = href.split("/watch?v=")[1]; let data = { abstractVorElement: { navigationEndpoint: { watchEndpoint: { videoId: id, canonicalBaseUrl: href }, commandMetadata: { webCommandMetadata: { url: href } } } } }; newElem.querySelector(".yt-lockup-title a").data = data; newElem.querySelector(".yt-lockup-thumbnail a").data = data; } let authorHref = newElem.querySelector(".feed-author-bubble").href; let authorId = authorHref.split("/channel/")[1]; let authorData = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: authorId, canonicalBaseUrl: authorHref }, commandMetadata: { webCommandMetadata: { url: authorHref } } } } }; newElem.querySelector(".feed-author-bubble").data = authorData; newElem.querySelector(".yt-user-name").data = authorData; } }, 100); } function createBackstagePost(i, number) { let html = i.__DOM_REFERENCE.outerHTML; let container = $("#c3-content-items"); let newElem = document.createElement("div"); newElem.classList = "c3-backstage"; newElem.innerHTML = html; container.insertBefore(newElem,container.children[number]); } function fillC3Blanks() { $("#c3-header-meta").innerHTML = `
    ${gdp.currChan.header.shortSubCount} subscribers
    ${gdp.currChan.header.shortViewCount} video views
    videos
    views
    `; if (gdp.currPlaylist) { $("#c3-pl-view-count span").textContent = gdp.currPlaylist.shortViewCount; $("#c3-pl-video-count span").textContent = gdp.currPlaylist.shortVideoCount; } $("#c3-sidebar").innerHTML = `
    About ${gdp.currChan.header.name}
    ${gdp.currChan.sidebar.description}
    Date Joined
    ${gdp.currChan.sidebar.shortJoinedDate}
    Location
    ${gdp.currChan.sidebar.country}
    Uploads
    ${gdp.currChan.sidebar.videoCount}
    `; if (gdp.currChan.currPage == "videos") { $("#c3-content-header").innerHTML = `
    Uploaded Videos (${gdp.currChan.sidebar.shortVideoCount})
    `; let rgi = $("#content").data.twoColumnBrowseResultsRenderer.items[0].brandedPageV2Renderer.tabs[1].tabRenderer.richGridInfo; let chipBar0 = rgi.header.feedFilterChipBarRenderer.contents[0].chipCloudChipRenderer.navigationEndpoint.continuationCommand.token; let chipBar1 = rgi.header.feedFilterChipBarRenderer.contents[1].chipCloudChipRenderer.navigationEndpoint.continuationCommand.token; let chipBar2 = rgi.header.feedFilterChipBarRenderer.contents[2].chipCloudChipRenderer.navigationEndpoint.continuationCommand.token; if (!window.location.href.includes("view=0")) { } else { $("#c3-sort-popular").addEventListener("click", function() { $("#c3-content-items").innerHTML = `

    Loading...

    `; $("#c3-filter-dropdown").setAttribute("state","popular"); $("#c3-filter-menu").setAttribute("state","popular"); let key = chipBar1; if (gdp.loggedIn == true) { EXFetch("none","doubleLoggedIn","browse","browseId",gdp.currChan.id,"params","EghjaGFubmVsc_IGBAoCUgA%3D","continuation",key).then(result => { gdp.currChan.content = result.onResponseReceivedActions[1].reloadContinuationItemsCommand.continuationItems; fillC3Page("videos",0,"innertube"); }); } else { EXFetch("none","double","browse","browseId",gdp.currChan.id,"params","EghjaGFubmVsc_IGBAoCUgA%3D","continuation",key).then(result => { gdp.currChan.content = result.onResponseReceivedActions[1].reloadContinuationItemsCommand.continuationItems; fillC3Page("videos",0,"innertube"); }); } }); $("#c3-sort-newest").addEventListener("click", function() { $("#c3-filter-dropdown").setAttribute("state","newest"); $("#c3-filter-menu").setAttribute("state","newest"); $("#c3-content-items").innerHTML = `

    Loading...

    `; let key = chipBar0; if (gdp.loggedIn == true) { EXFetch("none","doubleLoggedIn","browse","browseId",gdp.currChan.id,"params","EghjaGFubmVsc_IGBAoCUgA%3D","continuation",key).then(result => { gdp.currChan.content = result.onResponseReceivedActions[1].reloadContinuationItemsCommand.continuationItems; fillC3Page("videos",0,"innertube"); }); } else { EXFetch("none","double","browse","browseId",gdp.currChan.id,"params","EghjaGFubmVsc_IGBAoCUgA%3D","continuation",key).then(result => { gdp.currChan.content = result.onResponseReceivedActions[1].reloadContinuationItemsCommand.continuationItems; fillC3Page("videos",0,"innertube"); }); } }); $("#c3-sort-oldest").addEventListener("click", function() { $("#c3-filter-dropdown").setAttribute("state","oldest"); $("#c3-filter-menu").setAttribute("state","oldest"); $("#c3-content-items").innerHTML = `

    Loading...

    `; let key = chipBar2; if (gdp.loggedIn == true) { EXFetch("none","doubleLoggedIn","browse","browseId",gdp.currChan.id,"params","EghjaGFubmVsc_IGBAoCUgA%3D","continuation",key).then(result => { gdp.currChan.content = result.onResponseReceivedActions[1].reloadContinuationItemsCommand.continuationItems; fillC3Page("videos",0,"innertube"); }); } else { EXFetch("none","double","browse","browseId",gdp.currChan.id,"params","EghjaGFubmVsc_IGBAoCUgA%3D","continuation",key).then(result => { gdp.currChan.content = result.onResponseReceivedActions[1].reloadContinuationItemsCommand.continuationItems; fillC3Page("videos",0,"innertube"); }); } }); } } if (gdp.currChan.currPage == "playlists") { $("#c3-content-header").innerHTML = `
    Playlists
    `; } if (gdp.currChan.sidebar.country != null) { $("#c3-location").classList.remove("hid"); } } function reconstructPlaylist() { if (STS.expModernPlaylists == true) { if ($("#watch7-playlist-data") && $(".watch7-playlist-bar-right .watch7-playlist-bar-left") == null) { var move = document.querySelector(".watch7-playlist-bar-left"); var newHome = document.querySelector('.watch7-playlist-bar-right'); newHome.insertBefore(move, newHome.children[0]); } } if (STS.expPlaylistTimestamps == true) { if ($(".yt-uix-scroller-scroll-unit:not(.startube-time-patched)") != null) { document.querySelectorAll(".yt-uix-scroller-scroll-unit:not(.startube-time-patched)").forEach(item => { let length = item.data.playlistPanelVideoRenderer.lengthText.simpleText; let container = item.querySelector("a"); if (container.querySelector(".playlist-time") == null) { let newElem = document.createElement("span"); newElem.classList = "stat time playlist-time"; newElem.innerHTML = ` `; container.insertBefore(newElem,container.children[4]); newElem.querySelector("span span").textContent = length; container.parentNode.classList.add("startube-time-patched"); } }); } } } function checkPlaylistThumbnails() { document.querySelectorAll(".yt-pl-thumb:not(.yt-mix-thumb)").forEach(item => { if (item.textContent.includes("50+")) { item.classList.add("yt-mix-thumb"); } }); } function everyLoad(x) { checkPlaylistThumbnails(); if ($("#page.watch") && STS.expAdaptiveLayout) { let date = $("#watch-description-content").data.watchDescription.clip.videoDate.simpleText; if ( date.includes("2022") || date.includes("2023") || date.includes("2024") ) { if (STS.expAdaptiveLayout2017Cap == true) { if (STS.presetHitchhiker2017 == false) { changeSetting("presetHitchhiker2017", "a"); } } else if (STS.presetPolymer2022 == false) { changeSetting("presetPolymer2022", "a"); } } if ( date.includes("2021") ) { if (STS.expAdaptiveLayout2017Cap == true) { if (STS.presetHitchhiker2017 == false) { changeSetting("presetHitchhiker2017", "a"); } } else if (STS.presetPolymer2021 == false) { changeSetting("presetPolymer2021", "a"); } } if ( date.includes("2020") ) { if (STS.expAdaptiveLayout2017Cap == true) { if (STS.presetHitchhiker2017 == false) { changeSetting("presetHitchhiker2017", "a"); } } else if (STS.presetPolymer2020 == false) { changeSetting("presetPolymer2020", "a"); } } if ( date.includes("2019") ) { if (STS.expAdaptiveLayout2017Cap == true) { if (STS.presetHitchhiker2017 == false) { changeSetting("presetHitchhiker2017", "a"); } } else if (STS.presetPolymer2019 == false) { changeSetting("presetPolymer2019", "a"); } } if ( date.includes("2018") ) { if (STS.presetHitchhiker2017 == false) { changeSetting("presetHitchhiker2017", "a"); } } if ( date.includes("2017") ) { if ( date.includes("Jan") || date.includes("Feb") || date.includes("Mar") || date.includes("Apr") || date.includes("May") || date.includes("Jun") || date.includes("Jul") || date.includes("Aug") ) { if (STS.presetHitchhiker2017_Early == false) { changeSetting("presetHitchhiker2017_Early", "a"); } } else { if (STS.presetHitchhiker2017 == false) { changeSetting("presetHitchhiker2017", "a"); } } } if ( date.includes("2016") ) { if ( date.includes("Jan") || date.includes("Feb") || date.includes("Mar") || date.includes("Apr") ) { if (STS.presetHitchhiker2016_Early == false) { changeSetting("presetHitchhiker2016_Early", "a"); } } else if ( date.includes("May") || date.includes("Jun") || date.includes("Jul") || date.includes("Aug") ) { if (STS.presetHitchhiker2016_Mid == false) { changeSetting("presetHitchhiker2016_Mid", "a"); } } else { if (STS.presetHitchhiker2016 == false) { changeSetting("presetHitchhiker2016", "a"); } } } if ( date.includes("2015") ) { if ( date.includes("Jan") || date.includes("Feb") || date.includes("Mar") || date.includes("Apr") || date.includes("May") || date.includes("Jun") || date.includes("Jul") || date.includes("Aug") ) { if (STS.presetHitchhiker2015_Early == false) { changeSetting("presetHitchhiker2015_Early", "a"); } } else if ( date.includes("Dec") ) { if (STS.presetHitchhiker2016_Early == false) { changeSetting("presetHitchhiker2016_Early", "a"); } } else { if (STS.presetHitchhiker2015 == false) { changeSetting("presetHitchhiker2015", "a"); } } } if ( date.includes("2014") ) { if ( date.includes("Jan") || date.includes("Feb") ) { if (STS.presetHitchhiker2013_3 == false) { changeSetting("presetHitchhiker2013_3", "a"); } } else if ( date.includes("Sep") || date.includes("Oct") || date.includes("Nov") || date.includes("Dec") ) { if (STS.presetHitchhiker2015_Early == false) { changeSetting("presetHitchhiker2015_Early", "a"); } } else { if (STS.presetHitchhiker2014 == false) { changeSetting("presetHitchhiker2014", "a"); } } } if ( date.includes("2013") ) { if ( date.includes("Jan") || date.includes("Feb") || date.includes("Mar") || date.includes("Apr") || date.includes("May") || date.includes("Jun") ) { if (STS.presetHitchhiker2013_1 == false) { changeSetting("presetHitchhiker2013_1", "a"); } } else if ( date.includes("Jul") || date.includes("Aug") || date.includes("Sep") || date.includes("Oct") ) { if (STS.presetHitchhiker2013_2 == false) { changeSetting("presetHitchhiker2013_2", "a"); } } else { if (STS.presetHitchhiker2013_3 == false) { changeSetting("presetHitchhiker2013_3", "a"); } } } if ( date.includes("2012") ) { if ( date.includes("Dec") ) { if (STS.presetHitchhiker2013_1 == false) { changeSetting("presetHitchhiker2013_1", "a"); } } else { if (STS.presetCosmicPanda == false) { changeSetting("presetCosmicPanda", "a"); } } } if ( date.includes("2005") || date.includes("2006") || date.includes("2007") || date.includes("2008") || date.includes("2009") || date.includes("2010") ) { if (STS.presetAozora2011 == false) { changeSetting("presetAozora2011", "a"); } } if ( date.includes("2011") ) { if ( date.includes("Dec") ) { if (STS.presetCosmicPanda == false) { changeSetting("presetCosmicPanda", "a"); } } else { if (STS.presetAozora2011 == false) { changeSetting("presetAozora2011", "a"); } } } } if ($("#efyt-background") && ($("#st-efyt-alert") == null) && ($("#alerts")) && closedEFYTBanner == false) { createEFYTAlert(); } if (($("#st-welcome-alert") == null) && ($("#alerts")) && closedWelcomeBanner == false && STS.showWelcomeBanner == true) { createWelcomeAlert(); } if (window.location.href.includes("force-c4") && STS.expChannels3 == true) { forceC4 = true; $("html").setAttribute("exp-channels3",""); $("html").removeAttribute("exp-channels3"); } else if (x === "x" && STS.expChannels3 == true && !window.location.href.includes("/post/")) { forceC4 = false; $("html").setAttribute("exp-channels3",""); } grabData(); $("html").setAttribute("startube",""); createMenus(); createSpace(); if ($("#st-menus-container") && x === "x") { $("#st-menus-container").classList.remove("menu-visible"); } if ($("[comment-panel-open]") && x === "x") { $("html").setAttribute("comment-panel-open","false"); } if ($(".gaiabar")) { $("html").setAttribute("v3-has-gbar",""); } if ( x === "x" && $("#watch5-above-container") ) { $("#watch5-above-container").remove(); } if ($("#page.home")) { var elm = ".feed-item-container:nth-child(5) img"; if ( x === "x" && STS.expAozoraHome == true ) { waitForElement10(elm).then(function(elm) { if (canGo != false) { createThirdColumn(); } }); } $("html").setAttribute("location","home"); } if (window.location.href.includes("feed/UC")) { $("html").setAttribute("location","feed-inline-channel"); } if (window.location.href.includes("feed")) { $("html").setAttribute("location","feed"); /*if (document.querySelector(".epic-panda-header") == null) { createFeedText(refreshCheck); }*/ } if (window.location.href.includes("/playlist") && !window.location.href.includes("/channel")) { $("html").setAttribute("location","playlist"); if ($("#content")) { grabPlaylistData(x); } else { var elm = "#content"; waitForElement10(elm).then(function(elm) { if (canGo != false) { grabPlaylistData(x); } }); } } if (window.location.href.includes("feed/guide")) { $("html").setAttribute("location","feed-guide-builder"); } if (window.location.href.includes("/subscriptions")) { $("html").setAttribute("location","feed-subs"); } if (window.location.href.includes("recommended_for_you")) { $("html").setAttribute("location","feed-recs"); } if (window.location.href.includes("/what_to_watch/recommended")) { $("html").setAttribute("location","feed-recs"); var elm = "#page"; waitForElement10(elm).then(function(elm) { if (canGo != false) { $("#page").classList = "feed clearfix"; } }); var elm2 = "#FEwhat_to_watch-guide-item"; waitForElement10(elm2).then(function(elm2) { if (canGo != false) { if ($("#FEwhat_to_watch-guide-item a.guide-item-selected")) { $("#FEwhat_to_watch-guide-item a").classList.remove("guide-item-selected"); } } }); } if ($("#page.search")) { $("html").setAttribute("location","search"); } if ($("#page.all_comments")) { $("html").setAttribute("location","comments"); } if ($("#page.watch")) { $("html").setAttribute("location","watch"); if (window.location.href.includes("&list")) { var elm = "#watch7-playlist-data"; waitForElement10(elm).then(function(elm) { if (canGo != false) { reconstructPlaylist(); } }); } } if ($("#page.channel")) { $("html").setAttribute("location","channel"); $("html").setAttribute("channel-location","home"); if (window.location.href.includes("/feed")) { $("html").setAttribute("channel-location","feed"); } if (window.location.href.includes("/videos")) { $("html").setAttribute("channel-location","videos"); } if (window.location.href.includes("/playlists")) { $("html").setAttribute("channel-location","playlists"); } if (window.location.href.includes("/community")) { $("html").setAttribute("channel-location","backstage"); } if (window.location.href.includes("/about")) { $("html").setAttribute("channel-location","about"); } if (window.location.href.includes("/search")) { $("html").setAttribute("channel-location","search"); } grabChannelData(x); if (STS.expPolymerChannels == true) { if ($(".channel-header-profile-image-container")) { var theBtn = document.querySelector(".channel-header-profile-image-container"); var newHome = document.querySelector('#c4-primary-header-contents'); newHome.insertBefore(theBtn, newHome.children[2]); } else { var elm = ".channel-header-profile-image-container"; waitForElement10(elm).then(function(elm) { if (canGo != false && $("#page.channel")) { var theBtn = document.querySelector(".channel-header-profile-image-container"); var newHome = document.querySelector('#c4-primary-header-contents'); newHome.insertBefore(theBtn, newHome.children[2]); } }); } } if (STS.expPolymerChannels == true) { if ($(".yt-subscription-button-subscriber-count-branded-horizontal") && $(".startube-poly-sub-count") == null) { var theBtn = document.querySelector(".yt-subscription-button-subscriber-count-branded-horizontal"); theBtn.textContent = theBtn.textContent + " subscribers"; var newHome = document.querySelector('.branded-page-header-title'); newHome.insertBefore(theBtn, newHome.children[0]); theBtn.classList.add("startube-poly-sub-count"); } else { var elm = ".yt-subscription-button-subscriber-count-branded-horizontal"; waitForElement10(elm).then(function(elm) { if (canGo != false && $(".startube-poly-sub-count") == null && $("#page.channel")) { var theBtn = document.querySelector(".yt-subscription-button-subscriber-count-branded-horizontal"); theBtn.textContent = theBtn.textContent + " subscribers"; var newHome = document.querySelector('.branded-page-header-title'); newHome.insertBefore(theBtn, newHome.children[0]); theBtn.classList.add("startube-poly-sub-count"); } }); } } if (STS.expHomeTab == true) { setTimeout(function() { if ($(".startube-tab") == null) { if ($(".epic-nav-item-empty.selected")) { $(".epic-nav-item-empty.selected").parentNode.id = "channel-main-tab"; let container = $("#channel-navigation-menu"); let newElem = document.createElement("li"); newElem.setAttribute("class","startube-tab"); newElem.innerHTML = `

    Home

    `; container.insertBefore(newElem, container.children[0]); } else if ($("#channel-navigation-menu .epic-nav-item-empty.selected") == null) { var elm = "#channel-navigation-menu li:nth-child(1) a"; waitForElement10(elm).then(function(elm) { if (canGo != false) { if ($("#channel-navigation-menu .epic-nav-item-empty.selected") == null) { let navData = $("#channel-navigation-menu li a").data; let navUrl = $("#channel-navigation-menu li a").getAttribute("href"); let container = $("#channel-navigation-menu"); let newElem = document.createElement("li"); newElem.setAttribute("class","startube-tab"); newElem.innerHTML = ` Home `; container.insertBefore(newElem, container.children[0]); newElem.data = navData; } } }); } } }, 250); } } else { if ($("[channel-location]")) { $("html").removeAttribute("channel-location"); } } if ($("#page.search")) { $("html").setAttribute("location","search"); } if (STS.expLogoLinksToFeed == true && $("#logo-container")) { $("#logo-container").href = "/feed/what_to_watch/recommended"; $("#logo-container").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: "FEwhat_to_watch", canonicalBaseUrl: "/feed/what_to_watch/recommended" }, commandMetadata: { webCommandMetadata: { url: "/feed/what_to_watch/recommended" } } } } } } if (STS.expLogoLinksToSubs == true && $("#logo-container")) { $("#logo-container").href = "/feed/subscriptions"; $("#logo-container").data = { abstractVorElement: { navigationEndpoint: { browseEndpoint: { browseId: "FEsubscriptions", canonicalBaseUrl: "/feed/subscriptions" }, commandMetadata: { webCommandMetadata: { url: "/feed/subscriptions" } } } } } } var arraNum = 0; arra.forEach(itemRoot => { let name = itemRoot[0]; checkSetting(name).then(function(value) { if (value == true && name == "expAdaptiveLayout") { $("html").setAttribute("exp-adaptive-layout", ""); } else if (value == true && name == "expRelatedThumbsSizeMedium") { $("html").setAttribute("exp-related-thumbs-size-medium", ""); } else if (value == true && name == "expRelatedThumbsSizeLarge") { $("html").setAttribute("exp-related-thumbs-size-large", ""); } else if (value == true && name == "expRelatedThumbsSizeStupid") { $("html").setAttribute("exp-related-thumbs-size-stupid", ""); } else if (value == true && name == "configNoTabTopBorder") { $("html").setAttribute("config-no-tab-top-border", ""); } else if (value == true && name == "configWatch7SidebarCardShadow") { $("html").setAttribute("config-watch7-sidebar-card-shadow", ""); } else if (value == true && name == "expRelatedTabs") { $("html").setAttribute("exp-related-tabs", ""); createRelatedTabsPrep(); } else if (value == true && name == "expRelatedTabsHoldsSubscribe") { $("html").setAttribute("exp-related-tabs-holds-subscribe", ""); } else if (value == true && name == "expWatch9") { $("html").setAttribute("exp-watch9", ""); createWatch9Prep(); } else if (value == true && name == "expWatch9NoOwner") { $("html").setAttribute("exp-watch9-no-owner", ""); } else if (value == true && name == "expWatch9TrueExpander") { $("html").setAttribute("exp-watch9-true-expander", ""); } else if (value == true && name == "expVerticalWatch9") { $("html").setAttribute("exp-vertical-watch9", ""); } else if (value == true && name == "expWatch9SidebarBus") { $("html").setAttribute("exp-watch9-sidebar-bus", ""); } else if (value == true && name == "expWatch9StickyColumns") { $("html").setAttribute("exp-watch9-sticky-columns", ""); } else if (value == true && name == "expWatch9ReportTab") { $("html").setAttribute("exp-watch9-report-tab", ""); } else if (value == true && name == "expGuideAlwaysPinned") { guideAlwaysPinned(); } else if (value == true && name == "expWatch8") { $("html").setAttribute("exp-watch8", ""); createWatch8Prep(); } else if (value == true && name == "expWatch8NoMore") { $("html").setAttribute("exp-watch8-no-more", ""); } else if (value == true && name == "expSharrow") { $("html").setAttribute("exp-sharrow", ""); } else if (value == true && name == "expAlwaysShowCompactDate") { $("html").setAttribute("exp-always-show-compact-date", ""); } else if (value == true && name == "expTwoColumnSearchResults") { $("html").setAttribute("exp-two-column-search-results", ""); } else if (value == true && name == "expRelatedGrid") { $("html").setAttribute("exp-related-grid", ""); } else if (value == true && name == "expMoveGuideButtonToTopbar") { $("html").setAttribute("exp-move-guide-button-to-topbar", ""); moveGuideButtonToTopbar(); } else if (value == true && name == "expMoveCountsToButtons") { $("html").setAttribute("exp-move-counts-to-buttons", ""); moveCountsToButtons(); } else if (value == true && name == "expMoreTooltips") { $("html").setAttribute("exp-more-tooltips", ""); createMoreTooltips(); } else if (value == true && name == "expFlatLogo") { $("html").setAttribute("exp-flat-logo", ""); } else if (value == true && name == "expInvertLogo") { $("html").setAttribute("exp-invert-logo", ""); } else if (value == true && name == "expGlossyLogo") { $("html").setAttribute("exp-glossy-title", ""); } else if (value == true && name == "expClassicTitle") { $("html").setAttribute("exp-classic-title", ""); } else if (value == true && name == "expClassicGuide") { $("html").setAttribute("exp-classic-guide", ""); } else if (value == true && name == "expClassicSubscribe") { $("html").setAttribute("exp-classic-subscribe", ""); } else if (value == true && name == "expClassicStyles") { $("html").setAttribute("exp-classic-styles", ""); } else if (value == true && name == "expClassicLtod") { $("html").setAttribute("exp-classic-ltod", ""); } else if (value == true && name == "expClassicButtons") { $("html").setAttribute("exp-classic-buttons", ""); } else if (value == true && name == "expBigSearchThumbs") { $("html").setAttribute("exp-big-search-thumbs", ""); } else if (value == true && name == "expBiggerSearchThumbs") { $("html").setAttribute("exp-bigger-search-thumbs", ""); } else if (value == true && name == "expNoVideosLink") { $("html").setAttribute("exp-no-videos-link", ""); } else if (value == true && name == "expModernStyles") { $("html").setAttribute("exp-modern-styles", ""); changeCommentPlaceholder(0); changeCommentHeader(0); } else if (value == true && name == "expModernNotifIcon") { $("html").setAttribute("exp-modern-notif-icon", ""); } else if (value == true && name == "expModernTopbar") { $("html").setAttribute("exp-modern-topbar", ""); } else if (value == true && name == "expModernUpload") { $("html").setAttribute("exp-modern-upload", ""); } else if (value == true && name == "expModernGuideButton") { $("html").setAttribute("exp-modern-guide-button", ""); } else if (value == true && name == "expModernSearchIcon") { $("html").setAttribute("exp-modern-search-icon", ""); } else if (value == true && name == "expSearchText") { $("html").setAttribute("exp-search-text", ""); createSearchText(); } else if (value == true && name == "expModernTitle") { $("html").setAttribute("exp-modern-title", ""); } else if (value == true && name == "expModernGuide") { $("html").setAttribute("exp-modern-guide", ""); doModernGuide(); } else if (value == true && name == "expModernHome") { $("html").setAttribute("exp-modern-home", ""); } else if (value == true && name == "expModernPlaylists") { $("html").setAttribute("exp-modern-playlists", ""); } else if (value == true && name == "expModernPlaylistThumbnails") { $("html").setAttribute("exp-modern-playlist-thumbnails", ""); } else if (value == true && name == "expPlaylistRedBorder") { $("html").setAttribute("exp-playlist-red-border", ""); } else if (value == true && name == "expPlaylistTimestamps") { $("html").setAttribute("exp-playlist-timestamps", ""); } else if (value == true && name == "expTrueScrollableGuide") { $("html").setAttribute("exp-true-scrollable-guide", ""); doScrollableGuide(); } else if (value == true && name == "expModernPlayer") { $("html").setAttribute("exp-modern-player", ""); doModernPlayer(); } else if (value == true && name == "expModernPlayerV2") { $("html").setAttribute("exp-modern-player", ""); $("html").setAttribute("exp-modern-player-v2", ""); doModernPlayer(); } else if (value == true && name == "expGoogleApps") { $("html").setAttribute("exp-google-apps", ""); createGoogleApps(); } else if (value == true && name == "expCommentsFullWidth") { $("html").setAttribute("exp-comments-full-width", ""); } else if (value == true && name == "expNoByText") { $("html").setAttribute("exp-no-by-text", ""); } else if (value == true && name == "expAccountMenu") { $("html").setAttribute("exp-account-menu", ""); createAccountMenu(); } else if (value == true && name == "expStaticSite") { $("html").setAttribute("static", ""); } else if (value == true && name == "expHideAppbar") { $("html").setAttribute("hide-appbar", ""); } else if (value == true && name == "expEpicWatch7") { $("html").setAttribute("exp-epic-watch7", ""); } else if (value == true && name == "expEpicWatch7Flat") { $("html").setAttribute("exp-epic-watch7-flat", ""); } else if (value == true && name == "expEpicHeader") { $("html").setAttribute("topbar", "epic"); } else if (value == true && name == "expEpicStyling") { $("html").setAttribute("exp-epic-styling", ""); } else if (value == true && name == "expEpicFeeds") { $("html").setAttribute("exp-epic-feeds", ""); doCosmicFeedHeader(); } else if (value == true && name == "expCosmicHeader") { $("html").setAttribute("topbar", "cosmic"); } else if (value == true && name == "expCosmicBG") { $("html").setAttribute("cosmic-bg", ""); } else if (value == true && name == "expCosmicButtons") { $("html").setAttribute("cosmic-buttons", ""); } else if (value == true && name == "expCosmicStyles") { $("html").setAttribute("cosmic-styles", ""); } else if (value == true && name == "expCosmicBanners") { $("html").setAttribute("exp-cosmic-banners", ""); } else if (value == true && name == "expCosmicBannersV2") { $("html").setAttribute("exp-cosmic-banners-v2", ""); } else if (value == true && name == "expCosmicGuideStyle") { $("html").setAttribute("exp-cosmic-guide-style", ""); } else if (value == true && name == "expCosmicGuideLayout") { $("html").setAttribute("exp-cosmic-guide-layout", ""); createCosmicGuide(); } else if (value == true && name == "expCosmicFeedsV1") { $("html").setAttribute("exp-cosmic-feeds-v1", ""); doCosmicFeedHeader(); } else if (value == true && name == "expCosmicFeedsThirdColumn") { $("html").setAttribute("exp-cosmic-feeds-third-column", ""); doThirdColumnVideosPrep(); } else if (value == true && name == "expWatch5D") { $("html").setAttribute("exp-watch5d", ""); createWatch5Prep(); } else if (value == true && name == "expChannels3" && !window.location.href.includes("force-c4")) { $("html").setAttribute("exp-channels3",""); createChannels3Prep(); } else if (value == true && name == "expChannels3BGVerticalRepeat" && !window.location.href.includes("force-c4")) { $("html").setAttribute("exp-channels3-bg-vertical-repeat",""); } else if (value == true && name == "expChannels3BGHorizontalRepeat" && !window.location.href.includes("force-c4")) { $("html").setAttribute("exp-channels3-bg-horizontal-repeat",""); } else if (value == true && name == "expNoGuide") { $("html").setAttribute("guide", "no"); } else if (value == true && name == "expGuideOnFeedsOnly") { $("html").setAttribute("guide", "feeds"); } else if (value == true && name == "expAozoraHome") { $("html").setAttribute("exp-aozora-home", ""); } else if (value == true && name == "expAozoraHeader") { $("html").setAttribute("exp-aozora-header", ""); searchButtonLowercase(); } else if (value == true && name == "expAozoraBG") { $("html").setAttribute("exp-aozora-bg", ""); } else if (value == true && name == "expAozoraStyles") { $("html").setAttribute("exp-aozora-styles", ""); } else if (value == true && name == "expAozoraSubscribe") { $("html").setAttribute("exp-aozora-subscribe", ""); } else if (value == true && name == "expAozoraTopbarLinks") { $("html").setAttribute("exp-aozora-topbar-links", ""); createAozoraTopbarLinks(); } else if (value == true && name == "expWatch5C") { $("html").setAttribute("exp-watch5d", ""); $("html").setAttribute("exp-watch5c", ""); createWatch5Prep(); } else if (value == true && name == "expHomeTab") { $("html").setAttribute("exp-home-tab", ""); } else if (value == true && name == "expRoboto") { $("html").setAttribute("exp-roboto", ""); } else if (value == true && name == "expCenteredSearch") { $("html").setAttribute("exp-centered-search", ""); } else if (value == true && name == "expBigSearch") { $("html").setAttribute("exp-big-search", ""); } else if (value == true && name == "expSecondarySearchIcon") { $("html").setAttribute("exp-secondary-search-icon", ""); createSearchTumor(); } else if (value == true && name == "expMaterialSearch") { $("html").setAttribute("exp-material-search", ""); createSearchIcon(); } else if (value == true && name == "expPolymerShell") { $("html").setAttribute("exp-polymer-shell", ""); createSearchIcon(); } else if (value == true && name == "expEarlyPolymerShell") { $("html").setAttribute("exp-polymer-shell", ""); $("html").setAttribute("exp-early-polymer-shell", ""); } else if (value == true && name == "expEarlyPolymerGuide") { $("html").setAttribute("exp-early-polymer-guide", ""); } else if (value == true && name == "expPolymerGen2Colors") { $("html").setAttribute("exp-polymer-gen2-colors", ""); } else if (value == true && name == "expPolymerSubscribe") { $("html").setAttribute("exp-polymer-subscribe", ""); } else if (value == true && name == "expPolymerGen2Subscribe") { $("html").setAttribute("exp-polymer-subscribe", ""); $("html").setAttribute("exp-polymer-gen2-subscribe", ""); } else if (value == true && name == "expPolymerStyles") { $("html").setAttribute("exp-polymer-styles", ""); changeCommentPlaceholder(1); changeCommentHeader(1); } else if (value == true && name == "expPolymerChannels") { $("html").setAttribute("exp-polymer-channels", ""); } else if (value == true && name == "expPolymerComments") { $("html").setAttribute("exp-polymer-comments", ""); } else if (value == true && name == "expPolymerTooltips") { $("html").setAttribute("exp-polymer-tooltips", ""); } else if (value == true && name == "expMaterialSignIn") { $("html").setAttribute("exp-material-sign-in", ""); } else if (value == true && name == "expRichGridHome") { $("html").setAttribute("exp-rich-grid-home", ""); doRichGridHome(); } else if (value == true && name == "expWatch9A") { $("html").setAttribute("exp-watch9a", ""); createRealWatch9Prep(); } else if (value == true && name == "expWatch9B") { $("html").setAttribute("exp-watch9b", ""); createRealWatch9Prep(); } else if (value == true && name == "expWatch10Beta") { $("html").setAttribute("exp-watch10-beta", ""); createWatch10Prep(); } else if (value == true && name == "expWMRButtonsLowercase") { $("html").setAttribute("exp-wmr-buttons-lowercase", ""); } else if (value == true && name == "expOutlineIcons") { $("html").setAttribute("exp-outline-icons", ""); } else if (value == true && name == "expRoundedTopbarPfp") { $("html").setAttribute("exp-rounded-topbar-pfp", ""); } else if (value == true && name == "expUploadIcon") { $("html").setAttribute("exp-upload-icon", ""); createUploadIcon(); } else if (value == true && name == "expHideYoodles") { $("html").setAttribute("exp-hide-yoodles", ""); hideYoodles(); } else if (value == true && name == "expFixedShareIcons") { $("html").setAttribute("exp-fixed-share-icons", ""); } else if (value == true && name == "expFixedXIcon") { $("html").setAttribute("exp-fixed-x-icon", ""); } else if (value == true && name == "expMaterialGbar") { $("html").setAttribute("exp-material-gbar", ""); } }); }); refreshCheck++; if ( $("#startube-new-settings-popup") === null && STS.show2point1 == true ) { let container76 = document.querySelector('.spitfire-body-container.v3'); let newElem76 = document.createElement("div"); newElem76.id = "startube-new-settings-popup"; newElem76.innerHTML = `
    What's new in StarTube 2.1.0
    Cosmic Panda channels
    Channels3, the channel layout used in Cosmic Panda, has been added, and is used on all layouts from Early 2013 and earlier.
    Lockable settings
    Right click on settings to lock them. This will prevent them from being changed by presets.
    Adaptive layout
    When expAdaptiveLayout is enabled, watching a video will cause the site to change to the layout that existed when that video was made (or the closest thing available). For example, a 2015 video will give you the 2015 layout.
    `; container76.insertBefore(newElem76, container76.children[0]); $("#close-startube-new-settings-popup").addEventListener("click", function() { $("#startube-new-settings-popup").remove(); STS.show2point1 = false; applySettings(); $("html").setAttribute("no-startube-popup",""); var elm = "#show2point1"; waitForElement10(elm).then(function(elm) { if (canGo != false) { $("#show2point1").setAttribute("checked","false"); } }); }); } } function createExpandedFooter() { let container = document.querySelector('.smartadd.selected .smartadd_content'); var newElem = document.createElement("div"); newElem.id = "startube13-settings"; newElem.innerHTML = ` `; container.insertBefore(newElem, container.children[2]); container = document.querySelector('.spitfire-body-container.v3'); newElem = document.createElement("div"); newElem.id = "startube13-settings-window"; newElem.classList.add("hid"); newElem.innerHTML = `
    StarTube Settings
    Main
    Anti-Main
    Presets
    All
    Presets
    Alert icon
    Return to defaults
    Disable all StarTube options
    Does not affect locked settings
    Download StarTube Config JSON

    Note: These presets will override ALMOST ALL your StarTube settings! You may need to enter this config window again to change some things after enabling a preset.

    STPresetsAlsoSetV3Settings
    If you don't want StarTube to change your V3 config, uncheck this. (The page will reload after changing this setting)

    Use default V3 player (2014)
    Use 2015-2016 player
    Use 2016-2020 player

    Use Aozora 2011
    Use Cosmic Panda
    Use Epic Panda
    Use Early 2013
    Use Early 2013 Alt
    With alt-watch9
    Use Mid 2013
    Use Mid 2013 Alt
    With alt-watch9
    Use Late 2013
    Use Late 2013 Alt
    With alt-watch9
    Use 2014
    Use 2014 Alt
    With alt-watch9
    Use 2015
    Use 2015 Alt
    With alt-watch9
    Use 2016
    Use 2016 Alt
    With alt-watch9
    Use 2017
    Use 2017 Alt
    With alt-watch9
    Use Polymer 2016
    Very unfinished
    Use Polymer 2019
    Use Polymer 2020
    Use Polymer 2021
    Use Polymer 2022
    All
    expAdaptiveLayout
    When you go to watch a video, the layout will change to the layout that existed when the video was made (or the closest thing available). This setting will overwrite all of your StarTube options every time the layout adapts.
    expAdaptiveLayout2017Cap
    Makes 2017 Hitchhiker the newest possible layout selected by expAdaptiveLayout. For example, a video uploaded in 2024 will give you the 2017 layout.
    show2point1
    Show the 2.1.0 update card.
    polymerWarningBanner
    If V3 is disabled or not installed, StarTube will display a banner urging the user to install it.
    expHomepageRedirectsToFeed
    On the inital page load only, if the current URL is https://www.youtube.com, it will redirect to https://www.youtube.com/feed/recommended_for_you, which is useful for the Cosmic Panda layout.
    expLogoLinksToFeed
    The YouTube logo will link to https://www.youtube.com/feed/recommended_for_you
    expLogoLinksToSubs
    The YouTube logo will link to https://www.youtube.com/feed/subscriptions
    expRelatedThumbsSizeMedium
    CustomTube medium related videos size option
    expRelatedThumbsSizeLarge
    Late 2016-Present
    expRelatedThumbsSizeStupid
    Based off the "watch feed big thumbs" experiment in Kevlar. Added as a joke, don't use this
    expAlwaysShowCompactDate
    Display dates on related videos without having to hover over them.
    expMoveGuideMainSectionToTop
    Only meant to be used with v3's regular 2013 guide.
    expMoreTooltips
    Adds more tooltip; Increases the amount of tooltips; Enables the tooltip tribe to be more plentiful in the site, compared to without the option enabled
    expMoveGuideButtonToTopbar
    Only works with the appbar enabled.
    expRelatedTabs
    Creates the related tabs.
    expRelatedTabsHoldsSubscribe
    Move the subscribe button to the related tabs area.
    expWatch9
    Enables the alternate universe watch9 layout (alt-watch9). Currently a little buggy without "expWatch9NoOwner". DO NOT USE WITH expWatch8.
    expWatch9NoOwner
    Removes the owner column from alt-watch9. Recommended if using "expRelatedTabs".
    expWatch9TrueExpander
    Not recommended. Makes the description work more like it does in watch7, and removes the Description tab.
    expVerticalWatch9
    Makes alt-watch9's panels scroll vertically instead of horizontally.
    expWatch9SidebarBus
    Makes alt-watch9's sidebar item selection move. Glitchy on some zoom levels.
    expWatch9StickyColumns
    When on the description tab, the sidebar and owner column will stay on screen while you scroll.
    expWatch9ReportTab
    Rename Alt-watch9's "More actions" tab to "Report".
    expRelatedGrid
    *Now works with the centered layout.* Use grid view for related videos. Intended to be used with expRelatedThumbsSizeLarge.
    expWatch8
    Enables watch8. DO NOT USE WITH expWatch9.
    expWatch8NoMore
    Remove the "More" button in favor of showing all buttons at once. NOTE: V3's built-in Watch8 option would best be disabled.
    expMoveCountsToButtons
    Moves like and dislike counts to the buttons.
    expSharrow
    Use Late 2015-Onwards share icon in watch8
    expGuideAlwaysPinned
    Always have guide pinned. Untested with 2013 guide.
    expWatch7AboutTabRename
    Change "About" to "Video info" on regular watch7.
    expWatch7AboutTabRename2
    Change "About" to "Details" on regular watch7.
    expTwoColumnSearchResults
    *Currently does not work with the centered layout.* Makes search results 2 columns, instead of 1. Works best on 1920x1080 screens or better.
    configNoTabTopBorder
    remove blue borders on watch7 tabs
    configWatch7SidebarCardShadow
    Add a box shadow to the related videos section if indiviual cards watch is on
    expClassicTitle
    Early 2013 video title
    expClassicGuide
    Early 2013 guide styling
    expClassicSubscribe
    Early 2013 subscribe button
    expClassicStyles
    General early 2013 styling
    expClassicLtod
    Early 2013 like to dislike bar and icons
    expClassicButtons
    Early 2013 uix button styling
    expBigSearchThumbs
    Use the slightly bigger search thumbnails from around 2017-2019. Pfps also become centered if this is enabled.
    expBiggerSearchThumbs
    Use the much bigger search thumbnails from around 2020-2022. Pfps also become centered if this is enabled.
    expModernStyles
    Enable ~2015 styling
    expModernNotifIcon
    Change notification preference icon to a bell
    expModernTopbar
    Makes the topbar in general look more like 2015 onwards
    expModernUpload
    Remove the icon on the upload button (intended to be used without promintent upload button)
    expModernGuideButton
    Enable late 2015-Present guide button
    expModernSearchIcon
    Enable late 2015-Present search icon
    expSearchText
    Enable "Search" text placeholder on searchbar
    expModernTitle
    Enable smaller title text from 2016-onwards
    expModernGuide
    Make the guide look like it did in late 2015 onwards, also changes stuff like What to Watch to Home
    expModernHome
    Removes recommended channels and fixes thumbnail sizes on home
    expModernPlaylists
    Modern Hitchhiker playlist styling
    expModernPlaylistThumbnails
    Modern Hitchhiker playlist thumbnail styling
    expPlaylistRedBorder
    Red border around currently playing video. From 2014-2015 ish.
    expPlaylistTimestamps
    Add timestamps to playlist videos on the watch page, which mimicks CustomTube's playlist styling/span>
    expTrueScrollableGuide
    Make the guide act like it did in 2015 onwards, removing the flyouts. Requires APPBAR_GUIDE_SCROLL to be disabled.
    expModernPlayer
    Make the player look like it did from 2015-2016
    expModernPlayerV2
    Make the player look like it did in 2016-2020
    expViewsString
    Always show the "views" text on the view count.
    expGoogleApps
    Use apps button from 2015 Google
    expCommentsFullWidth
    Make comments take up the full width of the section, rather than being limited 640px
    expNoByText
    Removes the "by" text on video elements.
    expAccountMenu
    Replace the expanded masthead with the account dropdown menu.
    expStaticSite
    Forces the site to have a consistent width of 970 pixels. Center alignment required.
    expHideAppbar
    The appbar can be problematic on some configurations, but the appbar guide cannot be used without the appbar. This option will hide the appbar, without disabling the appbar guide.
    expEpicWatch7
    Makes watch7 use epic panda styling.
    expEpicWatch7Flat
    Removes the shadow on epic watch7.
    expEpicHeader
    Use the scrapped Epic Panda topbar
    expEpicStyling
    Recommended for Epic Panda layout
    expEpicFeeds
    Epic Panda feed header
    expCosmicHeader
    Use the Cosmic Panda topbar
    expCosmicBG
    Makes the site use the Cosmic Panda background image
    expCosmicButtons
    Makes the site use Cosmic Panda styled buttons
    expCosmicStyles
    Makes the site use Cosmic Panda styling in general.
    expCosmicBanners
    Makes the site use the early 2012 alert banner styling.
    expCosmicBannersV2
    Makes the site use the mid-late 2012 alert banner styling.
    expCosmicGuideStyle
    Makes the site use the Cosmic Panda black guide.
    expCosmicGuideLayout
    Makes the guide's structure similar to the Cosmic Panda one, with the browse channels button being on top for example.
    expCosmicFeedsV1
    Makes feed video renderers use the late 2011-early 2012 style.
    expCosmicFeedsThirdColumn
    Adds a trending column to the feed pages.
    expWatch5D
    Use the Cosmic Panda watch layout
    expChannels3
    Use Channels3, the Cosmic Panda channel page.
    expChannels3BGVerticalRepeat
    The channel background will repeat vertically. Use with expChannels3BGHorizontalRepeat to make it repeat in all directions.
    expChannels3BGHorizontalRepeat
    The channel background will repeat horizontally. Use with expChannels3BGVericalRepeat to make it repeat in all directions.
    expNoGuide
    Removes the guide (center alignment required)
    expGuideOnFeedsOnly
    Makes the guide only appear on feeds (such as subscriptions page) (center alignment required)
    expAozoraHome
    Arranges the homepage like the 2011 layout.
    expAozoraHeader
    Makes the topbar look like the 2011 layout.
    expAozoraBG
    Pure white site background.
    expAozoraStyles
    Styles many things to look like the Aozora (2010-2011) layout.
    expAozoraSubscribe
    White subscribe button
    expWatch5C
    Use the mid-late 2011 watch layout.
    expHomeTab
    Gives the channel page a regular home tab, instead of the icon tab.
    expRoboto
    Makes the site use the Roboto font.
    expCenteredSearch
    Centers the searchbar. Intended to be used with the Polymer layout recreation.
    expBigSearch
    Taller search bar from certain eras of Polymer.
    expSecondarySearchIcon
    Adds that weird redundant search icon that appears on the left side of the search bar when it is focused, which was added in 2022 and still exists today.
    expMaterialSearch
    Material search bar from 2016 Polymer, and some Hitchhiker experiements.
    expPolymerShell
    Changes the topbar, guide, and some other things to look like they did in Polymer Gen 1 (2017-2019).
    expEarlyPolymerShell
    Changes the topbar, guide, and some other things to look like they did in the Polymer Beta/Polymer Gen 0 (2016-2017).
    expEarlyPolymerGuide
    Makes the guide items 48px tall.
    expPolymerGen2Colors
    Makes the site use the colors it did in Polymer Gen 2 (2020-2022).
    expPolymerSubscribe
    Makes the subscribe button use the Polymer Gen 1 style (sub count inside the button)
    expPolymerGen2Subscribe
    Makes the subscribe button use the Polymer Gen 2 style (sub count not inside the button)
    expPolymerStyles
    Makes video renderers and other things look like Polymer.
    expPolymerChannels
    2017 onwards channels.
    expPolymerComments
    Polymer comments.
    expPolymerTooltips
    Polymer tooltips.
    expMaterialSignIn
    Red Material sign in button.
    expRichGridHome
    Makes the homepage videos really big.
    expWatch9A
    Enables the watch layout used from 2016-2019 in Polymer. Not the same as expWatch9.
    expWatch9B
    Enables the watch layout used from 2020-2022 in Polymer. Not the same as expWatch9.
    expWatch10Beta
    Use the weird mid 2022 Watch Metadata Refresh layout.
    expWMRButtonsLowercase
    Makes the Polymer watch layouts use lowercase buttons.
    expOutlineIcons
    Use the outline icons that were introduced in 2021.
    expRoundedTopbarPfp
    Makes the topbar pfp round like it was in 2016 onwards.
    expUploadIcon
    Replace the upload button with the upload icon from 2016-2018-ish.
    expHideYoodles
    Hide YouTube Doodles because they break the styling of the logo on some layouts.
    The following options are not affected by any of the layout presets.
    expFixedShareIcons
    Some share options incorrectly appear as Facebook. This option fixes some of them.
    expFixedXIcon
    Makes the X share option use the modern icon, as opposed to the pre-2023 icon.
    expMaterialGbar
    Gives the modern gbar a Material-ish skin. Requires V3's MODERN_GBAR_DELEGATION to be enabled.
    `; container.insertBefore(newElem, container.children[1]); $("#downloadJSON").addEventListener("click", function() { createJSON(); }); $("#st-load-file button").addEventListener("click", function() { if ($("#st-load-file input").files[0]) { var theFile = $("#st-load-file input").files[0].type; if (theFile == "application/json") { var file = $("#st-load-file input").files[0]; actionFile(file); } else { alert("Invalid file type. Please upload a JSON file."); } } else { alert("Please select a file."); } }); $("#st-settings-button").addEventListener("click", function() { if ($("#startube13-settings-window.hid") != null) { $("#startube13-settings-window").classList.remove("hid"); $("#st-settings-dd-main").scrollTo(0,0); } else if ($("#startube13-settings-window.hid") == null) { $("#startube13-settings-window").classList.add("hid"); } }); var arraySettings = document.querySelectorAll(".lb-setting"); arraySettings.forEach(itemRoot => { if (itemRoot) { var item = itemRoot.getAttribute("id"); var itemV = STS[item]; if (itemV == true) { itemRoot.setAttribute("checked","true"); } else { itemRoot.setAttribute("checked","false"); } if (STS.ironSettings[item] != null) { itemRoot.classList.add("startube-iron-setting"); } } }); doListen(); function doListen() { let i = 0; for (i = 0; i < document.querySelectorAll(".lb-setting").length; i++) { document.querySelectorAll(".lb-setting")[i].onclick = function(e) { e.preventDefault(); if (this.classList.contains('startube-iron-setting')) { alert("You must unlock this setting before changing it. (Locking and unlocking settings is done by right clicking them)"); } else { var thisElm = this; changeSetting(thisElm); } }; } let list = document.querySelectorAll(".lb-setting"); list.forEach(item => { /* item.addEventListener("contextmenu", (e) => { e.preventDefault(); item.classList.add("startube-iron-setting"); });*/ item.addEventListener("contextmenu",function() { let id = this.id; let value = this.getAttribute("checked"); if (value == "true") { value = true; } if (value == "false") { value = false; } if (value == null) { value = false; } if (STS.ironSettings[id] == null) { STS.ironSettings[id] = value; this.classList.add("startube-iron-setting"); applySettings(); } else { delete STS.ironSettings[id]; this.classList.remove("startube-iron-setting"); applySettings(); } }); }); } } function changeSetting(thisElm, a) { if (a !== "a") { var theSetting = thisElm.getAttribute("id"); var checked = thisElm.getAttribute("checked"); } else { var theSetting = thisElm; var checked = true; } if (theSetting == "presetRegularPlayer") { STS.expModernPlayer = false; STS.expModernPlayerV2 = false; window.location.reload(); } if (theSetting == "presetModernPlayer") { STS.expModernPlayer = true; STS.expModernPlayerV2 = false; window.location.reload(); } if (theSetting == "presetModernPlayerV2") { STS.expModernPlayer = false; STS.expModernPlayerV2 = true; window.location.reload(); } if (theSetting == "RTD") { localStorage.removeItem("ST_SETTINGS"); localStorage.removeItem("starTubeConfigCreated"); window.location.reload(); } else if (a !== "a") { if (checked == "true") { STS[theSetting] = false; //localStorage.setItem(theSetting,"false"); thisElm.setAttribute("checked","false"); if (STS.ironSettings[theSetting]) { STS.ironSettings[theSetting] = false; } applySettings(); } else { STS[theSetting] = true; //localStorage.setItem(theSetting,"true"); thisElm.setAttribute("checked","true"); if (STS.ironSettings[theSetting]) { STS.ironSettings[theSetting] = true; } applySettings(); } } function disableOtherPresets(preset) { STS.presetAozora2011 = false; STS.presetCosmicPanda = false; STS.presetEpicPanda = false; STS.presetHitchhiker2013_1 = false; STS.presetHitchhiker2013_1Alt = false; STS.presetHitchhiker2013_2 = false; STS.presetHitchhiker2013_2Alt = false; STS.presetHitchhiker2013_3 = false; STS.presetHitchhiker2013_3Alt = false; STS.presetHitchhiker2014 = false; STS.presetHitchhiker2014Alt = false; STS.presetHitchhiker2015 = false; STS.presetHitchhiker2015Alt = false; STS.presetHitchhiker2016 = false; STS.presetHitchhiker2016Alt = false; STS.presetHitchhiker2017 = false; STS.presetHitchhiker2017Alt = false; STS.presetHitchhiker2017Ultra = false; STS.presetPolymer2016 = false; STS.presetPolymer2019 = false; STS.presetPolymer2020 = false; STS.presetPolymer2021 = false; STS.presetPolymer2022 = false; STS.presetHitchhiker2015_Early = false; STS.presetHitchhiker2017_Early = false; STS[preset] = true; } if (theSetting == "STPresetsAlsoSetV3Settings") { STPresetsAlsoSetV3Settings == checked; window.location.reload(); } if (theSetting == "presetWatch9") { STS.expRelatedTabs = true; STS.expRelatedTabsHoldsSubscribe = true; STS.expWatch9 = true; STS.expWatch9NoOwner = true; STS.expWatch9TrueExpander = false; STS.expVerticalWatch9 = false; STS.expWatch9SidebarBus = false; STS.expWatch9StickyColumns = false; STS.expWatch9ReportTab = true; STS.expRelatedGrid = false; STS.expWatch8 = false; STS.expWatch8NoMore = false; STS.expMoveCountsToButtons = false; STS.expSharrow = false; STS.expWatch9A = false; STS.expWatch9B = false; STS.expWatch10Beta = false; STS.expWMRButtonsLowercase = false; } if (theSetting == "presetWatch9ThreeColumns") { STS.expRelatedTabs = false; STS.expRelatedTabsHoldsSubscribe = false; STS.expWatch9 = true; STS.expWatch9NoOwner = false; STS.expWatch9TrueExpander = false; STS.expVerticalWatch9 = false; STS.expWatch9SidebarBus = false; STS.expWatch9StickyColumns = false; STS.expWatch9ReportTab = true; STS.expRelatedGrid = false; STS.expWatch8 = false; STS.expWatch8NoMore = false; STS.expMoveCountsToButtons = false; STS.expSharrow = false; STS.expWatch9A = false; STS.expWatch9B = false; STS.expWatch10Beta = false; STS.expWMRButtonsLowercase = false; } if (theSetting == "presetWatch9Fancy") { STS.expRelatedTabs = true; STS.expRelatedTabsHoldsSubscribe = true; STS.expWatch9 = true; STS.expWatch9NoOwner = true; STS.expWatch9TrueExpander = false; STS.expVerticalWatch9 = true; STS.expWatch9SidebarBus = true; STS.expWatch9StickyColumns = true; STS.expWatch9ReportTab = true; STS.expRelatedGrid = false; STS.expWatch8 = false; STS.expWatch8NoMore = false; STS.expMoveCountsToButtons = false; STS.expSharrow = false; STS.expWatch9A = false; STS.expWatch9B = false; STS.expWatch10Beta = false; STS.expWMRButtonsLowercase = false; } if (theSetting == "disableEverything") { localStorage.setItem(theSetting,"true"); var settingArray = document.querySelectorAll('[state-id="all"] .lb-setting[checked="true"]'); settingArray.forEach(item => { if (!item.classList.contains('startube-iron-setting')) { item.click(); } }); window.location.reload(); } function presetSelected(theSetting) { disableOtherPresets(theSetting); doIronSettings(); applySettings(); window.location.reload(); } if ( theSetting == "presetAozora2011" ) { STCosmicPandaSettings(); STAozoraSettings(); presetSelected(theSetting); } if ( theSetting == "presetCosmicPanda" ) { STCosmicPandaSettings(); presetSelected(theSetting); } if ( theSetting == "presetEpicPanda" ) { STEpicPandaSettings(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2013_1" ) { STModernHitchhikerSettings(); ST2014Settings(); ST2013Settings(); STMid2013Settings(); STEarly2013Settings(); STWatch7(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2013_1Alt" ) { STModernHitchhikerSettings(); ST2014Settings(); ST2013Settings(); STMid2013Settings(); STEarly2013Settings(); STAltWatch9(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2013_2" ) { STModernHitchhikerSettings(); ST2014Settings(); ST2013Settings(); STMid2013Settings(); STWatch7(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2013_2Alt" ) { STModernHitchhikerSettings(); ST2014Settings(); ST2013Settings(); STMid2013Settings(); STAltWatch9(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2013_3" ) { STModernHitchhikerSettings(); ST2014Settings(); ST2013Settings(); STWatch7(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2013_3Alt" ) { STModernHitchhikerSettings(); ST2014Settings(); ST2013Settings(); STAltWatch9(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2014" ) { STModernHitchhikerSettings(); ST2014Settings(); STWatch7(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2014Alt" ) { STModernHitchhikerSettings(); ST2014Settings(); STAltWatch9(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2015" ) { STModernHitchhikerSettings(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2015Alt" ) { STModernHitchhikerSettings(); STAltWatch9(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2015_Early" ) { STModernHitchhikerSettings(); STEarly2015Settings(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2016" ) { STModernHitchhikerSettings(); ST2016Settings(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2016Alt" ) { STModernHitchhikerSettings(); ST2016Settings(); STAltWatch9(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2016_Mid" ) { STModernHitchhikerSettings(); ST2016Settings(); STMid2016Settings(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2016_Early" ) { STModernHitchhikerSettings(); STEarly2016Settings(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2017_Early" ) { STModernHitchhikerSettings(); ST2016Settings(); STEarly2017Settings(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2017" ) { STModernHitchhikerSettings(); ST2016Settings(); ST2017Settings(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2017Alt" ) { STModernHitchhikerSettings(); ST2016Settings(); ST2017Settings(); STAltWatch9(); presetSelected(theSetting); } if ( theSetting == "presetHitchhiker2017Ultra" ) { STModernHitchhikerSettings(); ST2016Settings(); ST2017Settings(); STAltWatch9(); STIdealLayout(); presetSelected(theSetting); } if ( theSetting == "presetPolymer2016" ) { ST2019Settings(); ST2016PolySettings(); presetSelected(theSetting); } if ( theSetting == "presetPolymer2019" ) { ST2019Settings(); presetSelected(theSetting); } if ( theSetting == "presetPolymer2020" ) { ST2019Settings(); ST2020Settings(); presetSelected(theSetting); } if ( theSetting == "presetPolymer2021" ) { ST2019Settings(); ST2020Settings(); ST2021Settings(); presetSelected(theSetting); } if ( theSetting == "presetPolymer2022" ) { ST2019Settings(); ST2020Settings(); ST2021Settings(); ST2022Settings(); presetSelected(theSetting); } function doIronSettings() { let irons = Object.entries(STS.ironSettings); irons.forEach(i => { let name = i[0]; let value = i[1]; STS[name] = value; }); } } function STAltWatch9() { STS.expRelatedTabs = true; STS.expRelatedTabsHoldsSubscribe = true; STS.expWatch9 = true; STS.expWatch9NoOwner = true; STS.expWatch9TrueExpander = false; STS.expVerticalWatch9 = false; STS.expWatch9SidebarBus = false; STS.expWatch9StickyColumns = false; STS.expWatch9ReportTab = true; STS.expRelatedGrid = false; STS.expWatch8 = false; STS.expWatch8NoMore = false; STS.expMoveCountsToButtons = false; STS.expSharrow = false; STS.expWatch9A = false; STS.expWatch9B = false; STS.expWatch10Beta = false; STS.expWMRButtonsLowercase = false; STS.expNoVideosLink = false; } function STWatch7() { STS.expRelatedTabs = false; STS.expRelatedTabsHoldsSubscribe = false; STS.expWatch9 = false; STS.expWatch9NoOwner = false; STS.expWatch9TrueExpander = false; STS.expVerticalWatch9 = false; STS.expWatch9SidebarBus = false; STS.expWatch9StickyColumns = false; STS.expRelatedGrid = false; STS.expWatch8 = false; STS.expWatch8NoMore = false; STS.expMoveCountsToButtons = false; STS.expSharrow = false; STS.expWatch9A = false; STS.expWatch9B = false; STS.expWatch10Beta = false; STS.expWMRButtonsLowercase = false; } function STModernHitchhikerSettings() { STS.expHomepageRedirectsToFeed = false; STS.expLogoLinksToFeed = false; STS.expLogoLinksToSubs = false; STS.expRelatedThumbsSizeMedium = false; STS.expRelatedThumbsSizeLarge = false; STS.expRelatedThumbsSizeStupid = false; STS.expAlwaysShowCompactDate = false; STS.expMoveGuideMainSectionToTop = false; STS.expMoreTooltips = false; STS.expMoveGuideButtonToTopbar = false; STS.expRelatedTabs = false; STS.expRelatedTabsHoldsSubscribe = false; STS.expWatch9 = false; STS.expWatch9NoOwner = false; STS.expWatch9TrueExpander = false; STS.expVerticalWatch9 = false; STS.expWatch9SidebarBus = false; STS.expWatch9StickyColumns = false; STS.expWatch9ReportTab = false; STS.expRelatedGrid = false; STS.expWatch8 = true; STS.expWatch8NoMore = false; STS.expMoveCountsToButtons = true; STS.expSharrow = false; STS.expGuideAlwaysPinned = false; STS.expWatch7AboutTabRename = false; STS.expWatch7AboutTabRename2 = false; STS.expTwoColumnSearchResults = false; STS.configNoTabTopBorder = true; STS.configWatch7SidebarCardShadow = true; STS.expFlatLogo = false; STS.expInvertLogo = false; STS.expGlossyLogo = false; STS.expClassicTitle = false; STS.expClassicGuide = false; STS.expClassicSubscribe = false; STS.expClassicStyles = false; STS.expClassicLtod = false; STS.expClassicButtons = false; STS.expBigSearchThumbs = false; STS.expBiggerSearchThumbs = false; STS.expNoVideosLink = true; STS.expModernStyles = true; STS.expModernNotifIcon = false; STS.expModernTopbar = true; STS.expModernUpload = true; STS.expModernGuideButton = false; STS.expModernSearchIcon = false; STS.expSearchText = false; STS.expModernTitle = false; STS.expModernGuide = false; STS.expModernHome = true; STS.expModernPlaylists = true; STS.expModernPlaylistThumbnails = true; STS.expPlaylistRedBorder = true; STS.expPlaylistTimestamps = true; STS.expTrueScrollableGuide = true; STS.expModernPlayer = true; STS.expModernPlayerV2 = false; STS.expViewsString = false; STS.expGoogleApps = false; STS.expCommentsFullWidth = true; STS.expNoByText = false; STS.expAccountMenu = true; STS.expStaticSite = false; STS.expHideAppbar = false; STS.expEpicWatch7 = false; STS.expEpicWatch7Flat = false; STS.expEpicHeader = false; STS.expEpicStyling = false; STS.expEpicFeeds = false; STS.expCosmicHeader = false; STS.expCosmicBG = false; STS.expCosmicButtons = false; STS.expCosmicStyles = false; STS.expCosmicBanners = false; STS.expCosmicBannersV2 = false; STS.expCosmicComments = false; STS.expCosmicGuideStyle = false; STS.expCosmicGuideLayout = false; STS.expCosmicFeedsV1 = false; STS.expCosmicFeedsThirdColumn = false; STS.expWatch5D = false; STS.expChannels3 = false; STS.expNoGuide = false; STS.expGuideOnFeedsOnly = false; STS.expAozoraHome = false; STS.expAozoraHeader = false; STS.expAozoraBG = false; STS.expAozoraStyles = false; STS.expAozoraSubscribe = false; STS.expAozoraTopbarLinks = false; STS.expWatch5C = false; STS.expHomeTab = false; STS.expRoboto = false; STS.expCenteredSearch = false; STS.expBigSearch = false; STS.expSecondarySearchIcon = false; STS.expMaterialSearch = false; STS.expPolymerShell = false; STS.expEarlyPolymerShell = false; STS.expEarlyPolymerGuide = false; STS.expPolymerGen2Colors = false; STS.expPolymerSubscribe = false; STS.expPolymerGen2Subscribe = false; STS.expPolymerStyles = false; STS.expPolymerChannels = false; STS.expPolymerComments = false; STS.expPolymerTooltips = false; STS.expMaterialSignIn = false; STS.expRichGridHome = false; STS.expWatch9A = false; STS.expWatch9B = false; STS.expWatch10Beta = false; STS.expWMRButtonsLowercase = false; STS.expOutlineIcons = false; STS.expRoundedTopbarPfp = false; STS.expUploadIcon = false; STS.expHideYoodles = false; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("nirvana15"); } } function STEarly2015Settings() { STS.expModernPlayer = false; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("nirvana15"); } } function ST2016Settings() { STS.expRelatedThumbsSizeLarge = true; STS.expSharrow = true; STS.expFlatLogo = true; STS.expModernNotifIcon = true; STS.expModernGuideButton = true; STS.expModernSearchIcon = true; STS.expSearchText = true; STS.expModernTitle = true; STS.expModernGuide = true; STS.expModernHome = true; STS.expPlaylistRedBorder = false; STS.expTrueScrollableGuide = true; STS.expModernPlayer = false; STS.expModernPlayerV2 = true; STS.expViewsString = true; STS.expNoByText = true; STS.expHomeTab = true; STS.expRoboto = true; STS.expRoundedTopbarPfp = true; STS.expHideYoodles = true; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("nirvana16"); } } function STEarly2016Settings() { STS.expSharrow = true; STS.expFlatLogo = true; STS.expModernGuideButton = true; STS.expModernSearchIcon = true; STS.expModernGuide = true; STS.expModernHome = true; STS.expTrueScrollableGuide = true; STS.expNoByText = true; STS.expHomeTab = true; STS.expRoboto = true; STS.expRoundedTopbarPfp = true; STS.expHideYoodles = true; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("nirvana15"); } } function STMid2016Settings() { STS.expRelatedThumbsSizeLarge = false; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("nirvana16"); } } function STEarly2017Settings() { STS.expBigSearchThumbs = true; STS.expUploadIcon = true; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("nirvana16"); } } function ST2017Settings() { STS.expFlatLogo = false; STS.expInvertLogo = true; STS.expBigSearchThumbs = true; STS.expUploadIcon = true; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("nirvana16"); } } function STIdealLayout() { STS.expVerticalWatch9 = true; STS.expWatch9SidebarBus = true; STS.expWatch9StickyColumns = true; STS.expRelatedGrid = true; STS.expGuideAlwaysPinned = true; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("nirvana16"); } } function ST2014Settings() { STS.expModernStyles = false; STS.expModernNotifIcon = false; STS.expModernGuideButton = false; STS.expModernSearchIcon = false; STS.expModernHome = false; STS.expModernTopbar = false; STS.expModernPlaylistThumbnails = false; STS.expTrueScrollableGuide = false; STS.expModernPlayer = false; STS.expModernPlayerV2 = false; STS.expAccountMenu = false; STS.expHideYoodles = false; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("nirvana14"); } } function ST2013Settings() { STS.expModernPlaylists = false; STS.expPlaylistRedBorder = false; STS.expPlaylistTimestamps = false; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("hitchhiker13"); } } function STMid2013Settings() { STS.expClassicLtod = true; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("hitchhiker13mid"); } } function STEarly2013Settings() { STS.expChannels3 = true; STS.expClassicTitle = true; STS.expClassicGuide = true; STS.expClassicSubscribe = true; STS.expClassicStyles = true; STS.expClassicLtod = true; STS.expClassicButtons = true; STS.expAozoraHome = true; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("hitchhiker13early"); } } function STEpicPandaSettings() { STS.expHomepageRedirectsToFeed = false; STS.expLogoLinksToFeed = true; STS.expLogoLinksToSubs = false; STS.expRelatedThumbsSizeMedium = false; STS.expRelatedThumbsSizeLarge = false; STS.expRelatedThumbsSizeStupid = false; STS.expAlwaysShowCompactDate = false; STS.expMoveGuideMainSectionToTop = false; STS.expMoreTooltips = true; STS.expMoveGuideButtonToTopbar = false; STS.expRelatedTabs = false; STS.expRelatedTabsHoldsSubscribe = false; STS.expWatch9 = false; STS.expWatch9NoOwner = false; STS.expWatch9TrueExpander = false; STS.expVerticalWatch9 = false; STS.expWatch9SidebarBus = false; STS.expWatch9StickyColumns = false; STS.expWatch9ReportTab = false; STS.expRelatedGrid = false; STS.expWatch8 = false; STS.expWatch8NoMore = false; STS.expMoveCountsToButtons = false; STS.expSharrow = false; STS.expGuideAlwaysPinned = false; STS.expWatch7AboutTabRename = false; STS.expWatch7AboutTabRename2 = true; STS.expTwoColumnSearchResults = false; STS.configNoTabTopBorder = true; STS.configWatch7SidebarCardShadow = true; STS.expFlatLogo = false; STS.expInvertLogo = false; STS.expGlossyLogo = false; STS.expClassicTitle = false; STS.expClassicGuide = false; STS.expClassicSubscribe = false; STS.expClassicStyles = false; STS.expClassicLtod = false; STS.expClassicButtons = true; STS.expBigSearchThumbs = false; STS.expBiggerSearchThumbs = false; STS.expNoVideosLink = false; STS.expModernStyles = false; STS.expModernNotifIcon = false; STS.expModernTopbar = false; STS.expModernUpload = true; STS.expModernGuideButton = false; STS.expModernSearchIcon = false; STS.expSearchText = false; STS.expModernTitle = false; STS.expModernGuide = false; STS.expModernHome = false; STS.expModernPlaylists = false; STS.expModernPlaylistThumbnails = false; STS.expPlaylistRedBorder = false; STS.expTrueScrollableGuide = false; STS.expModernPlayer = false; STS.expModernPlayerV2 = false; STS.expViewsString = false; STS.expGoogleApps = false; STS.expCommentsFullWidth = true; STS.expNoByText = false; STS.expAccountMenu = false; STS.expStaticSite = true; STS.expHideAppbar = true; STS.expEpicWatch7 = true; STS.expEpicWatch7Flat = true; STS.expEpicHeader = true; STS.expEpicStyling = true; STS.expEpicFeeds = true; STS.expCosmicHeader = false; STS.expCosmicBG = false; STS.expCosmicButtons = false; STS.expCosmicStyles = false; STS.expCosmicBanners = false; STS.expCosmicBannersV2 = false; STS.expCosmicComments = false; STS.expCosmicGuideStyle = false; STS.expCosmicGuideLayout = true; STS.expCosmicFeedsV1 = false; STS.expCosmicFeedsThirdColumn = false; STS.expWatch5D = false; STS.expChannels3 = true; STS.expNoGuide = false; STS.expGuideOnFeedsOnly = true; STS.expAozoraHome = true; STS.expAozoraHeader = false; STS.expAozoraBG = false; STS.expAozoraStyles = false; STS.expAozoraSubscribe = false; STS.expAozoraTopbarLinks = false; STS.expWatch5C = false; STS.expHomeTab = false; STS.expRoboto = false; STS.expCenteredSearch = false; STS.expBigSearch = false; STS.expSecondarySearchIcon = false; STS.expMaterialSearch = false; STS.expPolymerShell = false; STS.expEarlyPolymerShell = false; STS.expEarlyPolymerGuide = false; STS.expPolymerGen2Colors = false; STS.expPolymerSubscribe = false; STS.expPolymerGen2Subscribe = false; STS.expPolymerStyles = false; STS.expPolymerChannels = false; STS.expPolymerComments = false; STS.expPolymerTooltips = false; STS.expMaterialSignIn = false; STS.expRichGridHome = false; STS.expWatch9A = false; STS.expWatch9B = false; STS.expWatch10Beta = false; STS.expWMRButtonsLowercase = false; STS.expOutlineIcons = false; STS.expRoundedTopbarPfp = false; STS.expUploadIcon = false; STS.expHideYoodles = true; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("cosmic"); } } function STCosmicPandaSettings() { STS.expHomepageRedirectsToFeed = true; STS.expLogoLinksToFeed = true; STS.expLogoLinksToSubs = false; STS.expRelatedThumbsSizeMedium = false; STS.expRelatedThumbsSizeLarge = false; STS.expRelatedThumbsSizeStupid = false; STS.expAlwaysShowCompactDate = false; STS.expMoveGuideMainSectionToTop = false; STS.expMoreTooltips = true; STS.expMoveGuideButtonToTopbar = false; STS.expRelatedTabs = false; STS.expRelatedTabsHoldsSubscribe = false; STS.expWatch9 = false; STS.expWatch9NoOwner = false; STS.expWatch9TrueExpander = false; STS.expVerticalWatch9 = false; STS.expWatch9SidebarBus = false; STS.expWatch9StickyColumns = false; STS.expWatch9ReportTab = false; STS.expRelatedGrid = false; STS.expWatch8 = false; STS.expWatch8NoMore = false; STS.expMoveCountsToButtons = false; STS.expSharrow = false; STS.expGuideAlwaysPinned = false; STS.expWatch7AboutTabRename = false; STS.expWatch7AboutTabRename2 = false; STS.expTwoColumnSearchResults = false; STS.configNoTabTopBorder = true; STS.configWatch7SidebarCardShadow = true; STS.expFlatLogo = false; STS.expInvertLogo = false; STS.expGlossyLogo = false; STS.expClassicTitle = false; STS.expClassicGuide = false; STS.expClassicSubscribe = false; STS.expClassicStyles = false; STS.expClassicLtod = false; STS.expClassicButtons = false; STS.expBigSearchThumbs = false; STS.expBiggerSearchThumbs = false; STS.expNoVideosLink = false; STS.expModernStyles = false; STS.expModernNotifIcon = false; STS.expModernTopbar = false; STS.expModernUpload = true; STS.expModernGuideButton = false; STS.expModernSearchIcon = false; STS.expSearchText = false; STS.expModernTitle = false; STS.expModernGuide = false; STS.expModernHome = false; STS.expModernPlaylists = false; STS.expModernPlaylistThumbnails = false; STS.expPlaylistRedBorder = false; STS.expPlaylistTimestamps = false; STS.expTrueScrollableGuide = true; STS.expModernPlayer = false; STS.expModernPlayerV2 = false; STS.expViewsString = false; STS.expGoogleApps = false; STS.expCommentsFullWidth = true; STS.expNoByText = false; STS.expAccountMenu = false; STS.expStaticSite = true; STS.expHideAppbar = true; STS.expEpicWatch7 = false; STS.expEpicWatch7Flat = false; STS.expEpicHeader = false; STS.expEpicStyling = false; STS.expEpicFeeds = false; STS.expCosmicHeader = true; STS.expCosmicBG = true; STS.expCosmicButtons = true; STS.expCosmicStyles = true; STS.expCosmicBanners = true; STS.expCosmicBannersV2 = false; STS.expCosmicComments = true; STS.expCosmicGuideStyle = true; STS.expCosmicGuideLayout = true; STS.expCosmicFeedsV1 = true; STS.expCosmicFeedsThirdColumn = true; STS.expWatch5D = true; STS.expChannels3 = true; STS.expNoGuide = false; STS.expGuideOnFeedsOnly = true; STS.expAozoraHome = true; STS.expAozoraHeader = false; STS.expAozoraBG = false; STS.expAozoraStyles = false; STS.expAozoraSubscribe = false; STS.expAozoraTopbarLinks = true; STS.expWatch5C = false; STS.expHomeTab = false; STS.expRoboto = false; STS.expCenteredSearch = false; STS.expBigSearch = false; STS.expSecondarySearchIcon = false; STS.expMaterialSearch = false; STS.expPolymerShell = false; STS.expEarlyPolymerShell = false; STS.expEarlyPolymerGuide = false; STS.expPolymerGen2Colors = false; STS.expPolymerSubscribe = false; STS.expPolymerGen2Subscribe = false; STS.expPolymerStyles = false; STS.expPolymerChannels = false; STS.expPolymerComments = false; STS.expPolymerTooltips = false; STS.expMaterialSignIn = false; STS.expRichGridHome = false; STS.expWatch9A = false; STS.expWatch9B = false; STS.expWatch10Beta = false; STS.expWMRButtonsLowercase = false; STS.expOutlineIcons = false; STS.expRoundedTopbarPfp = false; STS.expUploadIcon = false; STS.expHideYoodles = true; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("cosmic"); } } function STAozoraSettings() { STS.expHomepageRedirectsToFeed = false; STS.expLogoLinksToFeed = false; STS.expCosmicHeader = false; STS.expCosmicBG = false; STS.expCosmicButtons = false; STS.expCosmicStyles = false; STS.expCosmicBanners = false; STS.expCosmicComments = false; STS.expCosmicGuideStyle = false; STS.expCosmicGuideLayout = true; STS.expCosmicFeedsV1 = false; STS.expCosmicFeedsThirdColumn = false; STS.expWatch5D = false; STS.expAozoraHeader = true; STS.expAozoraBG = true; STS.expAozoraStyles = true; STS.expAozoraSubscribe = true; STS.expWatch5C = true; } function ST2019Settings() { STS.expHomepageRedirectsToFeed = false; STS.expLogoLinksToFeed = false; STS.expLogoLinksToSubs = false; STS.expRelatedThumbsSizeMedium = false; STS.expRelatedThumbsSizeLarge = true; STS.expRelatedThumbsSizeStupid = false; STS.expAlwaysShowCompactDate = true; STS.expMoveGuideMainSectionToTop = false; STS.expMoreTooltips = true; STS.expMoveGuideButtonToTopbar = false; STS.expRelatedTabs = false; STS.expRelatedTabsHoldsSubscribe = false; STS.expWatch9 = false; STS.expWatch9NoOwner = false; STS.expWatch9TrueExpander = false; STS.expVerticalWatch9 = false; STS.expWatch9SidebarBus = false; STS.expWatch9StickyColumns = false; STS.expWatch9ReportTab = false; STS.expRelatedGrid = false; STS.expWatch8 = false; STS.expWatch8NoMore = false; STS.expMoveCountsToButtons = true; STS.expSharrow = true; STS.expGuideAlwaysPinned = false; STS.expWatch7AboutTabRename = false; STS.expWatch7AboutTabRename2 = false; STS.expTwoColumnSearchResults = false; STS.configNoTabTopBorder = true; STS.configWatch7SidebarCardShadow = true; STS.expFlatLogo = false; STS.expInvertLogo = true; STS.expGlossyLogo = false; STS.expClassicTitle = false; STS.expClassicGuide = false; STS.expClassicSubscribe = false; STS.expClassicStyles = false; STS.expClassicLtod = false; STS.expClassicButtons = false; STS.expBigSearchThumbs = true; STS.expBiggerSearchThumbs = false; STS.expNoVideosLink = false; STS.expModernStyles = false; STS.expModernNotifIcon = false; STS.expModernTopbar = true; STS.expModernUpload = true; STS.expModernGuideButton = true; STS.expModernSearchIcon = true; STS.expSearchText = true; STS.expModernTitle = true; STS.expModernGuide = true; STS.expModernHome = true; STS.expModernPlaylists = true; STS.expModernPlaylistThumbnails = true; STS.expPlaylistRedBorder = false; STS.expPlaylistTimestamps = true; STS.expTrueScrollableGuide = true; STS.expModernPlayer = false; STS.expModernPlayerV2 = true; STS.expViewsString = true; STS.expGoogleApps = false; STS.expCommentsFullWidth = true; STS.expNoByText = true; STS.expAccountMenu = true; STS.expStaticSite = false; STS.expHideAppbar = true; STS.expEpicWatch7 = false; STS.expEpicWatch7Flat = false; STS.expEpicHeader = false; STS.expEpicStyling = false; STS.expEpicFeeds = false; STS.expCosmicHeader = false; STS.expCosmicBG = false; STS.expCosmicButtons = false; STS.expCosmicStyles = false; STS.expCosmicBanners = false; STS.expCosmicBannersV2 = false; STS.expCosmicComments = false; STS.expCosmicGuideStyle = false; STS.expCosmicGuideLayout = false; STS.expCosmicFeedsV1 = false; STS.expCosmicFeedsThirdColumn = false; STS.expWatch5D = false; STS.expChannels3 = false; STS.expNoGuide = false; STS.expGuideOnFeedsOnly = false; STS.expAozoraHome = false; STS.expAozoraHeader = false; STS.expAozoraBG = false; STS.expAozoraStyles = false; STS.expAozoraSubscribe = false; STS.expAozoraTopbarLinks = false; STS.expWatch5C = false; STS.expHomeTab = true; STS.expRoboto = true; STS.expCenteredSearch = true; STS.expBigSearch = false; STS.expSecondarySearchIcon = false; STS.expMaterialSearch = false; STS.expPolymerShell = true; STS.expEarlyPolymerShell = false; STS.expEarlyPolymerGuide = false; STS.expPolymerGen2Colors = false; STS.expPolymerSubscribe = true; STS.expPolymerGen2Subscribe = false; STS.expPolymerStyles = true; STS.expPolymerChannels = true; STS.expPolymerComments = true; STS.expPolymerTooltips = true; STS.expMaterialSignIn = true; STS.expRichGridHome = false; STS.expWatch9A = true; STS.expWatch9B = false; STS.expWatch10Beta = false; STS.expWMRButtonsLowercase = false; STS.expOutlineIcons = false; STS.expRoundedTopbarPfp = true; STS.expUploadIcon = true; STS.expHideYoodles = true; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("poly16"); } } function ST2016PolySettings() { STS.expFlatLogo = true; STS.expInvertLogo = false; STS.expBigSearch = true; STS.expMaterialSearch = true; STS.expEarlyPolymerShell = true; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("poly16"); } } function ST2020Settings() { STS.expBigSearchThumbs = false; STS.expBiggerSearchThumbs = true; STS.expPolymerGen2Colors = true; STS.expPolymerGen2Subscribe = true; STS.expWatch9A = false; STS.expWatch9B = true; STS.expRichGridHome = true; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("poly16"); } } function ST2021Settings() { STS.expBigSearch = true; STS.expOutlineIcons = true; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("poly16"); } } function ST2022Settings() { STS.expSecondarySearchIcon = true; STS.expWatch9A = false; STS.expWatch9B = false; STS.expWatch10Beta = true; STS.expWMRButtonsLowercase = true; if (STS.STPresetsAlsoSetV3Settings == true) { setV3Settings("poly16"); } } function setV3Settings(preset) { if (preset == "poly16") { V3_SETTINGS_CONF.JFK_SIGN_IN = false; V3_SETTINGS_CONF.APPBAR_FLEXWATCH_MINI = true; V3_SETTINGS_CONF.SITE_CENTER_ALIGNED = true; V3_SETTINGS_CONF.APPBAR_GUIDE = true; V3_SETTINGS_CONF.MASTHEAD_APPBAR_LAUNCH = true; V3_SETTINGS_CONF.PROMINENT_UPLOAD_BUTTON = false; V3_SETTINGS_CONF.APPBAR_GUIDE_BUTTON_SIMPLE_STYLE = true; V3_SETTINGS_CONF.SITE_AS_GIANT_CARD = true; V3_SETTINGS_CONF.NEW_APPBAR_GUIDE_ICONS = true; V3_SETTINGS_CONF.APPBAR_GUIDE_PINNING = true; V3_SETTINGS_CONF.CARDIFIED_PAGE = false; V3_SETTINGS_CONF.INDIVIDUAL_CARDS_WATCH = false; V3_SETTINGS_CONF.WATCH7_ACTION_PANELS_USE_ICONS = false; V3_SETTINGS_CONF.WATCH7_TEXT_RATING = false; V3_SETTINGS_CONF.MASTHEAD_APPBAR_FUSION = true; V3_SETTINGS_CONF.WATCH8 = false; V3_SETTINGS_CONF.APPBAR_GUIDE_IS_PART_OF_MASTHEAD_POSITIONER = true; V3_SETTINGS_CONF.W2W_AS_LOHP_EVERYTIME = false; V3_SETTINGS_CONF.LOHP_VIDEO_FIX_THUMB_ASPECTRATIO = false; V3_SETTINGS_CONF.APPBAR_GUIDE_SCROLL = false; V3_SETTINGS_CONF.BODY_LEGACY_BACKGROUND = false; V3_SETTINGS_CONF.MASTHEAD_POSITIONER = true; V3_SETTINGS_CONF.LEFT_ALIGN_GUIDE_FIXED = true; V3_SETTINGS_CONF.MASTHEAD_SHOW_RED_LOGO_FOR_REDUSER = false; } if (preset == "hitchhiker13") { V3_SETTINGS_CONF.APPBAR_FLEXWATCH_MINI = false; V3_SETTINGS_CONF.SITE_CENTER_ALIGNED = false; V3_SETTINGS_CONF.APPBAR_GUIDE = false; V3_SETTINGS_CONF.MASTHEAD_APPBAR_LAUNCH = false; V3_SETTINGS_CONF.PROMINENT_UPLOAD_BUTTON = false; V3_SETTINGS_CONF.APPBAR_GUIDE_BUTTON_SIMPLE_STYLE = false; V3_SETTINGS_CONF.SITE_AS_GIANT_CARD = false; V3_SETTINGS_CONF.NEW_APPBAR_GUIDE_ICONS = false; V3_SETTINGS_CONF.APPBAR_GUIDE_PINNING = false; V3_SETTINGS_CONF.CARDIFIED_PAGE = false; V3_SETTINGS_CONF.INDIVIDUAL_CARDS_WATCH = false; V3_SETTINGS_CONF.WATCH7_ACTION_PANELS_USE_ICONS = false; V3_SETTINGS_CONF.WATCH7_TEXT_RATING = false; V3_SETTINGS_CONF.MASTHEAD_APPBAR_FUSION = false; V3_SETTINGS_CONF.WATCH8 = false; V3_SETTINGS_CONF.NEW_LOGO = true; V3_SETTINGS_CONF.BODY_LEGACY_BACKGROUND = false; V3_SETTINGS_CONF.MASTHEAD_POSITIONER = false; V3_SETTINGS_CONF.LEFT_ALIGN_GUIDE_FIXED = false; } if (preset == "hitchhiker13mid") { V3_SETTINGS_CONF.NEW_LOGO = false; V3_SETTINGS_CONF.W2W_AS_LOHP_EVERYTIME = false; V3_SETTINGS_CONF.LOHP_VIDEO_FIX_THUMB_ASPECTRATIO = false; V3_SETTINGS_CONF.BODY_LEGACY_BACKGROUND = false; } if (preset == "hitchhiker13early") { V3_SETTINGS_CONF.NEW_LOGO = false; V3_SETTINGS_CONF.W2W_AS_LOHP_EVERYTIME = true; V3_SETTINGS_CONF.LOHP_VIDEO_FIX_THUMB_ASPECTRATIO = true; V3_SETTINGS_CONF.BODY_LEGACY_BACKGROUND = true; } if (preset == "nirvana14") { V3_SETTINGS_CONF.APPBAR_FLEXWATCH_MINI = false; V3_SETTINGS_CONF.SITE_CENTER_ALIGNED = true; V3_SETTINGS_CONF.APPBAR_GUIDE = true; V3_SETTINGS_CONF.MASTHEAD_APPBAR_LAUNCH = true; V3_SETTINGS_CONF.PROMINENT_UPLOAD_BUTTON = false; V3_SETTINGS_CONF.APPBAR_GUIDE_BUTTON_SIMPLE_STYLE = true; V3_SETTINGS_CONF.SITE_AS_GIANT_CARD = true; V3_SETTINGS_CONF.NEW_APPBAR_GUIDE_ICONS = true; V3_SETTINGS_CONF.APPBAR_GUIDE_PINNING = true; V3_SETTINGS_CONF.CARDIFIED_PAGE = true; V3_SETTINGS_CONF.INDIVIDUAL_CARDS_WATCH = false; V3_SETTINGS_CONF.WATCH7_ACTION_PANELS_USE_ICONS = false; V3_SETTINGS_CONF.WATCH7_TEXT_RATING = false; V3_SETTINGS_CONF.MASTHEAD_APPBAR_FUSION = true; V3_SETTINGS_CONF.WATCH8 = false; V3_SETTINGS_CONF.APPBAR_GUIDE_IS_PART_OF_MASTHEAD_POSITIONER = true; V3_SETTINGS_CONF.APPBAR_GUIDE_SCROLL = true; V3_SETTINGS_CONF.NEW_LOGO = true; V3_SETTINGS_CONF.BODY_LEGACY_BACKGROUND = false; V3_SETTINGS_CONF.MASTHEAD_POSITIONER = true; V3_SETTINGS_CONF.LEFT_ALIGN_GUIDE_FIXED = true; } if (preset == "nirvana15") { V3_SETTINGS_CONF.JFK_SIGN_IN = false; V3_SETTINGS_CONF.APPBAR_FLEXWATCH_MINI = true; V3_SETTINGS_CONF.SITE_CENTER_ALIGNED = true; V3_SETTINGS_CONF.APPBAR_GUIDE = true; V3_SETTINGS_CONF.MASTHEAD_APPBAR_LAUNCH = true; V3_SETTINGS_CONF.PROMINENT_UPLOAD_BUTTON = false; V3_SETTINGS_CONF.APPBAR_GUIDE_BUTTON_SIMPLE_STYLE = true; V3_SETTINGS_CONF.SITE_AS_GIANT_CARD = true; V3_SETTINGS_CONF.NEW_APPBAR_GUIDE_ICONS = true; V3_SETTINGS_CONF.APPBAR_GUIDE_PINNING = true; V3_SETTINGS_CONF.CARDIFIED_PAGE = true; V3_SETTINGS_CONF.INDIVIDUAL_CARDS_WATCH = true; V3_SETTINGS_CONF.WATCH7_ACTION_PANELS_USE_ICONS = false; V3_SETTINGS_CONF.WATCH7_TEXT_RATING = false; V3_SETTINGS_CONF.MASTHEAD_APPBAR_FUSION = true; V3_SETTINGS_CONF.WATCH8 = false; V3_SETTINGS_CONF.APPBAR_GUIDE_IS_PART_OF_MASTHEAD_POSITIONER = true; V3_SETTINGS_CONF.APPBAR_GUIDE_SCROLL = false; V3_SETTINGS_CONF.NEW_LOGO = true; V3_SETTINGS_CONF.BODY_LEGACY_BACKGROUND = false; V3_SETTINGS_CONF.MASTHEAD_POSITIONER = true; V3_SETTINGS_CONF.LEFT_ALIGN_GUIDE_FIXED = true; } if (preset == "nirvana16") { V3_SETTINGS_CONF.JFK_SIGN_IN = false; V3_SETTINGS_CONF.APPBAR_FLEXWATCH_MINI = true; V3_SETTINGS_CONF.SITE_CENTER_ALIGNED = true; V3_SETTINGS_CONF.APPBAR_GUIDE = true; V3_SETTINGS_CONF.MASTHEAD_APPBAR_LAUNCH = true; V3_SETTINGS_CONF.PROMINENT_UPLOAD_BUTTON = false; V3_SETTINGS_CONF.APPBAR_GUIDE_BUTTON_SIMPLE_STYLE = true; V3_SETTINGS_CONF.SITE_AS_GIANT_CARD = true; V3_SETTINGS_CONF.NEW_APPBAR_GUIDE_ICONS = true; V3_SETTINGS_CONF.APPBAR_GUIDE_PINNING = true; V3_SETTINGS_CONF.CARDIFIED_PAGE = true; V3_SETTINGS_CONF.INDIVIDUAL_CARDS_WATCH = true; V3_SETTINGS_CONF.WATCH7_ACTION_PANELS_USE_ICONS = false; V3_SETTINGS_CONF.WATCH7_TEXT_RATING = false; V3_SETTINGS_CONF.MASTHEAD_APPBAR_FUSION = true; V3_SETTINGS_CONF.WATCH8 = false; V3_SETTINGS_CONF.APPBAR_GUIDE_IS_PART_OF_MASTHEAD_POSITIONER = true; V3_SETTINGS_CONF.W2W_AS_LOHP_EVERYTIME = false; V3_SETTINGS_CONF.LOHP_VIDEO_FIX_THUMB_ASPECTRATIO = false; V3_SETTINGS_CONF.APPBAR_GUIDE_SCROLL = false; V3_SETTINGS_CONF.BODY_LEGACY_BACKGROUND = false; V3_SETTINGS_CONF.MASTHEAD_POSITIONER = true; V3_SETTINGS_CONF.LEFT_ALIGN_GUIDE_FIXED = true; } else if (preset == "cosmic") { V3_SETTINGS_CONF.JFK_SIGN_IN = false; V3_SETTINGS_CONF.APPBAR_FLEXWATCH_MINI = false; V3_SETTINGS_CONF.SITE_CENTER_ALIGNED = true; V3_SETTINGS_CONF.APPBAR_GUIDE = true; V3_SETTINGS_CONF.MASTHEAD_APPBAR_LAUNCH = true; V3_SETTINGS_CONF.PROMINENT_UPLOAD_BUTTON = false; V3_SETTINGS_CONF.APPBAR_GUIDE_BUTTON_SIMPLE_STYLE = true; V3_SETTINGS_CONF.SITE_AS_GIANT_CARD = true; V3_SETTINGS_CONF.NEW_APPBAR_GUIDE_ICONS = true; V3_SETTINGS_CONF.APPBAR_GUIDE_PINNING = true; V3_SETTINGS_CONF.CARDIFIED_PAGE = false; V3_SETTINGS_CONF.WATCH7_ACTION_PANELS_USE_ICONS = false; V3_SETTINGS_CONF.WATCH7_TEXT_RATING = true; V3_SETTINGS_CONF.MASTHEAD_APPBAR_FUSION = true; V3_SETTINGS_CONF.WATCH8 = false; V3_SETTINGS_CONF.APPBAR_GUIDE_IS_PART_OF_MASTHEAD_POSITIONER = true; V3_SETTINGS_CONF.W2W_AS_LOHP_EVERYTIME = true; V3_SETTINGS_CONF.LOHP_VIDEO_FIX_THUMB_ASPECTRATIO = true; V3_SETTINGS_CONF.APPBAR_GUIDE_SCROLL = false; V3_SETTINGS_CONF.BODY_LEGACY_BACKGROUND = false; V3_SETTINGS_CONF.MASTHEAD_POSITIONER = true; V3_SETTINGS_CONF.LEFT_ALIGN_GUIDE_FIXED = true; V3_SETTINGS_CONF.MASTHEAD_SHOW_RED_LOGO_FOR_REDUSER = false; } var V3_SETTINGS = localStorage.getItem("v3_local_db"); V3_SETTINGS = JSON.parse(V3_SETTINGS); V3_SETTINGS.config.db.yt = V3_SETTINGS_CONF; V3_SETTINGS = JSON.stringify(V3_SETTINGS); localStorage.setItem("v3_local_db",V3_SETTINGS); } function createWatch8(number) { if (document.querySelector(".cardified-page.exp-individual-cards-watch") == null) { number++; } let container = document.querySelector('#watch7-content.watch-content .yt-uix-button-panel'); var altWatch9 = document.createElement("div"); altWatch9.id = "watch8-container"; altWatch9.setAttribute("state","none"); altWatch9.innerHTML = `
    Add to
    Share
    Statistics
    Transcript
    Report
    More
    Statistics
    Transcript
    Channel videos
    `; container.insertBefore(altWatch9, container.children[number]); if (document.querySelector(".cardified-page") != null) { document.querySelector("#watch8-desc").setAttribute("class","yt-card yt-card-no-padding"); document.querySelector("#watch8-share").setAttribute("class","yt-card yt-card-no-padding"); document.querySelector("#watch8-stats").setAttribute("class","yt-card yt-card-no-padding"); document.querySelector("#watch8-transcript").setAttribute("class","yt-card yt-card-no-padding"); document.querySelector("#watch8-actions-row").setAttribute("class","yt-card yt-card-no-padding"); } var elm = "#watch8-container"; waitForElement(elm).then(function(elm) { if (canGo != false) { if (document.querySelector("#watch8-sentiment-actions #watch7-sentiment-actions") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#watch7-sentiment-actions"); var newHome5 = document.querySelector('#watch8-sentiment-actions'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch8-desc #action-panel-details") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#action-panel-details"); var newHome5 = document.querySelector('#watch8-desc'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch9-share #action-panel-share") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(2)").click(); } if (document.querySelector("#watch8-desc #action-panel-share") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#action-panel-share"); var newHome5 = document.querySelector('#watch8-share'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch7-secondary-actions .hid.yt-uix-button:nth-child(4)") == null) { if (document.querySelector("#watch9-share #action-panel-transcript") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(4)").click(); } if (document.querySelector("#watch8-desc #action-panel-transcript") == null) { var elm = ".watch-transcript"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#action-panel-transcript"); var newHome5 = document.querySelector('#watch8-transcript'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } } if (document.querySelector("#watch9-share #action-panel-stats") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(5)").click(); } if (document.querySelector("#watch8-desc #action-panel-stats") == null) { var elm = ".metric-label"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#action-panel-stats"); var newHome5 = document.querySelector('#watch8-stats'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch9-addto #action-panel-addto") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(3)").click(); } if (document.querySelector("#watch8-addto #action-panel-addto") == null) { var elm = ".playlist-items"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#action-panel-addto"); var newHome5 = document.querySelector('#watch8-addto'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } var nonfloater = document.querySelector("#nonfloater"); var addTo = document.querySelector("#addto.watch8-action"); var share = document.querySelector("#share.watch8-action"); var stats = document.querySelector("#stats.watch8-menuitem"); var stats2 = document.querySelector("#stats.watch8-button"); var transcript = document.querySelector("#transcript.watch8-menuitem"); var transcript2 = document.querySelector("#transcript.watch8-button"); var moreActions = document.querySelector("#more-actions.watch8-action"); var showScroller = document.querySelector("#channel-videos.watch8-action"); var close = document.querySelector("#watch8-close button"); if (document.querySelector("#watch7-secondary-actions .hid.yt-uix-button:nth-child(4)") != null) { document.querySelector("#transcript.watch8-button").classList.add("hid"); document.querySelector("#transcript.watch8-menuitem").setAttribute("visible","false"); } nonfloater.addEventListener("click", function() { document.querySelector("#watch8-addto").setAttribute("visible", "false"); document.querySelector("#watch8-more").setAttribute("visible", "false"); document.querySelector("#nonfloater").setAttribute("visible", "false"); document.querySelector("#watch8-container").setAttribute("addto-visible", "false"); document.querySelector("#watch8-container").setAttribute("more-visible", "false"); }); addTo.addEventListener("click", function() { if (document.querySelector("#watch8-addto[visible='false']") != null) { document.querySelector("#watch8-addto").setAttribute("visible", "true"); document.querySelector("#nonfloater").setAttribute("visible", "true"); document.querySelector("#watch8-container").setAttribute("addto-visible", "true"); } else { document.querySelector("#watch8-addto").setAttribute("visible", "false"); document.querySelector("#nonfloater").setAttribute("visible", "false"); document.querySelector("#watch8-container").setAttribute("addto-visible", "false"); } }); share.addEventListener("click", function() { if (document.querySelector("#watch8-container[state='share']") != null) { document.querySelector("#watch8-container").setAttribute("state", "none"); } else { document.querySelector("#watch8-container").setAttribute("state", "share"); } }); moreActions.addEventListener("click", function() { if (document.querySelector("#watch8-more[visible='false']") != null) { document.querySelector("#watch8-more").setAttribute("visible", "true"); document.querySelector("#nonfloater").setAttribute("visible", "true"); document.querySelector("#watch8-container").setAttribute("more-visible", "true"); } else { document.querySelector("#watch8-more").setAttribute("visible", "false"); document.querySelector("#nonfloater").setAttribute("visible", "false"); document.querySelector("#watch8-container").setAttribute("more-visible", "false"); } }); stats.addEventListener("click", function() { document.querySelector("#watch8-more").setAttribute("visible", "false"); document.querySelector("#nonfloater").setAttribute("visible", "false"); document.querySelector("#watch8-container").setAttribute("more-visible", "false"); if (document.querySelector("#watch8-container[state='stats']") != null) { document.querySelector("#watch8-container").setAttribute("state", "none"); } else { document.querySelector("#watch8-container").setAttribute("state", "stats"); } }); stats2.addEventListener("click", function() { if (document.querySelector("#watch8-container[state='stats']") != null) { document.querySelector("#watch8-container").setAttribute("state", "none"); } else { document.querySelector("#watch8-container").setAttribute("state", "stats"); } }); transcript.addEventListener("click", function() { document.querySelector("#watch8-more").setAttribute("visible", "false"); document.querySelector("#nonfloater").setAttribute("visible", "false"); document.querySelector("#watch8-container").setAttribute("more-visible", "false"); if (document.querySelector("#watch8-container[state='transcript']") != null) { document.querySelector("#watch8-container").setAttribute("state", "none"); } else { document.querySelector("#watch8-container").setAttribute("state", "transcript"); } }); transcript2.addEventListener("click", function() { if (document.querySelector("#watch8-container[state='transcript']") != null) { document.querySelector("#watch8-container").setAttribute("state", "none"); } else { document.querySelector("#watch8-container").setAttribute("state", "transcript"); } }); close.addEventListener("click", function() { document.querySelector("#watch8-container").setAttribute("state", "none"); }); var elm = "#watch-uploader-info"; waitForElement(elm).then(function(elm) { if (canGo != false) { // applyMetadata(); } }); function applyMetadata() { } } }); } function createPopups() { if ($("#wmr-popups")) { $("#wmr-popups").remove(); } let container = $(".spitfire-body-container"); var newElem = document.createElement("div"); newElem.id = "wmr-popups"; newElem.innerHTML = `
    `; container.insertBefore(newElem, container.children[1]); document.querySelector("html").setAttribute("addto-visible", "false"); document.querySelector("html").setAttribute("share-visible", "false"); document.querySelector("html").setAttribute("more-visible", "false"); document.querySelector("html").setAttribute("popup-visible", "false"); if (document.querySelector("#wmr-popups #action-panel-addto") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(3)").click(); } if (document.querySelector("#wmr-popups #action-panel-addto") == null) { var elm = ".playlist-items"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#action-panel-addto"); var newHome5 = document.querySelector('#wmr-addto-popup div'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#wmr-popups #action-panel-share") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(2)").click(); } if (document.querySelector("#wmr-popups #action-panel-share") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#action-panel-share"); var newHome5 = document.querySelector('#wmr-share-popup div'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } var nonfloater = document.querySelector("#wmr-fence"); var addTo = document.querySelector("[js-addto]"); var share = document.querySelector("[js-share]"); /*var stats = document.querySelector("#stats.watch8-menuitem"); var stats2 = document.querySelector("#stats.watch8-button"); var transcript = document.querySelector("#transcript.watch8-menuitem"); var transcript2 = document.querySelector("#transcript.watch8-button"); var moreActions = document.querySelector("#more-actions.watch8-action"); var showScroller = document.querySelector("#channel-videos.watch8-action"); var close = document.querySelector("#watch8-close button"); if (document.querySelector("#watch7-secondary-actions .hid.yt-uix-button:nth-child(4)") != null) { document.querySelector("#transcript.watch8-button").classList.add("hid"); document.querySelector("#transcript.watch8-menuitem").setAttribute("visible","false"); }*/ nonfloater.addEventListener("click", function() { document.querySelector("#wmr-addto-popup").setAttribute("visible", "false"); document.querySelector("#wmr-share-popup").setAttribute("visible", "false"); document.querySelector("#wmr-fence").setAttribute("visible", "false"); document.querySelector("html").setAttribute("addto-visible", "false"); document.querySelector("html").setAttribute("share-visible", "false"); document.querySelector("html").setAttribute("more-visible", "false"); document.querySelector("html").setAttribute("popup-visible", "false"); }); addTo.addEventListener("click", function() { if (document.querySelector("#wmr-addto-popup[visible='false']") != null) { document.querySelector("#wmr-addto-popup").setAttribute("visible", "true"); document.querySelector("#wmr-fence").setAttribute("visible", "true"); document.querySelector("html").setAttribute("addto-visible", "true"); document.querySelector("html").setAttribute("popup-visible", "true"); } else { document.querySelector("#wmr-addto-popup").setAttribute("visible", "false"); document.querySelector("#wmr-fence").setAttribute("visible", "false"); document.querySelector("html").setAttribute("addto-visible", "false"); document.querySelector("html").setAttribute("popup-visible", "false"); } }); share.addEventListener("click", function() { if (document.querySelector("#wmr-share-popup[visible='false']") != null) { document.querySelector("#wmr-share-popup").setAttribute("visible", "true"); document.querySelector("#wmr-fence").setAttribute("visible", "true"); document.querySelector("html").setAttribute("share-visible", "true"); document.querySelector("html").setAttribute("popup-visible", "true"); } else { document.querySelector("#wmr-share-popup").setAttribute("visible", "false"); document.querySelector("#wmr-fence").setAttribute("visible", "false"); document.querySelector("html").setAttribute("share-visible", "false"); document.querySelector("html").setAttribute("popup-visible", "false"); } }); } function createRealWatch9(number) { if (document.querySelector(".cardified-page.exp-individual-cards-watch") == null) { //number++; } let container = document.querySelector('#watch7-content.watch-content .yt-uix-button-panel'); container = $("#watch7-content.watch-content"); var altWatch9 = document.createElement("div"); altWatch9.id = "watch9-container"; altWatch9.innerHTML = `
    `; container.insertBefore(altWatch9, container.children[number]); $("#wmr-actions-container").innerHTML = STH.WMR_ACTIONS; createPopups(); var elm = "#watch9-container"; waitForElement(elm).then(function(elm) { if (canGo != false) { addIcons(); if (document.querySelector("#watch9-sentiment-actions #watch7-sentiment-actions") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#watch7-sentiment-actions"); var newHome5 = document.querySelector('#watch9-sentiment-actions'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch9-desc #watch-description") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#watch-description"); var newHome5 = document.querySelector('#watch9-desc'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch9-owner #watch7-subscription-container") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#watch7-subscription-container"); var newHome5 = document.querySelector('#watch9-subscribe'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch9-container .video-extras-sparkbars") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector(".video-extras-sparkbars"); var newHome5 = document.querySelector('#watch7-sentiment-actions'); newHome5.insertBefore(thePanel, newHome5.children[1]); } }); } if (document.querySelector("#watch9-container .watch-view-count") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector(".watch-view-count"); var newHome5 = document.querySelector('#watch9-view-count'); newHome5.insertBefore(thePanel, newHome5.children[1]); } }); } if (document.querySelector("#watch9-container .watch-title") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector(".watch-title"); var newHome5 = document.querySelector('#watch9-title'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch9-container .yt-user-photo") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector(".yt-user-photo"); var newHome5 = document.querySelector('#watch9-pfp'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch9-container .yt-user-name") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#watch7-user-header"); var newHome5 = document.querySelector('#watch9-channel-name'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch9-container #watch9-subtitle #watch-uploader-info") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#watch-uploader-info"); var newHome5 = document.querySelector('#watch9-publish-date'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } var elm = "#watch-uploader-info"; waitForElement(elm).then(function(elm) { if (canGo != false) { applyMetadata(); } }); function applyMetadata() { if (document.querySelector(".yt-subscription-button-subscriber-count-branded-horizontal") != null) { var subCount = document.querySelector(".yt-subscription-button-subscriber-count-branded-horizontal").textContent; document.querySelector("#watch9-sub-count").textContent = subCount + " subscribers"; } if (document.querySelector("#watch-uploader-info") != null) { var date = document.querySelector("#watch-uploader-info").textContent; date = date.split("on ")[1]; document.querySelector("#watch9-upload-date span").textContent = date; } } } }); } function createWatch10(number) { if (document.querySelector(".cardified-page.exp-individual-cards-watch") == null) { //number++; } let container = document.querySelector('#watch7-content.watch-content .yt-uix-button-panel'); container = $("#watch7-content.watch-content"); var altWatch9 = document.createElement("div"); altWatch9.id = "watch10-container"; altWatch9.innerHTML = `
    Comments
    Add a comment...
    `; container.insertBefore(altWatch9, container.children[number]); container = $("#watch7-sidebar"); var altWatch9 = document.createElement("div"); altWatch9.id = "watch-panels"; altWatch9.innerHTML = `
    Comments
    `; container.insertBefore(altWatch9, container.children[0]); $("#wmr-actions-container").innerHTML = STH.WMR_ACTIONS; createPopups(); var elm = "#watch10-container"; waitForElement(elm).then(function(elm) { if (canGo != false) { addIcons(); if (document.querySelector("#watch10-sentiment-actions #watch7-sentiment-actions") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#watch7-sentiment-actions"); var newHome5 = document.querySelector('#watch10-sentiment-actions'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch10-desc #watch-description") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#watch-description"); var newHome5 = document.querySelector('#watch10-desc'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch10-owner #watch7-subscription-container") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#watch7-subscription-container"); var newHome5 = document.querySelector('#watch10-subscribe'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch10-container .video-extras-sparkbars") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector(".video-extras-sparkbars"); var newHome5 = document.querySelector('#watch7-sentiment-actions'); newHome5.insertBefore(thePanel, newHome5.children[1]); } }); } if (document.querySelector("#watch10-desc #watch10-views-info") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { let container = $("#eow-description"); let newElem = document.createElement("span"); newElem.id = "watch10-views-info"; newElem.innerHTML = ` `; container.insertBefore(newElem, container.children[0]); } }); } if (document.querySelector("#watch10-container .watch-view-count") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector(".watch-view-count"); var newHome5 = document.querySelector('#watch10-view-count'); newHome5.insertBefore(thePanel, newHome5.children[1]); } }); } if (document.querySelector("#watch10-container .watch-title") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector(".watch-title"); var newHome5 = document.querySelector('#watch10-title'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch10-container .yt-user-photo") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector(".yt-user-photo"); var newHome5 = document.querySelector('#watch10-pfp'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch10-container .yt-user-name") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#watch7-user-header"); var newHome5 = document.querySelector('#watch10-channel-name'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if ($("#yt-masthead-user .yt-masthead-user-icon img")) { let yourPfp = $("#yt-masthead-user .yt-masthead-user-icon img").src; $("#comment-teaser-your-pfp img").src = yourPfp; } $("#watch-description-expand span").textContent = "...more"; var elm = ".distiller_content"; waitForElement10(elm).then(function(elm) { if (canGo != false && $(".comment")) { $("#watch10-comment-teaser").setAttribute("has-comment",""); let count = $(".distiller_yt_headline span:nth-child(2)").textContent.split("(")[1].split(")")[0]; let comment = $(".comment"); let pfp = comment.querySelector(".distiller_yt-thread_avatar").src; let text = comment.querySelector(".text-content span").textContent; $("#comment-count span").textContent = count; $("#comment-teaser-pfp img").src = pfp; $("#comment-teaser-text span").textContent = text; $("#comment-panel .watch-panel-subtitle").textContent = count; } }); $("#watch10-comment-teaser").addEventListener("click", function() { handoffComments("forward"); }); $("#comment-panel-close").addEventListener("click", function() { handoffComments("backward"); }); /*moreActions.addEventListener("click", function() { if (document.querySelector("#watch8-more[visible='false']") != null) { document.querySelector("#watch8-more").setAttribute("visible", "true"); document.querySelector("#nonfloater").setAttribute("visible", "true"); document.querySelector("#watch8-container").setAttribute("more-visible", "true"); } else { document.querySelector("#watch8-more").setAttribute("visible", "false"); document.querySelector("#nonfloater").setAttribute("visible", "false"); document.querySelector("#watch8-container").setAttribute("more-visible", "false"); } }); stats.addEventListener("click", function() { document.querySelector("#watch8-more").setAttribute("visible", "false"); document.querySelector("#nonfloater").setAttribute("visible", "false"); document.querySelector("#watch8-container").setAttribute("more-visible", "false"); if (document.querySelector("#watch8-container[state='stats']") != null) { document.querySelector("#watch8-container").setAttribute("state", "none"); } else { document.querySelector("#watch8-container").setAttribute("state", "stats"); } }); stats2.addEventListener("click", function() { if (document.querySelector("#watch8-container[state='stats']") != null) { document.querySelector("#watch8-container").setAttribute("state", "none"); } else { document.querySelector("#watch8-container").setAttribute("state", "stats"); } }); transcript.addEventListener("click", function() { document.querySelector("#watch8-more").setAttribute("visible", "false"); document.querySelector("#nonfloater").setAttribute("visible", "false"); document.querySelector("#watch8-container").setAttribute("more-visible", "false"); if (document.querySelector("#watch8-container[state='transcript']") != null) { document.querySelector("#watch8-container").setAttribute("state", "none"); } else { document.querySelector("#watch8-container").setAttribute("state", "transcript"); } }); transcript2.addEventListener("click", function() { if (document.querySelector("#watch8-container[state='transcript']") != null) { document.querySelector("#watch8-container").setAttribute("state", "none"); } else { document.querySelector("#watch8-container").setAttribute("state", "transcript"); } }); close.addEventListener("click", function() { document.querySelector("#watch8-container").setAttribute("state", "none"); }); /*if (document.querySelector("#watch9-share #action-panel-share") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(2)").click(); } if (document.querySelector("#watch8-desc #action-panel-share") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#action-panel-share"); var newHome5 = document.querySelector('#watch8-share'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch7-secondary-actions .hid.yt-uix-button:nth-child(4)") == null) { if (document.querySelector("#watch9-share #action-panel-transcript") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(4)").click(); } if (document.querySelector("#watch8-desc #action-panel-transcript") == null) { var elm = ".watch-transcript"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#action-panel-transcript"); var newHome5 = document.querySelector('#watch8-transcript'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } } if (document.querySelector("#watch9-share #action-panel-stats") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(5)").click(); } if (document.querySelector("#watch8-desc #action-panel-stats") == null) { var elm = ".metric-label"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#action-panel-stats"); var newHome5 = document.querySelector('#watch8-stats'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } if (document.querySelector("#watch9-addto #action-panel-addto") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(3)").click(); } if (document.querySelector("#watch8-addto #action-panel-addto") == null) { var elm = ".playlist-items"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var thePanel = document.querySelector("#action-panel-addto"); var newHome5 = document.querySelector('#watch8-addto'); newHome5.insertBefore(thePanel, newHome5.children[0]); } }); } var nonfloater = document.querySelector("#nonfloater"); var addTo = document.querySelector("#addto.watch8-action"); var share = document.querySelector("#share.watch8-action"); var stats = document.querySelector("#stats.watch8-menuitem"); var stats2 = document.querySelector("#stats.watch8-button"); var transcript = document.querySelector("#transcript.watch8-menuitem"); var transcript2 = document.querySelector("#transcript.watch8-button"); var moreActions = document.querySelector("#more-actions.watch8-action"); var showScroller = document.querySelector("#channel-videos.watch8-action"); var close = document.querySelector("#watch8-close button"); if (document.querySelector("#watch7-secondary-actions .hid.yt-uix-button:nth-child(4)") != null) { document.querySelector("#transcript.watch8-button").classList.add("hid"); document.querySelector("#transcript.watch8-menuitem").setAttribute("visible","false"); } nonfloater.addEventListener("click", function() { document.querySelector("#watch8-addto").setAttribute("visible", "false"); document.querySelector("#watch8-more").setAttribute("visible", "false"); document.querySelector("#nonfloater").setAttribute("visible", "false"); document.querySelector("#watch8-container").setAttribute("addto-visible", "false"); document.querySelector("#watch8-container").setAttribute("more-visible", "false"); }); addTo.addEventListener("click", function() { if (document.querySelector("#watch8-addto[visible='false']") != null) { document.querySelector("#watch8-addto").setAttribute("visible", "true"); document.querySelector("#nonfloater").setAttribute("visible", "true"); document.querySelector("#watch8-container").setAttribute("addto-visible", "true"); } else { document.querySelector("#watch8-addto").setAttribute("visible", "false"); document.querySelector("#nonfloater").setAttribute("visible", "false"); document.querySelector("#watch8-container").setAttribute("addto-visible", "false"); } }); share.addEventListener("click", function() { if (document.querySelector("#watch8-container[state='share']") != null) { document.querySelector("#watch8-container").setAttribute("state", "none"); } else { document.querySelector("#watch8-container").setAttribute("state", "share"); } }); moreActions.addEventListener("click", function() { if (document.querySelector("#watch8-more[visible='false']") != null) { document.querySelector("#watch8-more").setAttribute("visible", "true"); document.querySelector("#nonfloater").setAttribute("visible", "true"); document.querySelector("#watch8-container").setAttribute("more-visible", "true"); } else { document.querySelector("#watch8-more").setAttribute("visible", "false"); document.querySelector("#nonfloater").setAttribute("visible", "false"); document.querySelector("#watch8-container").setAttribute("more-visible", "false"); } }); stats.addEventListener("click", function() { document.querySelector("#watch8-more").setAttribute("visible", "false"); document.querySelector("#nonfloater").setAttribute("visible", "false"); document.querySelector("#watch8-container").setAttribute("more-visible", "false"); if (document.querySelector("#watch8-container[state='stats']") != null) { document.querySelector("#watch8-container").setAttribute("state", "none"); } else { document.querySelector("#watch8-container").setAttribute("state", "stats"); } }); stats2.addEventListener("click", function() { if (document.querySelector("#watch8-container[state='stats']") != null) { document.querySelector("#watch8-container").setAttribute("state", "none"); } else { document.querySelector("#watch8-container").setAttribute("state", "stats"); } }); transcript.addEventListener("click", function() { document.querySelector("#watch8-more").setAttribute("visible", "false"); document.querySelector("#nonfloater").setAttribute("visible", "false"); document.querySelector("#watch8-container").setAttribute("more-visible", "false"); if (document.querySelector("#watch8-container[state='transcript']") != null) { document.querySelector("#watch8-container").setAttribute("state", "none"); } else { document.querySelector("#watch8-container").setAttribute("state", "transcript"); } }); transcript2.addEventListener("click", function() { if (document.querySelector("#watch8-container[state='transcript']") != null) { document.querySelector("#watch8-container").setAttribute("state", "none"); } else { document.querySelector("#watch8-container").setAttribute("state", "transcript"); } }); close.addEventListener("click", function() { document.querySelector("#watch8-container").setAttribute("state", "none"); });*/ var elm = "#watch-uploader-info"; waitForElement(elm).then(function(elm) { if (canGo != false) { applyMetadata(); } }); function applyMetadata() { if (document.querySelector(".yt-subscription-button-subscriber-count-branded-horizontal") != null) { var subCount = document.querySelector(".yt-subscription-button-subscriber-count-branded-horizontal").textContent; document.querySelector("#watch10-sub-count").textContent = subCount + " subscribers"; } if (document.querySelector("#watch-uploader-info") != null) { var date = document.querySelector("#watch-uploader-info").textContent; if (date.includes("on")) { date = date.split("on ")[1]; } document.querySelector("#watch10-upload-date").textContent = date; } /*if (document.querySelector("#watch9-container") != null) { var viewCount = document.querySelector(".watch-view-count").textContent; document.querySelector("#watch9-views-info #watch9-view-count span").textContent = viewCount; var videoLikes = document.querySelector("#watch8-action-buttons .video-extras-sparkbar-likes").getAttribute("style"); var videoDislikes = document.querySelector("#watch8-action-buttons .video-extras-sparkbar-dislikes").getAttribute("style"); document.querySelector("#watch9-info .video-extras-sparkbar-likes").setAttribute("style", videoLikes); document.querySelector("#watch9-info .video-extras-sparkbar-dislikes").setAttribute("style", videoDislikes); var ltodBar = document.querySelector("#watch9-info .video-extras-sparkbars"); var likesPercent = ltodBar.querySelector("#watch9-info .video-extras-sparkbar-likes").style.width; ltodBar.setAttribute("data-tooltip-text", likesPercent + " of viewers like this video"); ltodBar.style.display = "block"; ltodBar.style.padding = "5px 0"; ltodBar.style.marginBottom = "-5px"; document.querySelector(".watch-view-count").style.marginBottom = "-3px"; } if (document.querySelector("#watch-uploader-info") != null) { var uploadDateRaw = document.querySelector("#watch-uploader-info").textContent; let notNeedNewString = uploadDateRaw.includes("Published"); if (notNeedNewString == true) { var cutString = uploadDateRaw.split('on '); var uploadDate = cutString[1]; document.querySelector("#first-part").style.display = "inline"; document.querySelector("#third-part").style.display = "none"; } else { var uploadDate = uploadDateRaw; document.querySelector("#first-part").style.display = "none"; document.querySelector("#third-part").style.display = "inline"; } document.querySelector(".watch9-upload-date .upload-date").textContent = uploadDate; } if (document.querySelector("#eow-description") != null) { var descElem = document.querySelector("#watch-description-text"); var newHome = document.querySelector('#watch9-description .description-inner'); newHome.insertBefore(descElem, newHome.children[0]); var descHTML = document.querySelector("#eow-description").innerHTML; document.querySelector(".desc-snippet .description-inner").innerHTML = descHTML; //document.querySelector("#watch9-description .description-inner").innerHTML = descHTML; }*/ } } }); } function handoffComments(dir) { if (dir == "forward") { var thePanel = document.querySelector(".comments-iframe-container"); var newHome = document.querySelector("#comment-panel [js-destination]"); newHome.insertBefore(thePanel, newHome.children[0]); $("html").setAttribute("comment-panel-open","true"); } if (dir == "backward") { var thePanel = document.querySelector(".comments-iframe-container"); var newHome = document.querySelector("#watch-discussion"); newHome.insertBefore(thePanel, newHome.children[0]); $("html").setAttribute("comment-panel-open","false"); } } //EXfunct function addIcons() { if (document.querySelector("#watch-like svg") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { let container = $("#watch-like .yt-uix-button-icon-wrapper"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-svg"); container.classList.add("startube-has-icon"); newElem.innerHTML = `
    `; container.insertBefore(newElem, container.children[0]); } }); } if (document.querySelector("#watch-dislike svg") == null) { var elm = "#eow-description"; waitForElement10(elm).then(function(elm) { if (canGo != false) { let container = $("#watch-dislike .yt-uix-button-icon-wrapper"); let newElem = document.createElement("div"); newElem.setAttribute("class","startube-svg"); container.classList.add("startube-has-icon"); newElem.innerHTML = `
    `; container.insertBefore(newElem, container.children[0]); } }); } } function createWatch9(number) { let container = document.querySelector('#watch7-content.watch-content'); var altWatch9 = document.createElement("div"); altWatch9.id = "alt-watch9-container"; altWatch9.innerHTML = `
    Uploaded by ???? on ??? ??, ???? by ????
    Show more
    Show less
    Description
    Show less
    Add to playlist
    This feature is unavailable.
    See all
    `; container.insertBefore(altWatch9, container.children[number]); var elm = ".watch9"; waitForElement(elm).then(function(elm) { if (canGo != false) { if (STS.expWatch9NoOwner == true) { document.querySelector(".watch9").setAttribute("show-owner", "false"); } if (document.querySelector("#watch9-addto #action-panel-addto") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(3)").click(); } if (document.querySelector("#watch9-addto #action-panel-addto") == null) { var elm = ".playlist-items"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var theAddToBtn = document.querySelector("#action-panel-addto"); var newHome = document.querySelector('#watch9-addto .slider-inner'); newHome.appendChild(theAddToBtn); } }); } if (document.querySelector("#watch9-share #action-panel-share") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(2)").click(); } if (document.querySelector("#alt-watch9-container #action-panel-share") == null) { setTimeout(() => { var theSharePanel = document.querySelector("#action-panel-share"); var newHome5 = document.querySelector('#watch9-share .slider-inner'); newHome5.insertBefore(theSharePanel, newHome5.children[1]); }, "1000"); } if (document.querySelector("#watch9-stats #action-panel-stats") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(5)").click(); } if (document.querySelector("#watch9-stats #action-panel-stats") == null) { var elm = ".metric-label"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var theAddToBtn = document.querySelector("#action-panel-stats"); var newHome = document.querySelector('#watch9-stats .slider-inner'); newHome.appendChild(theAddToBtn); } }); } if (document.querySelector("#watch7-secondary-actions .hid.yt-uix-button:nth-child(4)") == null) { if (document.querySelector("#watch9-stats #action-panel-transcript") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(4)").click(); } if (document.querySelector("#watch9-stats #action-panel-transcript") == null) { var elm = ".watch-transcript"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var theAddToBtn = document.querySelector("#action-panel-transcript"); var newHome = document.querySelector('#watch9-transcript .slider-inner'); newHome.appendChild(theAddToBtn); } }); } } else { document.querySelector("#transcript.sidebar-item").classList.add("hid"); $(".watch9").setAttribute("no-transcript",""); } var elm = "#watch-uploader-info"; waitForElement(elm).then(function(elm) { if (canGo != false) { applyMetadata(); } }); function applyMetadata() { if (document.querySelector("#eow-title") != null) { var videoTitle = document.querySelector("#eow-title").textContent; document.querySelector("#watch9-title span").textContent = videoTitle; } if (document.querySelector("#watch-uploader-info") != null) { var uploadDateRaw = document.querySelector("#watch-uploader-info").textContent; let notNeedNewString = uploadDateRaw.includes("Published"); if (notNeedNewString == true) { var cutString = uploadDateRaw.split('on '); var uploadDate = cutString[1]; document.querySelector("#first-part").style.display = "inline"; document.querySelector("#third-part").style.display = "none"; } else { var uploadDate = uploadDateRaw; document.querySelector("#first-part").style.display = "none"; document.querySelector("#third-part").style.display = "inline"; } document.querySelector(".watch9-upload-date .upload-date").textContent = uploadDate; } if (document.querySelector("#eow-description") != null) { var descElem = document.querySelector("#watch-description-text"); var newHome = document.querySelector('#watch9-description .description-inner'); newHome.insertBefore(descElem, newHome.children[0]); var descHTML = document.querySelector("#eow-description").innerHTML; document.querySelector(".desc-snippet .description-inner").innerHTML = descHTML; //document.querySelector("#watch9-description .description-inner").innerHTML = descHTML; } if (document.querySelector(".yt-user-name") != null) { var authorElem = document.querySelector("#watch7-user-header .yt-user-name"); var authorName = authorElem.textContent; var authorLink = document.querySelector(".yt-user-photo").getAttribute("href"); //var authorPfp = document.querySelector(".yt-user-photo img").getAttribute("data-thumb"); document.querySelector(".author-link").textContent = authorName; document.querySelector(".author-link").setAttribute("href", authorLink); document.querySelector("#third-part .author-link").textContent = authorName; document.querySelector("#third-part .author-link").setAttribute("href", authorLink); document.querySelector(".owner-videos-scroller a").setAttribute("href", authorLink + "/videos"); document.querySelector(".owner-videos-scroller a").setAttribute("data-tooltip-text", "View " + authorName + "'s videos"); authorElem.classList.add("yt-uix-tooltip"); authorElem.setAttribute("data-tooltip-text", "View " + authorName + "'s channel"); } if (document.querySelector("#watch8-action-buttons") != null) { var viewCount = document.querySelector("#watch8-action-buttons .watch-view-count").textContent; document.querySelector("#watch9-views-info .watch-view-count").textContent = viewCount; var videoLikes = document.querySelector("#watch8-action-buttons .video-extras-sparkbar-likes").getAttribute("style"); var videoDislikes = document.querySelector("#watch8-action-buttons .video-extras-sparkbar-dislikes").getAttribute("style"); document.querySelector("#watch9-info .video-extras-sparkbar-likes").setAttribute("style", videoLikes); document.querySelector("#watch9-info .video-extras-sparkbar-dislikes").setAttribute("style", videoDislikes); var ltodBar = document.querySelector("#watch9-info .video-extras-sparkbars"); var likesPercent = ltodBar.querySelector("#watch9-info .video-extras-sparkbar-likes").style.width; ltodBar.setAttribute("data-tooltip-text", likesPercent + " of viewers like this video"); ltodBar.style.display = "block"; ltodBar.style.padding = "5px 0"; ltodBar.style.marginBottom = "-5px"; document.querySelector(".watch-view-count").style.marginBottom = "-3px"; } var theViewsInfo = document.querySelector("#watch7-views-info"); var newHome0 = document.querySelector('#watch9-sentiment-actions'); newHome0.insertBefore(theViewsInfo, newHome0.children[0]); var music = document.querySelector("#watch-description-extra-info"); var newHome1 = document.querySelector('.watch9-extra'); newHome1.insertBefore(music, newHome1.children[0]); var theOwner = document.querySelector("#watch7-user-header"); var newHome2 = document.querySelector('#watch9-owner .owner-inner'); newHome2.insertBefore(theOwner, newHome2.children[0]); var theExtras = document.querySelector("#watch-description-extras"); var newHome3 = document.querySelector('.watch9-category'); newHome3.insertBefore(theExtras, newHome3.children[0]); var theLtod = document.querySelector("#watch7-sentiment-actions"); var newHome4 = document.querySelector('#ltod'); newHome4.insertBefore(theLtod, newHome4.children[0]); if (document.querySelector("#watch9-owner .owner-inner") != null) { var ownerHTML = document.querySelector("#watch9-owner .owner-inner").innerHTML; document.querySelector("#watch9-owner-slider .slider-inner").innerHTML = ownerHTML; } var creator = document.querySelector("#creator.sidebar-item"); var videoInfo = document.querySelector("#video-info.sidebar-item"); var description = document.querySelector("#description.sidebar-item"); var addTo = document.querySelector("#add-to.sidebar-item"); var share = document.querySelector("#share.sidebar-item"); var stats = document.querySelector("#stats.sidebar-item"); var transcript = document.querySelector("#transcript.sidebar-item"); var moreActions = document.querySelector("#more-actions.sidebar-item"); var showMore = document.querySelector("#watch9-info .watch9-expand"); var showLess = document.querySelector("#watch9-description .watch9-expand"); var showLess2 = document.querySelector("#watch9-info #collapse"); var addToBtn = document.querySelector(".addto-button"); var showScroller = document.querySelector(".owner-videos-scroller button"); var showScroller2 = document.querySelector("#watch9-owner .owner-videos-scroller button"); var infoHeight = $("#watch9-info.slider").offsetHeight; var descHeight = $(".description-inner").offsetHeight; descHeight = descHeight + 60; $("#watch9-slider").setAttribute("desc-height",descHeight); creator.addEventListener("click", function() { creatorClicked(); }); videoInfo.addEventListener("click", function() { if ($("#watch9-slider[desc-is-long]")) { $("#watch9-slider[desc-is-long]").removeAttribute("desc-is-long"); } vidInfoClicked(); }); description.addEventListener("click", function() { descClicked(); }); showMore.addEventListener("click", function() { if (STS.expWatch9TrueExpander == true) { expand(); } else { descClicked(); } }); showLess.addEventListener("click", function() { if ($("#watch9-slider[desc-is-long]")) { $("#watch9-slider[desc-is-long]").removeAttribute("desc-is-long"); } vidInfoClicked(); }); showLess2.addEventListener("click", function() { collapse(); }); function creatorClicked() { document.querySelector("#watch9-slider").setAttribute("state", "creator"); document.querySelector(".watch9").setAttribute("state", "creator"); document.querySelector(".sidebar-item.active").classList.remove("active"); document.querySelector("#creator.sidebar-item").classList.add("active"); setTimeout(checkIfShowOwner, 10); } function vidInfoClicked() { document.querySelector("#watch9-slider").setAttribute("state", "video-info"); document.querySelector(".watch9").setAttribute("state", "video-info"); document.querySelector(".sidebar-item.active").classList.remove("active"); document.querySelector("#video-info.sidebar-item").classList.add("active"); setTimeout(checkIfShowOwner, 10); } function expand() { document.querySelector("#watch9-slider").setAttribute("state", "video-info"); document.querySelector(".watch9").setAttribute("state", "video-info"); document.querySelector(".sidebar-item.active").classList.remove("active"); document.querySelector("#video-info.sidebar-item").classList.add("active"); $("#watch9-slider").setAttribute("description-expanded",""); setTimeout(checkIfShowOwner, 10); } function collapse() { document.querySelector("#watch9-slider").setAttribute("state", "video-info"); document.querySelector(".watch9").setAttribute("state", "video-info"); document.querySelector(".sidebar-item.active").classList.remove("active"); document.querySelector("#video-info.sidebar-item").classList.add("active"); $("#watch9-slider").removeAttribute("description-expanded"); setTimeout(checkIfShowOwner, 10); } function descClicked() { $("#watch9-slider").setAttribute("desc-is-long",""); document.querySelector("#watch9-slider").setAttribute("state", "description"); document.querySelector(".watch9").setAttribute("state", "description"); document.querySelector(".sidebar-item.active").classList.remove("active"); document.querySelector("#description.sidebar-item").classList.add("active"); setTimeout(checkIfShowOwner, 10); if ($("#startubestyle1") == null) { var container = $("#alt-watch9-container"); var newElem = document.createElement("style"); newElem.setAttribute("id", "startubestyle1"); newElem.innerHTML = ` [exp-vertical-watch9] [state="description"][desc-is-long] #watch9-description, [exp-vertical-watch9] [state="description"][desc-is-long] .slider-container-inner { min-height: ${descHeight}px !important; max-height: ${descHeight}px !important; height: ${descHeight}px !important; } [exp-vertical-watch9] [state="description"][desc-is-long] .slider-container-inner { transform: translateY(-${infoHeight}px) !important; } ` container.insertBefore(newElem, container.children[0]); } setTimeout(function() { $("#watch9-slider").setAttribute("desc-is-long",""); // $(".slider-container-inner").style.transform = "translateY(-" + infoHeight + "px)"; /* $(".slider-container-inner").style.height = descHeight + "px"; $(".slider-container-inner").style.minHeight = descHeight + "px"; $(".slider-container-inner").style.maxHeight = descHeight + "px"; $("#watch9-description").style.height = descHeight + "px"; $("#watch9-description").style.minHeight = descHeight + "px"; $("#watch9-description").style.maxHeight = descHeight + "px";*/ }, 500); } addTo.addEventListener("click", function() { setTimeout(function() { if ($("#watch9-slider[desc-is-long]")) { $("#watch9-slider[desc-is-long]").removeAttribute("desc-is-long"); } }, 500); document.querySelector("#watch9-slider").setAttribute("state", "add-to"); document.querySelector(".watch9").setAttribute("state", "add-to"); document.querySelector(".sidebar-item.active").classList.remove("active"); document.querySelector("#add-to.sidebar-item").classList.add("active"); setTimeout(checkIfShowOwner, 10); }); share.addEventListener("click", function() { setTimeout(function() { if ($("#watch9-slider[desc-is-long]")) { $("#watch9-slider[desc-is-long]").removeAttribute("desc-is-long"); } }, 500); document.querySelector("#watch9-slider").setAttribute("state", "share"); document.querySelector(".watch9").setAttribute("state", "share"); document.querySelector(".sidebar-item.active").classList.remove("active"); document.querySelector("#share.sidebar-item").classList.add("active"); setTimeout(checkIfShowOwner, 10); }); stats.addEventListener("click", function() { setTimeout(function() { if ($("#watch9-slider[desc-is-long]")) { $("#watch9-slider[desc-is-long]").removeAttribute("desc-is-long"); } }, 500); document.querySelector("#watch9-slider").setAttribute("state", "stats"); document.querySelector(".watch9").setAttribute("state", "stats"); document.querySelector(".sidebar-item.active").classList.remove("active"); document.querySelector("#stats.sidebar-item").classList.add("active"); setTimeout(checkIfShowOwner, 10); }); transcript.addEventListener("click", function() { setTimeout(function() { if ($("#watch9-slider[desc-is-long]")) { $("#watch9-slider[desc-is-long]").removeAttribute("desc-is-long"); } }, 500); document.querySelector("#watch9-slider").setAttribute("state", "transcript"); document.querySelector(".watch9").setAttribute("state", "transcript"); document.querySelector(".sidebar-item.active").classList.remove("active"); document.querySelector("#transcript.sidebar-item").classList.add("active"); setTimeout(checkIfShowOwner, 10); }); moreActions.addEventListener("click", function() { setTimeout(function() { if ($("#watch9-slider[desc-is-long]")) { $("#watch9-slider[desc-is-long]").removeAttribute("desc-is-long"); } }, 500); document.querySelector("#watch9-slider").setAttribute("state", "more-actions"); document.querySelector(".watch9").setAttribute("state", "more-actions"); document.querySelector(".sidebar-item.active").classList.remove("active"); document.querySelector("#more-actions.sidebar-item").classList.add("active"); setTimeout(checkIfShowOwner, 10); }); showScroller.addEventListener("click", function() { if (document.querySelector(".watch9[scroller-visible='false']") != null) { document.querySelector(".watch9").setAttribute("scroller-visible", "true"); } else { document.querySelector(".watch9").setAttribute("scroller-visible", "false"); } }); showScroller2.addEventListener("click", function() { if (document.querySelector(".watch9[scroller-visible='false']") != null) { document.querySelector(".watch9").setAttribute("scroller-visible", "true"); } else { document.querySelector(".watch9").setAttribute("scroller-visible", "false"); } }); setTimeout(checkIfShowOwner, 200); window.addEventListener("resize", checkIfShowOwner); function checkIfShowOwner() { setTimeout(check, 200); function check() { if (document.querySelector(".watch video") != null) { var playerHeight = document.querySelector("video").style.height; //console.log(playerHeight); if (STS.expWatch9NoOwner == false) { if (playerHeight == "360px") { document.querySelector(".section-items.watch9").setAttribute("show-owner", "false"); } else { document.querySelector(".section-items.watch9").setAttribute("show-owner", "true"); if (document.querySelector("#creator.sidebar-item.active") != null) { vidInfoClicked(); } } } else { document.querySelector(".section-items.watch9").setAttribute("show-owner", "false"); } } if ( document.querySelector(".appbar-flexwatch-mini") == null && $(".section-items.watch9") ) { document.querySelector(".section-items.watch9").setAttribute("show-owner", "false"); } } } if (STS.expWatch9NoOwner == false) { requestData(); } function requestData() { const location = window.location; var vidLink = location.href; var cutString1 = vidLink.split('v='); var vidLink2 = cutString1[1]; if (vidLink2.includes('&')) { var cutString2 = vidLink2.split('&'); var vidId = cutString2[0]; } else { var vidId = vidLink2; } //console.log(vidId); setTimeout(doData, 1); function doData() { fetch("https://www.youtube.com/youtubei/v1/next?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", { "headers": { "accept": "application/json, text/plain, /", "accept-language": "en-US,en;q=0.9", "Content-type": "application/json", "sec-ch-ua-mobile": "?0", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "x-goog-authuser": "0", "x-origin": "https://www.youtube.com/" }, "referrer": "https://www.youtube.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": JSON.stringify({ "context": { "client": { "clientName": "WEB", "clientVersion": "2.20230301.00.00", "hl": "en", "gl": "US" } }, "videoId": vidId }), "method": "POST", "mode": "cors", "credentials": "include" }).then(response => response.json()).then(data => { var dataFromAPI = data; //console.log(dataFromAPI); doChannelDataPrep(); function doChannelDataPrep() { if (dataFromAPI.contents.twoColumnWatchNextResults.results.results.contents[0].videoPrimaryInfoRenderer != null) { var channelUrl = dataFromAPI.contents.twoColumnWatchNextResults.results.results.contents[1].videoSecondaryInfoRenderer.owner.videoOwnerRenderer.navigationEndpoint.browseEndpoint.browseId; } else if (dataFromAPI.contents.twoColumnWatchNextResults.results.results.contents[1].videoPrimaryInfoRenderer != null) { var channelUrl = dataFromAPI.contents.twoColumnWatchNextResults.results.results.contents[2].videoSecondaryInfoRenderer.owner.videoOwnerRenderer.navigationEndpoint.browseEndpoint.browseId; } setTimeout(doChannelData, 1); function doChannelData() { fetch("https://www.youtube.com/youtubei/v1/browse?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", { "headers": { "accept": "application/json, text/plain, /", "accept-language": "en-US,en;q=0.9", "Content-type": "application/json", "sec-ch-ua-mobile": "?0", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "x-goog-authuser": "0", "x-origin": "https://www.youtube.com/" }, "referrer": "https://www.youtube.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": JSON.stringify({ "context": { "client": { "clientName": "WEB", "clientVersion": "2.20230301.00.00", "hl": "en", "gl": "US" } }, "browseId": channelUrl, "params": "EgZ2aWRlb3PyBgQKAjoA" }), "method": "POST", "mode": "cors", "credentials": "include" }).then(response => response.json()).then(data => { var dataFromAPI2 = data; //console.log(dataFromAPI2); if (dataFromAPI2.header != null) { if (dataFromAPI2.header.c4TabbedHeaderRenderer != null) { if (dataFromAPI2.header.c4TabbedHeaderRenderer.videosCountText != null) { var videoCount = dataFromAPI2.header.c4TabbedHeaderRenderer.videosCountText.runs[0].text; //console.log(videoCount); if (dataFromAPI2.header.c4TabbedHeaderRenderer.videosCountText.runs[1] != null) { var videoCountString = dataFromAPI2.header.c4TabbedHeaderRenderer.videosCountText.runs[1].text; document.querySelector(".owner-videos-scroller button span").textContent = videoCount + videoCountString; document.querySelector("#watch9-owner .owner-videos-scroller button span").textContent = videoCount + videoCountString; } else { document.querySelector(".owner-videos-scroller button span").textContent = videoCount; document.querySelector("#watch9-owner .owner-videos-scroller button span").textContent = videoCount; } if (document.querySelector(".owner-videos-scroller button[disabled]") != null) { document.querySelector(".owner-videos-scroller button").removeAttribute("disabled"); document.querySelector("#watch9-owner .owner-videos-scroller button").removeAttribute("disabled"); } } else { document.querySelector(".owner-videos-scroller button span").textContent = "No videos"; document.querySelector(".owner-videos-scroller button").setAttribute("disabled", ""); document.querySelector("#watch9-owner .owner-videos-scroller button span").textContent = "No videos"; document.querySelector("#watch9-owner .owner-videos-scroller button").setAttribute("disabled", ""); } var newChannelLink = dataFromAPI2.header.c4TabbedHeaderRenderer.channelId; if (dataFromAPI2.contents.twoColumnBrowseResultsRenderer.tabs[1] != null) { if (dataFromAPI2.contents.twoColumnBrowseResultsRenderer.tabs[1].tabRenderer.content != null) { var richGrid = dataFromAPI2.contents.twoColumnBrowseResultsRenderer.tabs[1].tabRenderer.content.richGridRenderer; var richItemNo = 0; richGridGet(); function richGridGet() { if (richGrid.contents[richItemNo].richItemRenderer != null) { var richItem = richGrid.contents[richItemNo].richItemRenderer.content.videoRenderer; var itemTitle = richItem.title.runs[0].text; var itemThumbnail = richItem.thumbnail.thumbnails[0].url; var itemLink = richItem.videoId; let container = document.querySelector('.scroller-inner'); var newElem = document.createElement("a"); newElem.classList.add("st-super-compact-video"); newElem.classList.add("spf-link"); newElem.innerHTML = `
    ???,??? views
    `; container.insertBefore(newElem, container.children[richItemNo]); let container2 = document.querySelector('#watch9-owner .scroller-inner'); var newElem2 = document.createElement("a"); newElem2.classList.add("st-super-compact-video"); newElem2.classList.add("spf-link"); newElem2.innerHTML = `
    ???,??? views
    `; container2.insertBefore(newElem2, container2.children[richItemNo]); var w9o = document.querySelector("#watch9-owner"); var w9os = document.querySelector("#watch9-owner-slider"); var theSCVid = w9o.querySelectorAll(".st-super-compact-video")[richItemNo]; theSCVid.querySelector(".title span").textContent = itemTitle; theSCVid.querySelector("img").src = itemThumbnail; theSCVid.setAttribute("href", "/watch?v=" + itemLink); theSCVid = w9os.querySelectorAll(".st-super-compact-video")[richItemNo]; theSCVid.querySelector(".title span").textContent = itemTitle; theSCVid.querySelector("img").src = itemThumbnail; theSCVid.setAttribute("href", "/watch?v=" + itemLink); richItemNo++; richGridGet(); } else { //console.log("All available rich items gotten."); } } } else { document.querySelector(".owner-videos-scroller button span").textContent = "No videos"; document.querySelector(".owner-videos-scroller button").setAttribute("disabled", ""); document.querySelector("#watch9-owner .owner-videos-scroller button span").textContent = "No videos"; document.querySelector("#watch9-owner .owner-videos-scroller button").setAttribute("disabled", ""); } } else { document.querySelector(".owner-videos-scroller button span").textContent = "No videos"; document.querySelector(".owner-videos-scroller button").setAttribute("disabled", ""); document.querySelector("#watch9-owner .owner-videos-scroller button span").textContent = "No videos"; document.querySelector("#watch9-owner .owner-videos-scroller button").setAttribute("disabled", ""); } } } else { document.querySelector(".owner-videos-scroller button span").textContent = "No videos"; document.querySelector(".owner-videos-scroller button").setAttribute("disabled", ""); document.querySelector("#watch9-owner .owner-videos-scroller button span").textContent = "No videos"; document.querySelector("#watch9-owner .owner-videos-scroller button").setAttribute("disabled", ""); } }); } } }); } } } } }); } function createWatch5(number, version) { let container = document.querySelector('#watch7-content.watch-content'); var newElem = document.createElement("div"); newElem.id = "watch5-container"; newElem.innerHTML = `
    Uploaded by ???? on ??? ??, ???? by ????
    `; container.insertBefore(newElem, container.children[number]); let container2 = document.querySelector('.watch'); var newElem2 = document.createElement("div"); newElem2.id = "watch5-above-container"; newElem2.innerHTML = `
    `; container2.insertBefore(newElem2, container2.children[0]); var elm = ".watch5"; waitForElement500(elm).then(function(elm) { if (canGo != false) { if (document.querySelector("#watch5-addto #action-panel-addto") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(3)").click(); } if (document.querySelector("#watch5-addto #action-panel-addto") == null) { var elm = ".playlist-items"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var theAddToBtn = document.querySelector("#action-panel-addto"); var newHome = document.querySelector('#watch5-addto .watch5-panel-inner'); newHome.appendChild(theAddToBtn); } }); } if (document.querySelector("#watch5-share #action-panel-share") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(2)").click(); } if (document.querySelector("#watch5-container #action-panel-share") == null) { setTimeout(() => { var theSharePanel = document.querySelector("#action-panel-share"); var newHome5 = document.querySelector('#watch5-share .watch5-panel-inner'); newHome5.insertBefore(theSharePanel, newHome5.children[1]); }, "1000"); } if (document.querySelector("#watch5-stats #action-panel-stats") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(5)").click(); } if (document.querySelector("#watch5-stats #action-panel-stats") == null) { var elm = ".metric-label"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var theAddToBtn = document.querySelector("#action-panel-stats"); var newHome = document.querySelector('#watch5-stats .watch5-panel-inner'); newHome.appendChild(theAddToBtn); } }); } if (document.querySelector("#watch7-secondary-actions .hid.yt-uix-button:nth-child(4)") == null) { if (document.querySelector("#watch5-stats #action-panel-transcript") == null) { document.querySelector("#watch7-secondary-actions .yt-uix-button:nth-child(4)").click(); } if (document.querySelector("#watch5-transcript #action-panel-transcript") == null) { var elm = ".watch-transcript"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var theAddToBtn = document.querySelector("#action-panel-transcript"); var newHome = document.querySelector('#watch5-transcript .watch5-panel-inner'); newHome.appendChild(theAddToBtn); } }); } } else { document.querySelector("#watch5-transcript-button").classList.add("hid"); $(".watch5").setAttribute("no-transcript",""); } if (document.querySelector("#watch7-views-info") != null) { var viewCount = document.querySelector("#watch7-views-info .watch-view-count").textContent; document.querySelector("#watch5-views .watch-view-count").textContent = viewCount; } if (document.querySelector("#watch-uploader-info") != null) { var uploadDateRaw = document.querySelector("#watch-uploader-info").textContent; let notNeedNewString = uploadDateRaw.includes("Published"); if (notNeedNewString == true) { var cutString = uploadDateRaw.split('on '); var uploadDate = cutString[1]; document.querySelector("#first-part").style.display = "inline"; document.querySelector("#third-part").style.display = "none"; } else { var uploadDate = uploadDateRaw; document.querySelector("#first-part").style.display = "none"; document.querySelector("#third-part").style.display = "inline"; } document.querySelector("#watch5-upload-date .upload-date").textContent = uploadDate; } if (document.querySelector(".yt-user-name") != null) { var authorElem = document.querySelector("#watch7-user-header .yt-user-name"); var authorName = authorElem.textContent; var authorLink = document.querySelector(".yt-user-photo").getAttribute("href"); //var authorPfp = document.querySelector(".yt-user-photo img").getAttribute("data-thumb"); document.querySelector(".author-link").textContent = authorName; document.querySelector(".author-link").setAttribute("href", authorLink); document.querySelector("#third-part .author-link").textContent = authorName; document.querySelector("#third-part .author-link").setAttribute("href", authorLink); authorElem.classList.add("yt-uix-tooltip"); authorElem.setAttribute("data-tooltip-text", "View " + authorName + "'s channel"); } var theViewsInfo = document.querySelector("#watch7-views-info"); var newHome0 = document.querySelector("#watch5-views-info"); newHome0.insertBefore(theViewsInfo, newHome0.children[0]); var music = document.querySelector("#watch-headline-title"); var newHome1 = document.querySelector('#watch5-title'); newHome1.insertBefore(music, newHome1.children[0]); var theOwner = document.querySelector("#watch7-user-header"); var newHome2 = document.querySelector('#watch5-owner'); newHome2.insertBefore(theOwner, newHome2.children[0]); var theExtras = document.querySelector("#watch-description"); var newHome3 = document.querySelector('#watch5-description'); newHome3.insertBefore(theExtras, newHome3.children[0]); var theLtod = document.querySelector("#watch7-sentiment-actions"); var newHome4 = document.querySelector('#ltod'); newHome4.insertBefore(theLtod, newHome4.children[0]); var addTo = document.querySelector("#watch5-addto-button"); var share = document.querySelector("#watch5-share-button"); var stats = document.querySelector("#watch5-stats-button"); var transcript = document.querySelector("#watch5-transcript-button"); addTo.addEventListener("click", function() { if ($(".watch5[state='add-to']")) { document.querySelector("#watch5-container .watch5").setAttribute("state", "none"); if ($("#watch5-other-actions .yt-uix-button-toggled")) { document.querySelector("#watch5-other-actions .yt-uix-button-toggled").classList.remove("yt-uix-button-toggled"); } else if ($("#watch5-stats-button.yt-uix-button-toggled")) { document.querySelector("#watch5-stats-button").classList.remove("yt-uix-button-toggled"); } } else { document.querySelector("#watch5-container .watch5").setAttribute("state", "add-to"); if ($("#watch5-other-actions .yt-uix-button-toggled")) { document.querySelector("#watch5-other-actions .yt-uix-button-toggled").classList.remove("yt-uix-button-toggled"); } else if ($("#watch5-stats-button.yt-uix-button-toggled")) { document.querySelector("#watch5-stats-button").classList.remove("yt-uix-button-toggled"); } document.querySelector("#watch5-addto-button").classList.add("yt-uix-button-toggled"); } }); share.addEventListener("click", function() { if ($(".watch5[state='share']")) { document.querySelector("#watch5-container .watch5").setAttribute("state", "none"); if ($("#watch5-other-actions .yt-uix-button-toggled")) { document.querySelector("#watch5-other-actions .yt-uix-button-toggled").classList.remove("yt-uix-button-toggled"); } else if ($("#watch5-stats-button.yt-uix-button-toggled")) { document.querySelector("#watch5-stats-button").classList.remove("yt-uix-button-toggled"); } } else { document.querySelector("#watch5-container .watch5").setAttribute("state", "share"); if ($("#watch5-other-actions .yt-uix-button-toggled")) { document.querySelector("#watch5-other-actions .yt-uix-button-toggled").classList.remove("yt-uix-button-toggled"); } else if ($("#watch5-stats-button.yt-uix-button-toggled")) { document.querySelector("#watch5-stats-button").classList.remove("yt-uix-button-toggled"); } document.querySelector("#watch5-share-button").classList.add("yt-uix-button-toggled"); } }); stats.addEventListener("click", function() { if ($(".watch5[state='stats']")) { document.querySelector("#watch5-container .watch5").setAttribute("state", "none"); if ($("#watch5-other-actions .yt-uix-button-toggled")) { document.querySelector("#watch5-other-actions .yt-uix-button-toggled").classList.remove("yt-uix-button-toggled"); } else if ($("#watch5-stats-button.yt-uix-button-toggled")) { document.querySelector("#watch5-stats-button").classList.remove("yt-uix-button-toggled"); } } else { document.querySelector("#watch5-container .watch5").setAttribute("state", "stats"); if ($("#watch5-other-actions .yt-uix-button-toggled")) { document.querySelector("#watch5-other-actions .yt-uix-button-toggled").classList.remove("yt-uix-button-toggled"); } else if ($("#watch5-stats-button.yt-uix-button-toggled")) { document.querySelector("#watch5-stats-button").classList.remove("yt-uix-button-toggled"); } document.querySelector("#watch5-stats-button").classList.add("yt-uix-button-toggled"); } }); transcript.addEventListener("click", function() { if ($(".watch5[state='transcript']")) { document.querySelector("#watch5-container .watch5").setAttribute("state", "none"); if ($("#watch5-other-actions .yt-uix-button-toggled")) { document.querySelector("#watch5-other-actions .yt-uix-button-toggled").classList.remove("yt-uix-button-toggled"); } else if ($("#watch5-stats-button.yt-uix-button-toggled")) { document.querySelector("#watch5-stats-button").classList.remove("yt-uix-button-toggled"); } } else { document.querySelector("#watch5-container .watch5").setAttribute("state", "transcript"); if ($("#watch5-other-actions .yt-uix-button-toggled")) { document.querySelector("#watch5-other-actions .yt-uix-button-toggled").classList.remove("yt-uix-button-toggled"); } else if ($("#watch5-stats-button.yt-uix-button-toggled")) { document.querySelector("#watch5-stats-button").classList.remove("yt-uix-button-toggled"); } document.querySelector("#watch5-transcript-button").classList.add("yt-uix-button-toggled"); } }); let container3 = document.querySelector('#watch-description-toggle'); var newElem3 = document.createElement("div"); newElem3.id = "watch5-horizontal-rule"; newElem3.innerHTML = `
    `; container3.insertBefore(newElem3, container3.children[0]); var elm = "#watch7-sidebar"; waitForElement10(elm).then(function(elm) { if (canGo != false) { let container4 = document.querySelector("#watch7-sidebar"); var newElem4 = document.createElement("div"); newElem4.id = "sidebar-panda-rules"; newElem4.innerHTML = ` `; container4.insertBefore(newElem4, container4.children[0]); } }); } }); } function createRelatedTabs(number) { if (document.querySelector("#related-tabs") != null) { document.querySelector("#related-tabs").remove(); } let container = document.querySelector('#watch7-sidebar-contents'); let newElem = document.createElement("div"); newElem.setAttribute("id", "related-tabs"); newElem.classList.add("watch-sidebar-section"); newElem.classList.add("new"); newElem.innerHTML = `
    `; container.insertBefore(newElem, container.children[number]); document.querySelector("#watch7-sidebar").setAttribute("state", "related"); if (STS.expRelatedTabsHoldsSubscribe == true) { var elm = "#watch7-subscription-container"; waitForElement10(elm).then(function(elm) { if (canGo != false) { var elem = document.querySelector("#watch7-subscription-container"); var newHome = document.querySelector('.related-user-lower'); newHome.appendChild(elem); } }); } var theHref = document.querySelector("#watch7-user-header .yt-user-name").getAttribute("href"); var cutString1 = theHref.split('l/'); theHref = cutString1[1]; fetch("https://www.youtube.com/youtubei/v1/browse?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", { "headers": { "accept": "application/json, text/plain, /", "accept-language": "en-US,en;q=0.9", "Content-type": "application/json", "sec-ch-ua-mobile": "?0", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "x-goog-authuser": "0", "x-origin": "https://www.youtube.com/" }, "referrer": "https://www.youtube.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": JSON.stringify({ "context": { "client": { "clientName": "WEB", "clientVersion": "2.20230301.00.00", "hl": "en", "gl": "US" } }, "browseId": theHref, "params": "EgZ2aWRlb3PyBgQKAjoA" }), "method": "POST", "credentials": "include" }).then(response => response.json()).then(data => { //console.log(data); if (data.header.c4TabbedHeaderRenderer) { if (data.header.c4TabbedHeaderRenderer.banner != null) { var banner = data.header.c4TabbedHeaderRenderer.banner.thumbnails[0].url; document.querySelector(".related-banner-bg img").src = banner; } else if (data.header.c4TabbedHeaderRenderer.banner == null) { document.querySelector(".related-banner").style.background = "url(https://s.ytimg.com/yts/img/channels/c4/default_banner-vfl7DRgTn.png)"; } var pfp = data.header.c4TabbedHeaderRenderer.avatar.thumbnails[2].url; //var name = data.header.c4TabbedHeaderRendereeeeer.title; var name = data.header.c4TabbedHeaderRenderer.title; } else if (data.header.pageHeaderRenderer) { if (data.header.pageHeaderRenderer.content.pageHeaderViewModel.banner != null) { var banner = data.header.pageHeaderRenderer.content.pageHeaderViewModel.banner.imageBannerViewModel.image.sources[0].url; document.querySelector(".related-banner-bg img").src = banner; } else if (data.header.pageHeaderRenderer.content.pageHeaderViewModel.banner == null) { document.querySelector(".related-banner").style.background = "url(https://s.ytimg.com/yts/img/channels/c4/default_banner-vfl7DRgTn.png)"; } var pfp = data.header.pageHeaderRenderer.content.pageHeaderViewModel.image.decoratedAvatarViewModel.avatar.avatarViewModel.image.sources[0].url; //var name = data.header.c4TabbedHeaderRendereeeeer.title; var name = data.header.pageHeaderRenderer.pageTitle; } var videoCount = document.querySelector(".yt-user-videos").textContent; var link = document.querySelector(".yt-user-name").getAttribute("href"); var link2 = document.querySelector(".yt-user-videos").getAttribute("href"); document.querySelector(".related-banner-pfp img").src = pfp; document.querySelector(".related-user .channel-name span").textContent = name; document.querySelector(".related-user .channel-video-count span").textContent = videoCount; document.querySelector(".related-user .channel-name").setAttribute("href", link); document.querySelector(".related-banner-pfp").setAttribute("href", link); document.querySelector(".related-user .channel-video-count").setAttribute("href", link2); document.querySelector("#related-channel-about-name").textContent = "About " + name; createChannelVideos(data); createChannelAbout(data); document.querySelector("#related-related").addEventListener("click", function() { document.querySelector("#watch7-sidebar").setAttribute("state", "related"); document.querySelector(".related-tab[active]").removeAttribute("active"); document.querySelector("#related-related").setAttribute("active", ""); }); document.querySelector("#related-channel-videos").addEventListener("click", function() { document.querySelector("#watch7-sidebar").setAttribute("state", "channel-videos"); document.querySelector(".related-tab[active]").removeAttribute("active"); document.querySelector("#related-channel-videos").setAttribute("active", ""); }); document.querySelector("#related-channel-about").addEventListener("click", function() { document.querySelector("#watch7-sidebar").setAttribute("state", "channel-about"); document.querySelector(".related-tab[active]").removeAttribute("active"); document.querySelector("#related-channel-about").setAttribute("active", ""); }); }); } function createChannelVideos(data) { let container = document.querySelector('#watch7-sidebar-contents'); let newElem = document.createElement("div"); newElem.setAttribute("id", "related-channel-videos-page"); newElem.classList.add("watch-sidebar-section"); newElem.classList.add("new"); newElem.innerHTML = `

    Uploads

    `; container.insertBefore(newElem, container.children[3]); doChannelVidsTab("firstLoad", data, 0, 0, 0); } function doChannelVidsTab(purpose, data, apiItemNo, htmlItemNo, pageNo) { if (purpose == "firstLoad") { if (data.contents.twoColumnBrowseResultsRenderer.tabs[1] != null) { if (data.contents.twoColumnBrowseResultsRenderer.tabs[1].tabRenderer.content != null) { var itemContainer = data.contents.twoColumnBrowseResultsRenderer.tabs[1].tabRenderer.content.richGridRenderer.contents; if (itemContainer[apiItemNo] != null) { if (itemContainer[apiItemNo].richItemRenderer != null) { var item = itemContainer[apiItemNo].richItemRenderer.content; if (item.adSlotRenderer != null) { apiItemNo++; doChannelVidsTab(purpose, data, apiItemNo, htmlItemNo, pageNo); } else if (item.videoRenderer != null) { createCompactVideo(itemContainer, apiItemNo, htmlItemNo, pageNo); apiItemNo++; htmlItemNo++; doChannelVidsTab(purpose, data, apiItemNo, htmlItemNo, pageNo); } } else if (itemContainer[apiItemNo].continuationItemRenderer != null) { var token = itemContainer[apiItemNo].continuationItemRenderer.continuationEndpoint.continuationCommand.token; createLoadMoreButton(htmlItemNo, token); } else { apiItemNo++; doChannelVidsTab(purpose, data, apiItemNo, htmlItemNo, pageNo); } } else { //Done } } } } if (purpose == "continuation") { if (data.onResponseReceivedActions[0].appendContinuationItemsAction.continuationItems != null) { var itemContainer = data.onResponseReceivedActions[0].appendContinuationItemsAction.continuationItems; if (itemContainer[apiItemNo] != null) { if (itemContainer[apiItemNo].richItemRenderer != null) { var item = itemContainer[apiItemNo].richItemRenderer.content; if (item.adSlotRenderer != null) { apiItemNo++; doChannelVidsTab(purpose, data, apiItemNo, htmlItemNo, pageNo); } else if (item.videoRenderer != null) { createCompactVideo(itemContainer, apiItemNo, htmlItemNo, pageNo); apiItemNo++; htmlItemNo++; doChannelVidsTab(purpose, data, apiItemNo, htmlItemNo, pageNo); } } else if (itemContainer[apiItemNo].continuationItemRenderer != null) { var token = itemContainer[apiItemNo].continuationItemRenderer.continuationEndpoint.continuationCommand.token; createLoadMoreButton(htmlItemNo, token); } else { apiItemNo++; doChannelVidsTab(purpose, data, apiItemNo, htmlItemNo, pageNo); } } else { //Done } } } } function createLoadMoreButton(htmlItemNo, token) { var container = document.querySelector("#watch-channel-videos"); var newElem = document.createElement("span"); newElem.setAttribute("class", "continuation_item_wrapper"); newElem.innerHTML = ` `; container.insertBefore(newElem, container.children[htmlItemNo]); newElem.addEventListener("click", function() { newElem.querySelector(".loading").classList.remove("hid"); newElem.querySelector(".run").classList.add("hid"); newElem.querySelector("button").setAttribute("disabled", "True"); var theHref = document.querySelector("#watch7-user-header .yt-user-name").getAttribute("href"); var cutString1 = theHref.split('l/'); theHref = cutString1[1]; fetch("https://www.youtube.com/youtubei/v1/browse?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", { "headers": { "accept": "application/json, text/plain, /", "accept-language": "en-US,en;q=0.9", "Content-type": "application/json", "sec-ch-ua-mobile": "?0", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "x-goog-authuser": "0", "x-origin": "https://www.youtube.com/" }, "referrer": "https://www.youtube.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": JSON.stringify({ "context": { "client": { "clientName": "WEB", "clientVersion": "2.20230301.00.00", "hl": "en", "gl": "US" } }, "browseId": theHref, "params": "EgZ2aWRlb3PyBgQKAjoA", "continuation": token }), "method": "POST", "credentials": "include" }).then(response => response.json()).then(data => { //console.log(data); doChannelVidsTab("continuation", data, 0, htmlItemNo, 0); newElem.remove(); } ); }); } function createCompactVideo(itemContainer, apiItemNo, htmlItemNo, pageNo) { var container = document.querySelector("#watch-channel-videos"); var newElem = document.createElement("li"); newElem.setAttribute("class", "video-list-item related-list-item"); newElem.setAttribute("unpopulated", ""); newElem.innerHTML = ` Thumbnail `; container.insertBefore(newElem, container.children[htmlItemNo]); var htmlElem = document.querySelector(".video-list-item[unpopulated]"); var apiElem = itemContainer[apiItemNo].richItemRenderer.content.videoRenderer; var navigationEndpoint = itemContainer[apiItemNo].richItemRenderer.content.videoRenderer.navigationEndpoint; htmlElem.querySelector("a").data = { abstractVorElement: { navigationEndpoint: navigationEndpoint } } if (apiElem.thumbnail.thumbnails[3] != null) { var vidThumbnail = apiElem.thumbnail.thumbnails[3].url; } else if (apiElem.thumbnail.thumbnails[2] != null) { var vidThumbnail = apiElem.thumbnail.thumbnails[2].url; } else if (apiElem.thumbnail.thumbnails[1] != null) { var vidThumbnail = apiElem.thumbnail.thumbnails[1].url; } else { var vidThumbnail = apiElem.thumbnail.thumbnails[0].url; } if (apiElem.lengthText != null) { var vidTime = apiElem.lengthText.simpleText; } else { var vidTime = ""; } if (apiElem.title.runs != null) { var vidTitle = apiElem.title.runs[0].text; } else { var vidTitle = apiElem.title.simpleText; } if (apiElem.publishedTimeText != null) { var vidDate = apiElem.publishedTimeText.simpleText; } else { var vidDate = ""; } if (apiElem.viewCountText.runs != null) { if (apiElem.viewCountText.runs[1] != null) { var vidViewCount = apiElem.viewCountText.runs[0].text; var vidViewCountExtension = apiElem.viewCountText.runs[1].text; htmlElem.querySelector(".view-count .view-count").textContent = vidViewCount + " " + vidViewCountExtension; } } else if (apiElem.viewCountText.runs == null) { var vidViewCount = apiElem.viewCountText.simpleText; htmlElem.querySelector(".view-count .view-count").textContent = vidViewCount; } var vidId = apiElem.videoId; htmlElem.querySelector(".yt-thumb-clip-inner img").src = vidThumbnail; htmlElem.querySelector(".title").textContent = vidTitle; htmlElem.querySelector(".title").setAttribute("title", vidTitle); htmlElem.querySelector("a").setAttribute("href", "/watch?v=" + vidId); htmlElem.querySelector(".video-time").textContent = vidTime; htmlElem.querySelector(".extra").textContent = vidDate; htmlElem.removeAttribute("unpopulated"); } function createChannelAbout(data) { if (data.header.c4TabbedHeaderRenderer) { var continuation = data.header.c4TabbedHeaderRenderer.tagline.channelTaglineRenderer.moreEndpoint.showEngagementPanelEndpoint.engagementPanel.engagementPanelSectionListRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].continuationItemRenderer.continuationEndpoint.continuationCommand.token; } else { var continuation = data.header.pageHeaderRenderer.content.pageHeaderViewModel.description.descriptionPreviewViewModel.rendererContext.commandContext.onTap.innertubeCommand.showEngagementPanelEndpoint.engagementPanel.engagementPanelSectionListRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].continuationItemRenderer.continuationEndpoint.continuationCommand.token; } let container = document.querySelector('#watch7-sidebar-contents'); let newElem = document.createElement("div"); newElem.setAttribute("id", "related-channel-about-page"); newElem.classList.add("watch-sidebar-section"); newElem.classList.add("new"); newElem.innerHTML = `

    About

    subscribers
    views
    videos
    `; container.insertBefore(newElem, container.children[3]); var theHref = document.querySelector("#watch7-user-header .yt-user-name").getAttribute("href"); var cutString1 = theHref.split('l/'); theHref = cutString1[1]; fetch("https://www.youtube.com/youtubei/v1/browse?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8", { "headers": { "accept": "application/json, text/plain, /", "accept-language": "en-US,en;q=0.9", "Content-type": "application/json", "sec-ch-ua-mobile": "?0", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-origin", "x-goog-authuser": "0", "x-origin": "https://www.youtube.com/" }, "referrer": "https://www.youtube.com/", "referrerPolicy": "strict-origin-when-cross-origin", "body": JSON.stringify({ "context": { "client": { "clientName": "WEB", "clientVersion": "2.20230301.00.00", "hl": "en", "gl": "US" } }, "browseId": theHref, "continuation": continuation }), "method": "POST", "credentials": "include" }).then(response => response.json()).then(data => { //console.log(data); let description = "No description available."; let subCount = "0"; let videoCount = "0"; let viewCount = "0"; let joinedDate = "Joined Feb 32, 1992 1"; let chanNavEnd = ""; let videosNavEnd = ""; if (data.onResponseReceivedEndpoints[0].appendContinuationItemsAction.continuationItems[0].aboutChannelRenderer.metadata.aboutChannelViewModel.description != null) { description = data.onResponseReceivedEndpoints[0].appendContinuationItemsAction.continuationItems[0].aboutChannelRenderer.metadata.aboutChannelViewModel.description; description = description.replace(/\n/g, "
    "); } if (data.onResponseReceivedEndpoints[0].appendContinuationItemsAction.continuationItems[0].aboutChannelRenderer.metadata.aboutChannelViewModel.subscriberCountText != null) { subCount = data.onResponseReceivedEndpoints[0].appendContinuationItemsAction.continuationItems[0].aboutChannelRenderer.metadata.aboutChannelViewModel.subscriberCountText; } videoCount = data.onResponseReceivedEndpoints[0].appendContinuationItemsAction.continuationItems[0].aboutChannelRenderer.metadata.aboutChannelViewModel.videoCountText; viewCount = data.onResponseReceivedEndpoints[0].appendContinuationItemsAction.continuationItems[0].aboutChannelRenderer.metadata.aboutChannelViewModel.viewCountText; joinedDate = data.onResponseReceivedEndpoints[0].appendContinuationItemsAction.continuationItems[0].aboutChannelRenderer.metadata.aboutChannelViewModel.joinedDateText.content; subCount = subCount.split('s'); subCount = subCount[0]; videoCount = videoCount.split('v'); videoCount = videoCount[0]; viewCount = viewCount.split('v'); viewCount = viewCount[0]; document.querySelector("#watch-channel-about .about-description span").innerHTML = description; document.querySelector("#watch-channel-about #subs span").textContent = subCount; document.querySelector("#watch-channel-about #views span").textContent = viewCount; document.querySelector("#watch-channel-about #videos span").textContent = videoCount; document.querySelector("#watch-channel-about .joined-date span").textContent = joinedDate; if (STS.expWatch9 == true) { chanNavEnd = document.querySelectorAll("#watch7-user-header .yt-user-name")[1].data.abstractVorElement.navigationEndpoint; videosNavEnd = document.querySelectorAll("#watch7-user-header .yt-user-videos")[1].data.watchUserVideoCount.navigationEndpoint; } else { chanNavEnd = document.querySelector("#watch7-user-header .yt-user-name").data.abstractVorElement.navigationEndpoint; videosNavEnd = document.querySelector("#watch7-user-header .yt-user-videos").data.watchUserVideoCount.navigationEndpoint; } $("#related-tabs .channel-video-count").data = { abstractVorElement: { navigationEndpoint: videosNavEnd } } $("#related-tabs .channel-name").data = { abstractVorElement: { navigationEndpoint: chanNavEnd } } }); } function createApps() { let container = document.querySelector('#yt-masthead-user'); const newElem = document.createElement("div"); newElem.id = 'google-apps'; newElem.setAttribute("class", ""); newElem.innerHTML = `
    `; container.insertBefore(newElem, container.children[0]); } let container = document.querySelector('html'); let newElem = document.createElement("div"); newElem.id = "startube-style"; newElem.innerHTML = ` `; container.insertBefore(newElem, container.children[0]); } function doBanner() { var elm = "#content.ytd-app"; waitForElement(elm).then(function(elm) { if (canGo != false) { var container = document.querySelector('#content.ytd-app'); var newElem = document.createElement("div"); newElem.id = "nebula-return-banner"; newElem.innerHTML = `
    StarTube requires Vorapis 2013 (V3) to function.
    Download V3
    `; container.insertBefore(newElem, container.children[0]); newElem.querySelector("#nebula-return-banner-button").addEventListener("click", () => { window.location.reload(); }); newElem.querySelector("#nebula-return-banner-close-button").addEventListener("click", () => { document.querySelector("#nebula-return-banner").remove(); }); } }); } function downloadFile(file) { const link = document.createElement('a'); link.style.display = 'none'; link.href = URL.createObjectURL(file); link.download = file.name; document.body.appendChild(link); link.click(); setTimeout(() => { URL.revokeObjectURL(link.href); link.parentNode.removeChild(link); }, 0); } function createJSON() { const myFile = new File([` ${JSON.stringify(STS)} `], 'StarTubeSettings.json'); downloadFile(myFile); } async function actionFile(file) { const text = await file.text(); localStorage.setItem("ST_SETTINGS",text); window.location.reload(); } })();