// ==UserScript==
// @name StarTube
// @namespace http://tampermonkey.net/
// @version 1.9.2
// @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 starTubeConfigCreated = localStorage.getItem("starTubeConfigCreated");
if (starTubeConfigCreated == null) {
starTubeConfigCreated = "1.9.1";
}
var STH = {
WMR_ACTIONS: `
What's new in StarTube 1.9.0
Settings have reset
Due to an under-the-hood rework of StarTube's settings, you will need to re-apply your StarTube settings. However, a feature for downloading a settings file has been added.
More options, more accuracy
The 2019 layout now has a much more accurate watch page, the Cosmic and Epic Panda layouts now have a more accurate guide. And more.
`;
container76.insertBefore(newElem76, container76.children[0]);
$("#close-startube-new-settings-popup").addEventListener("click", function() {
$("#startube-new-settings-popup").remove();
STS.show1point9 = false;
localStorage.setItem("ST_SETTINGS",STS);
$("html").setAttribute("no-startube-popup","");
var elm = "#show1point9";
waitForElement10(elm).then(function(elm) {
if (canGo != false) {
$("#show1point9").setAttribute("checked","false");
}
});
});
}
}
function createExpandedFooter() {
let container = document.querySelector('.smartadd.selected .smartadd_content');
var newElem = document.createElement("div");
newElem.id = "startube13-settings";
newElem.innerHTML = `
StarTube Settings
`;
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 = `
Presets
Return to defaults
Upload StarTube Config JSON
Use
Note: These presets will override 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)
All
show1point9
Show the 1.9.0 update card.
polymerWarningBanner
If V3 is disabled or not installed, StarTube will display a banner urging the user to install it.
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
expAlwaysShowCompactDate
Display dates on related videos without having to hover over them.
expMoveGuideMainSectionToTop
Only meant to be used with v3's regular 2013 guide.
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.
expWatch9StickyColumns
When on the description tab, the sidebar and owner column will stay on screen while you scroll.
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.
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
expFlatLogo
Use the 2015-2017 logo
expInvertLogo
Use the Ringo (2017-Present) logo. Also makes many UI elements a brighter red.
expGlossyLogo
Use the pre-2012 logo
expClassicTitle
Early 2013 video title
expModernStyles
Enable ~2015 styling
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)
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
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
expStaticSite
Forces the site to have a consistent width of 1000 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.
expEpicStyling
Recommended for Epic Panda layout
expCosmicBG
Makes the site use the Cosmic Panda background image
expCosmicStyles
Makes the site use Cosmic Panda styling in general.
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.
expWatch5D
Use the Cosmic Panda watch layout
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.
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.
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).
expPolymerSubscribe
Makes the subscribe button use the Polymer Gen 1 style (sub count inside the button)
expPolymerStyles
Makes video renderers and other things look like Polymer.
expPolymerChannels
2017 onwards channels.
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.
`;
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");
} 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");
}
}
});
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();
var thisElm = this;
changeSetting(thisElm);
};
}
}
function changeSetting(thisElm) {
var theSetting = thisElm.getAttribute("id");
var checked = thisElm.getAttribute("checked");
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 (checked == "true") {
STS[theSetting] = false;
//localStorage.setItem(theSetting,"false");
thisElm.setAttribute("checked","false");
localStorage.setItem("ST_SETTINGS",JSON.stringify(STS));
} else {
STS[theSetting] = true;
//localStorage.setItem(theSetting,"true");
thisElm.setAttribute("checked","true");
localStorage.setItem("ST_SETTINGS",JSON.stringify(STS));
}
}
function disableOtherPresets(preset) {
STS.presetCosmicPanda = false;
STS.presetEpicPanda = 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.presetPolymer2019 = 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.expRelatedGrid = false;
STS.expWatch8 = false;
STS.expWatch8NoMore = false;
STS.expMoveCountsToButtons = false;
STS.expSharrow = false;
STS.expWatch9A = false;
STS.expWatch9B = false;
STS.expWatch10Beta = 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.expRelatedGrid = false;
STS.expWatch8 = false;
STS.expWatch8NoMore = false;
STS.expMoveCountsToButtons = false;
STS.expSharrow = false;
STS.expWatch9A = false;
STS.expWatch9B = false;
STS.expWatch10Beta = 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.expRelatedGrid = false;
STS.expWatch8 = false;
STS.expWatch8NoMore = false;
STS.expMoveCountsToButtons = false;
STS.expSharrow = false;
STS.expWatch9A = false;
STS.expWatch9B = false;
STS.expWatch10Beta = false;
}
if (theSetting == "disableEverything") {
localStorage.setItem(theSetting,"true");
var settingArray = document.querySelectorAll('[state-id="all"] .lb-setting[checked="true"]');
settingArray.forEach(item => {
item.click();
});
window.location.reload();
}
function presetSelected(theSetting) {
disableOtherPresets(theSetting);
localStorage.setItem("ST_SETTINGS",JSON.stringify(STS));
window.location.reload();
}
if (
theSetting == "presetCosmicPanda"
) {
STCosmicPandaSettings();
presetSelected(theSetting);
}
if (
theSetting == "presetEpicPanda"
) {
STEpicPandaSettings();
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 == "presetHitchhiker2016"
) {
STModernHitchhikerSettings();
ST2016Settings();
presetSelected(theSetting);
}
if (
theSetting == "presetHitchhiker2016Alt"
) {
STModernHitchhikerSettings();
ST2016Settings();
STAltWatch9();
presetSelected(theSetting);
}
if (
theSetting == "presetHitchhiker2017"
) {
STModernHitchhikerSettings();
ST2016Settings();
ST2017Settings();
presetSelected(theSetting);
}
if (
theSetting == "presetHitchhiker2017Alt"
) {
STModernHitchhikerSettings();
ST2016Settings();
ST2017Settings();
STAltWatch9();
presetSelected(theSetting);
}
if (
theSetting == "presetPolymer2019"
) {
ST2019Settings();
presetSelected(theSetting);
}
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.expRelatedGrid = false;
STS.expWatch8 = false;
STS.expWatch8NoMore = false;
STS.expMoveCountsToButtons = false;
STS.expSharrow = false;
STS.expWatch9A = false;
STS.expWatch9B = false;
STS.expWatch10Beta = 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;
}
function STModernHitchhikerSettings() {
STS.expHomepageRedirectsToFeed = false;
STS.expLogoLinksToFeed = false;
STS.expLogoLinksToSubs = false;
STS.expRelatedThumbsSizeMedium = false;
STS.expRelatedThumbsSizeLarge = false;
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.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.expModernStyles = true;
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.expTrueScrollableGuide = true;
STS.expModernPlayer = true;
STS.expModernPlayerV2 = false;
STS.expViewsString = false;
STS.expGoogleApps = false;
STS.expCommentsFullWidth = true;
STS.expStaticSite = false;
STS.expHideAppbar = false;
STS.expEpicWatch7 = false;
STS.expEpicWatch7Flat = false;
STS.expEpicHeader = false;
STS.expEpicStyling = false;
STS.expCosmicHeader = false;
STS.expCosmicBG = false;
STS.expCosmicButtons = false;
STS.expCosmicStyles = false;
STS.expCosmicComments = false;
STS.expCosmicGuideStyle = false;
STS.expCosmicGuideLayout = false;
STS.expCosmicFeedsV1 = false;
STS.expWatch5D = false;
STS.expNoGuide = false;
STS.expGuideOnFeedsOnly = false;
STS.expAozoraHome = false;
STS.expHomeTab = false;
STS.expRoboto = false;
STS.expCenteredSearch = false;
STS.expBigSearch = false;
STS.expPolymerShell = false;
STS.expEarlyPolymerShell = false;
STS.expPolymerSubscribe = false;
STS.expPolymerStyles = false;
STS.expPolymerChannels = false;
STS.expPolymerComments = false;
STS.expWatch9A = false;
STS.expWatch9B = false;
STS.expWatch10Beta = false;
if (STS.STPresetsAlsoSetV3Settings == true) {
setV3Settings("nirvana15");
}
}
function ST2016Settings() {
STS.expRelatedThumbsSizeLarge = true;
STS.expSharrow = true;
STS.expFlatLogo = true;
STS.expModernGuideButton = true;
STS.expModernSearchIcon = true;
STS.expModernTitle = true;
STS.expModernGuide = true;
STS.expModernHome = true;
STS.expTrueScrollableGuide = true;
STS.expModernPlayer = false;
STS.expModernPlayerV2 = true;
STS.expViewsString = true;
STS.expHomeTab = true;
STS.expRoboto = true;
if (STS.STPresetsAlsoSetV3Settings == true) {
setV3Settings("nirvana16");
}
}
function ST2017Settings() {
STS.expFlatLogo = false;
STS.expInvertLogo = true;
STS.expSearchText = true;
if (STS.STPresetsAlsoSetV3Settings == true) {
setV3Settings("nirvana16");
}
}
function ST2014Settings() {
STS.expModernStyles = false;
STS.expModernGuideButton = false;
STS.expModernSearchIcon = false;
STS.expModernHome = false;
STS.expTrueScrollableGuide = false;
STS.expModernPlayer = false;
STS.expModernPlayerV2 = false;
if (STS.STPresetsAlsoSetV3Settings == true) {
setV3Settings("nirvana14");
}
}
function ST2013Settings() {
if (STS.STPresetsAlsoSetV3Settings == true) {
setV3Settings("hitchhiker13");
}
}
function STEpicPandaSettings() {
STS.expHomepageRedirectsToFeed = false;
STS.expLogoLinksToFeed = true;
STS.expLogoLinksToSubs = false;
STS.expRelatedThumbsSizeMedium = false;
STS.expRelatedThumbsSizeLarge = false;
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.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.expModernStyles = false;
STS.expModernTopbar = true;
STS.expModernUpload = true;
STS.expModernGuideButton = false;
STS.expModernSearchIcon = false;
STS.expSearchText = false;
STS.expModernTitle = false;
STS.expModernGuide = false;
STS.expModernHome = false;
STS.expTrueScrollableGuide = false;
STS.expModernPlayer = false;
STS.expModernPlayerV2 = false;
STS.expViewsString = false;
STS.expGoogleApps = false;
STS.expCommentsFullWidth = true;
STS.expStaticSite = true;
STS.expHideAppbar = true;
STS.expEpicWatch7 = true;
STS.expEpicWatch7Flat = true;
STS.expEpicHeader = true;
STS.expEpicStyling = true;
STS.expCosmicHeader = false;
STS.expCosmicBG = false;
STS.expCosmicButtons = false;
STS.expCosmicStyles = false;
STS.expCosmicComments = false;
STS.expCosmicGuideStyle = false;
STS.expCosmicGuideLayout = true;
STS.expCosmicFeedsV1 = false;
STS.expWatch5D = false;
STS.expNoGuide = false;
STS.expGuideOnFeedsOnly = true;
STS.expAozoraHome = true;
STS.expHomeTab = false;
STS.expRoboto = false;
STS.expCenteredSearch = false;
STS.expBigSearch = false;
STS.expPolymerShell = false;
STS.expEarlyPolymerShell = false;
STS.expPolymerSubscribe = false;
STS.expPolymerStyles = false;
STS.expPolymerChannels = false;
STS.expPolymerComments = false;
STS.expWatch9A = false;
STS.expWatch9B = false;
STS.expWatch10Beta = false;
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 = 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.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.expModernStyles = false;
STS.expModernTopbar = true;
STS.expModernUpload = true;
STS.expModernGuideButton = false;
STS.expModernSearchIcon = false;
STS.expSearchText = false;
STS.expModernTitle = false;
STS.expModernGuide = false;
STS.expModernHome = false;
STS.expTrueScrollableGuide = true;
STS.expModernPlayer = false;
STS.expModernPlayerV2 = false;
STS.expViewsString = false;
STS.expGoogleApps = false;
STS.expCommentsFullWidth = true;
STS.expStaticSite = true;
STS.expHideAppbar = true;
STS.expEpicWatch7 = false;
STS.expEpicWatch7Flat = false;
STS.expEpicHeader = false;
STS.expEpicStyling = false;
STS.expCosmicHeader = true;
STS.expCosmicBG = true;
STS.expCosmicButtons = true;
STS.expCosmicStyles = true;
STS.expCosmicComments = true;
STS.expCosmicGuideStyle = true;
STS.expCosmicGuideLayout = true;
STS.expCosmicFeedsV1 = true;
STS.expWatch5D = true;
STS.expNoGuide = false;
STS.expGuideOnFeedsOnly = true;
STS.expAozoraHome = true;
STS.expHomeTab = false;
STS.expRoboto = false;
STS.expCenteredSearch = false;
STS.expBigSearch = false;
STS.expPolymerShell = false;
STS.expEarlyPolymerShell = false;
STS.expPolymerSubscribe = false;
STS.expPolymerStyles = false;
STS.expPolymerChannels = false;
STS.expPolymerComments = false;
STS.expWatch9A = false;
STS.expWatch9B = false;
STS.expWatch10Beta = false;
if (STS.STPresetsAlsoSetV3Settings == true) {
setV3Settings("cosmic");
}
}
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.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.expModernStyles = true;
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.expTrueScrollableGuide = true;
STS.expModernPlayer = false;
STS.expModernPlayerV2 = true;
STS.expViewsString = true;
STS.expGoogleApps = false;
STS.expCommentsFullWidth = true;
STS.expStaticSite = false;
STS.expHideAppbar = true;
STS.expEpicWatch7 = false;
STS.expEpicWatch7Flat = false;
STS.expEpicHeader = false;
STS.expEpicStyling = false;
STS.expCosmicHeader = false;
STS.expCosmicBG = false;
STS.expCosmicButtons = false;
STS.expCosmicStyles = false;
STS.expCosmicComments = false;
STS.expCosmicGuideStyle = false;
STS.expCosmicGuideLayout = false;
STS.expCosmicFeedsV1 = false;
STS.expWatch5D = false;
STS.expNoGuide = false;
STS.expGuideOnFeedsOnly = false;
STS.expAozoraHome = false;
STS.expHomeTab = true;
STS.expRoboto = true;
STS.expCenteredSearch = true;
STS.expBigSearch = false;
STS.expPolymerShell = true;
STS.expEarlyPolymerShell = false;
STS.expPolymerSubscribe = true;
STS.expPolymerStyles = true;
STS.expPolymerChannels = true;
STS.expPolymerComments = true;
STS.expWatch9A = true;
STS.expWatch9B = false;
STS.expWatch10Beta = false;
if (STS.STPresetsAlsoSetV3Settings == true) {
setV3Settings("poly16");
}
}
}
}
function setV3Settings(preset) {
if (preset == "poly16") {
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;
}
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;
}
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;
}
if (preset == "nirvana15") {
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;
}
if (preset == "nirvana16") {
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;
} else if (preset == "cosmic") {
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;
}
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 = `
`;
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) {
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]);
}
});
}
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]);
}
});
}
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 = `
`;
container.insertBefore(altWatch9, container.children[number]);
container = $("#watch7-sidebar");
var altWatch9 = document.createElement("div");
altWatch9.id = "watch-panels";
altWatch9.innerHTML = `
`;
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) {
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 (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]);
}
});
}
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");
}
}
function createWatch9(number) {
let container = document.querySelector('#watch7-content.watch-content');
var altWatch9 = document.createElement("div");
altWatch9.id = "alt-watch9-container";
altWatch9.innerHTML = `
`;
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 = `
`;
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 = `
`;
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 span").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 = `
`;
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 = `
Load more
Loading...
`;
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 = `
`;
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 = `
`;
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 = "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();
}
})();