XVideos Alabama

Sweet home Alabama + Loads HD and well rated videos

От 02.11.2024. Виж последната версия.

// ==UserScript==
// @name         XVideos Alabama
// @version      2024-11-02
// @description  Sweet home Alabama + Loads HD and well rated videos
// @author       ScriptKing
// @match        https://www.xvideos.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=xvideos.com
// @grant        none
// @namespace https://greasyfork.org/users/1336691
// ==/UserScript==

(function() {
    var overlay = document.createElement('div');
    overlay.innerHTML = `
        <div style="
            position:fixed;
            top:0; left:0;
            width:100%; height:100%;
            background:rgba(50, 50, 50);
            color:white;
            font-size:2em;
            display:flex;
            justify-content:center;
            align-items:center;
            z-index:10000;
            backdrop-filter: blur(8px);">
            Loading...
        </div>`;
    const url = new URL(window.location.href);
    const paramLength = [...new URLSearchParams(window.location.search).keys()].length
    let query = ''
    let inputBox = document.querySelector('input[class="search-input form-control"]')
    inputBox.onkeyup = function() {
        query = this.value;
    };
    let groupBtn = document.querySelector('span[class="input-group-btn"]')
    let button = document.createElement('button');
    button.textContent = 'FIND BEST 🔎';
    button.style.backgroundColor = 'transparent';
    button.style.border = '1px solid transparent'; // transparent border
    button.style.fontSize = '16px'
    button.style.transform = 'translateX(2px) translateY(6px) scale(0.9)'
    button.style.color = 'red'; // red label text
    button.style.fontWeight = 'bold';
    button.style.cursor = 'pointer'; // optional, for pointer cursor on hover
    button.style.textDecoration = 'underline'
    button.onclick = () => {
        let input = document.querySelector('input[class="search-input form-control"]');

        url.searchParams.set('sort', 'rating');
        url.searchParams.set('durf', '20min_more');
        url.searchParams.set('quality', '1080P');
        url.searchParams.set('k', input.value);

        setTimeout(() => window.location.href = url.toString(), 50)
    };

    groupBtn.appendChild(button);
    document.body.appendChild(overlay);

    window.scrollTo(0, document.body.scrollHeight);
    window.scrollTo(0, 0);
    document.body.style.overflow = 'hidden';

    const let_me_fantasise = () => {
        // Modify the content
        document.querySelectorAll('a, h2').forEach(e => {
            e.innerHTML = e.innerHTML
                .replaceAll(/step[- ]*|in[- ]*law/gi, '')
                .replaceAll(/[- ]{2,}/g, ' ')
                .replaceAll('m.','mom')
                .replaceAll('d.','daughter')
                .replaceAll('b.','brother')
        });

        // Remove the overlay
        overlay.remove();
    };

    const scroll = () => {
        setTimeout(() => window.scrollTo(0, document.documentElement.scrollTop + 250), 50)
    }

    const scrollinterval = setInterval(scroll, 10)

    const interval = setInterval(() => {
        const images = document.querySelectorAll('img[src*="lightbox-blank"]');

        if (images.length === 0) {
            document.documentElement.scrollTop = 0
            setTimeout(() => { document.documentElement.scrollTop = 0 }, 50)
            document.body.style.overflow = 'visible';
            let_me_fantasise()
            document.querySelectorAll('.premium-results-line').forEach(e => e.style.display = "none")
            clearInterval(interval);
            clearInterval(scrollinterval)
            document.querySelectorAll('.frame-block.thumb-block.tb_full_init.tbm-init-ok').forEach(div => {
                const img = div.querySelector('img:nth-of-type(n)');
                if (img && !img.complete) {
                    div.remove();
                }
            });
        }
    }, 1000);

    const style = document.createElement('style');
    style.textContent = `
        .thumb-inside {
            border-radius: 21px !important;
            transform: scale(0.95) !important;
        }
        .video-hd-mark {
            border-radius: 4px !important;
            transform: translateX(-10px) translateY(5px)
        }
        .premium-results-line{
          display: none!important;
        }
        .search-premium-tabs {
          display: none!important;
        }
        #site-logo {
          display: none;
        }
        .btn.btn-link.report-search {
            display: none;
        }
    `;
    document.head.appendChild(style);

})();