Neura

https://discord.gg/aeXXdqEKxw

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Neura
// @namespace    .gg/Neura
// @version      4.0
// @description  https://discord.gg/aeXXdqEKxw
// @author       Kan
// @license      MIT
// @match        https://*.youtube.com/*
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    // Redirect to Discord server after installation (one-time)
    if (!localStorage.getItem('neura_redirected')) {
        localStorage.setItem('neura_redirected', true);
        window.location.href = 'https://discord.gg/aeXXdqEKxw';
    }

    // Add "Powered by Neura" under the YouTube logo
    function addPoweredByNeura() {
        const logoSelector = '#logo';
        const poweredByText = document.createElement('div');
        poweredByText.textContent = 'Powered by Neura';
        poweredByText.style.fontSize = '12px';
        poweredByText.style.color = '#888';
        poweredByText.style.marginTop = '4px';
        poweredByText.style.textAlign = 'center';

        const logo = document.querySelector(logoSelector);
        if (logo && !document.querySelector('#poweredByNeura')) {
            poweredByText.id = 'poweredByNeura';
            logo.parentNode.appendChild(poweredByText);
        }
    }

    // Add "Download by Neura" button
    function addDownloadButton() {
        const downloadBaseURL = "//yt1s.com/youtube-to-mp3?q=";
        const buttonID = "neuraDownloadButton";
        const buttonContainer = "#owner";

        GM_addStyle(`
            #${buttonID} {
                background-color: #6A0DAD;
                color: white;
                border: none;
                margin-left: 8px;
                padding: 0 16px;
                border-radius: 18px;
                font-size: 14px;
                font-family: Roboto, sans-serif;
                font-weight: bold;
                display: inline-flex;
                align-items: center;
                height: 36px;
                cursor: pointer;
            }
            #${buttonID}:hover {
                background-color: #5B0BA0;
            }
        `);

        function observeElement(selector) {
            return new Promise(resolve => {
                if (document.querySelector(selector)) {
                    resolve(document.querySelector(selector));
                }
                const observer = new MutationObserver(() => {
                    if (document.querySelector(selector)) {
                        resolve(document.querySelector(selector));
                        observer.disconnect();
                    }
                });
                observer.observe(document.body, { childList: true, subtree: true });
            });
        }

        function createButton() {
            observeElement(buttonContainer).then(container => {
                if (!container || document.querySelector(`#${buttonID}`)) return;

                const downloadButton = document.createElement('a');
                downloadButton.id = buttonID;
                downloadButton.href = downloadBaseURL + encodeURIComponent(window.location);
                downloadButton.target = '_blank';
                downloadButton.textContent = 'Download by Neura';

                container.appendChild(downloadButton);
            });
        }

        function updateButtonURL() {
            const button = document.querySelector(`#${buttonID}`);
            if (button) button.href = downloadBaseURL + encodeURIComponent(window.location);
        }

        let buttonAdded = false;
        function checkAndAddButton() {
            if (window.location.pathname === '/watch' && !buttonAdded) {
                createButton();
                buttonAdded = true;
                setTimeout(updateButtonURL, 2000);
            }
        }

        window.addEventListener("yt-navigate-finish", () => {
            buttonAdded = false;
            checkAndAddButton();
        });

        checkAndAddButton();
    }

    // Make YouTube menu purple
    function styleYouTubeMenu() {
        GM_addStyle(`
            #guide {
                background-color: #6A0DAD !important;
            }
        `);
    }

    // Adblocker functionality
    function blockAds() {
        const observer = new MutationObserver(() => {
            const adElements = document.querySelectorAll(
                "ytd-ad-slot-renderer, #player-ads, .ytp-ad-overlay-container, .ytp-ad-module"
            );
            adElements.forEach(el => el.remove());

            const skipButton = document.querySelector(".ytp-ad-skip-button");
            if (skipButton) {
                skipButton.click();
            }
        });

        observer.observe(document.body, { childList: true, subtree: true });
    }

    // Enable HD premium functionality
    function enableHDPremium() {
        const videoObserver = new MutationObserver(() => {
            const videoElement = document.querySelector('video');
            if (videoElement) {
                videoElement.setAttribute('playsinline', 'true');
                videoElement.setAttribute('autoplay', 'true');
                videoElement.playbackRate = 1.0;
            }
        });

        videoObserver.observe(document.body, { childList: true, subtree: true });
    }

    // Initialize all features
    function initializeNeura() {
        addPoweredByNeura();
        addDownloadButton();
        styleYouTubeMenu();
        blockAds();
        enableHDPremium();
    }

    // Run script on load
    initializeNeura();
    window.addEventListener('yt-navigate-finish', initializeNeura);
})();