-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paths
1 lines (1 loc) · 811 Bytes
/
s
1
let done=!1;function subscribeGet(){console.log("subscribeGet");let e=document.getElementsByTagName("ytm-player-error-message-renderer");if(e.length&&e[0].firstChild.innerText.trim().includes("This video is unavailable")){done=!0,Subscribe.postMessage(JSON.stringify({data:"REMOVED"}));return}var t=document.getElementsByTagName("button");for(let i=5;i<t.length;i++){if(t[i].getAttribute("aria-label").includes("Subscribe to")){done=!0,t[i].click(),setTimeout(()=>{window.find("Sign in to ")?Subscribe.postMessage(JSON.stringify({data:"SIGNIN"})):Subscribe.postMessage(JSON.stringify({data:"DONE"}))},500);return}if(t[i].getAttribute("aria-label").includes("Unsubscribe from")){done=!0,Subscribe.postMessage(JSON.stringify({data:"Already"}));return}}}setInterval(()=>{done?clearInterval():subscribeGet()},100);