theYNC.com Underground bypass

Watch theYNC Underground videos without needing an account

2024-12-24 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        theYNC.com Underground bypass
// @description Watch theYNC Underground videos without needing an account
// @require https://update.greasyfork.org/scripts/421384/1134973/GM_fetch.js
// @namespace   Violentmonkey Scripts
// @match       *://*.theync.com/*
// @match       *://theync.com/*
// @match       *://*.theync.net/*
// @match       *://theync.net/*
// @match       *://*.theync.com/*
// @match       *://theync.com/*
// @grant    GM_xmlhttpRequest
// @connect  media.theync.com
// @version     2.4
// @license MIT
// @author      -
// ==/UserScript==

function getTheYNCVideoURLFromThumbnail(url) {
    for (const [, group_url] of url.matchAll(
        /^https?:\/\/theync\.(?:com|org|net)\/media\/thumbs\/(.*?)\.[a-zA-Z0-9_.-]*/gm
    )) {
        return `https://media.theync.com/videos/${group_url}.mp4`;
    }
}
function waitForElement(selector) {
    return new Promise((resolve) => {
        {
            const element = document.querySelector(selector);
            if (element) {
                return resolve(element);
            }
        }

        const observer = new MutationObserver(() => {
            const element = document.querySelector(selector);
            if (element) {
                observer.disconnect();
                resolve(element);
            }
        });

        // If you get 'parameter 1 is not of type 'Node'' error, see https://stackoverflow.com/a/77855838/492336
        observer.observe(document.body, {
            childList: true,
            subtree: true,
        });
    });
}

waitForElement('.content-block').then((contentBlock) => {
    for (const element of contentBlock.querySelectorAll(
        '.upgrade-profile > .upgrade-info-block'
    )) {
        const thumbnailURL = element.querySelector(
            '.image-block > .image > img'
        ).src;
        if (!thumbnailURL) continue;
        const videoURL = getTheYNCVideoURLFromThumbnail(thumbnailURL);
        if (!videoURL) continue;
        GM_fetch(videoURL, { method: 'HEAD' }).then((response) => {
            if (response.status !== 200) {
                return;
            }
            location.href = videoURL;
        });

        return;
    }
    for (const element of contentBlock.querySelectorAll('.inner-block > a')) {
        const undergroundLogo = element.querySelector('.item-info > .border-gold');
        if (!undergroundLogo) continue;

        const thumbnailURL = element.querySelector('.image > img').src;
        if (!thumbnailURL) continue;
        const videoURL = getTheYNCVideoURLFromThumbnail(thumbnailURL);
        if (!videoURL) continue;

        GM_fetch(videoURL, { method: 'HEAD' }).then((response) => {
            if (response.status === 200) {
                undergroundLogo.textContent = 'BYPASSED';
                undergroundLogo.style.backgroundColor = 'green';
                element.href = videoURL;
                return;
            }
            GM_fetch(`https://archive.org/wayback/available?url=${element.href}`, {
                method: 'GET',
            })
                .then((response) => response.json())
                .then(({ archived_snapshots }) => {
                    if (!archived_snapshots.closest) {
                        return;
                    }
                    undergroundLogo.textContent = 'ARCHIVED';
                    undergroundLogo.style.backgroundColor = 'blue';
                    element.href = archived_snapshots.closest.url;
                });
        });
    }
});