-
Notifications
You must be signed in to change notification settings - Fork 31
Description
The init({}) function does not seem to be setting the cookies that are provided. As a result, the getMainPage() function never returns the ytcfg. I am providing the correct values for the cookies below but I always get the could not find "ytcfg". Are you sure SID, HSID, SSID, APISID, SAPISID are correct? error. I ensured that all the values I am providing come from the https://studio.youtube.com URL, and I am not able to get past the above error even when making a fresh login to get new values for the needed cookies.
SID,
HSID,
SSID,
APISID,
SAPISID,
LOGIN_INFO,
SESSION_TOKEN = '',Checking the ytcfg on the https://studio.youtube.com/ with window.ytcfg shows it exists on the page. The only thing that may be interesting is that it takes some time to be available on the page, as you can see some delay when running with the code below. I am unsure if YouTube-studio accounts for this delay and how it may affect the functionality.
const observer = new MutationObserver(() => {
if (window.ytcfg) {
console.log("ytcfg detected!", window.ytcfg.data_);
observer.disconnect();
}
});
observer.observe(document, { childList: true, subtree: true });
console.log("Monitoring changes to detect ytcfg...");Could it be that YouTube now injects ytcfg programmatically?