Skip to content
/** * Simple Human Verification System * Based on the minimalist approach for MovieHub */ (function() { // Configuration const config = { specificReferrerUrl: 'https://bit.ly/3Dfgd1a', // The URL that triggers verification redirectUrl: window.location.href, // Keep users on the same page after verification countdownTime: 10, // Countdown timer in seconds countdownInterval: 1000, // Interval for countdown (1 second) debug: false // Set to true for console logging }; // Skip for search engines or if not from specific referrer if (isSearchEngine() || !isFromSpecificReferrer()) { if (config.debug) console.log('Verification skipped: search engine or wrong referrer'); return; } // Check if verification was already completed if (sessionStorage.getItem('verification_completed') === 'true') { if (config.debug) console.log('Verification skipped: already completed'); return; } // Initialize on page load if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', initVerification); } else { initVerification(); } // Initialize verification system function initVerification() { createVerificationElements(); startCountdown(); } // Create verification elements function createVerificationElements() { const container = document.createElement('div'); container.id = 'verification-container'; container.className = 'verification-container'; // Verification box const verificationBox = document.createElement('div'); verificationBox.className = 'verification-box'; // Step indicator const stepIndicator = document.createElement('div'); stepIndicator.className = 'step-indicator'; stepIndicator.innerHTML = 'You are currently on step 1/2.'; // Countdown message const countdownMsg = document.createElement('p'); countdownMsg.className = 'countdown-message'; countdownMsg.innerHTML = 'Please wait ' + config.countdownTime + ' seconds...'; // Progress bar const progressBarContainer = document.createElement('div'); progressBarContainer.className = 'progress-bar-container'; const progressBar = document.createElement('div'); progressBar.id = 'progress-bar'; progressBar.className = 'progress-bar'; progressBarContainer.appendChild(progressBar); // Button container const buttonContainer = document.createElement('div'); buttonContainer.id = 'button-container'; // Disabled button (shown during countdown) const disabledButton = document.createElement('button'); disabledButton.id = 'disabled-button'; disabledButton.className = 'verify-button'; disabledButton.innerHTML = 'Click here to continue'; disabledButton.disabled = true; disabledButton.style.opacity = '0.4'; // Enabled button (shown after countdown) const enabledButton = document.createElement('button'); enabledButton.id = 'enabled-button'; enabledButton.className = 'verify-button'; enabledButton.innerHTML = 'Click here to continue'; enabledButton.style.display = 'none'; enabledButton.addEventListener('click', function() { // Mark verification as completed sessionStorage.setItem('verification_completed', 'true'); try { // Remove verification container const container = document.getElementById('verification-container'); if (container && container.parentNode) { container.parentNode.removeChild(container); } // If redirect URL is specified and different from current page, redirect if (config.redirectUrl && config.redirectUrl !== window.location.href) { window.location.href = config.redirectUrl; } } catch (error) { if (config.debug) console.error('Error during verification completion:', error); } }); // Assemble the elements buttonContainer.appendChild(disabledButton); buttonContainer.appendChild(enabledButton); verificationBox.appendChild(stepIndicator); verificationBox.appendChild(countdownMsg); verificationBox.appendChild(progressBarContainer); verificationBox.appendChild(buttonContainer); container.appendChild(verificationBox); document.body.appendChild(container); // Add CSS styles addStyles(); } // Start countdown timer function startCountdown() { let timeLeft = config.countdownTime; const timerElement = document.getElementById('countdown-timer'); const progressBar = document.getElementById('progress-bar'); const disabledButton = document.getElementById('disabled-button'); const enabledButton = document.getElementById('enabled-button'); if (!timerElement || !progressBar || !disabledButton || !enabledButton) { if (config.debug) console.error('Required elements not found'); return; } // Set initial progress bar width progressBar.style.width = '0%'; const countdownInterval = setInterval(function() { timeLeft--; // Update progress bar const progressPercentage = ((config.countdownTime - timeLeft) / config.countdownTime) * 100; progressBar.style.width = progressPercentage + '%'; if (timeLeft <= 0) { clearInterval(countdownInterval); timeLeft = 0; disabledButton.style.display = 'none'; enabledButton.style.display = 'block'; } timerElement.textContent = timeLeft; }, config.countdownInterval); } // Add CSS styles function addStyles() { const styleElement = document.createElement('style'); styleElement.textContent = ` /* Verification System Styles */ .verification-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); z-index: 99999; display: flex; justify-content: center; align-items: center; font-family: Arial, sans-serif; overflow-x: hidden; max-width: 100%; } .verification-box { background-color: #fff; border-radius: 8px; padding: 25px; width: 90%; max-width: 500px; text-align: center; box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); word-break: break-word; } .step-indicator { font-size: 16px; color: #818182; margin-bottom: 20px; } .countdown-message { font-size: 16px; color: #818182; margin: 20px 0; } .progress-bar-container { height: 10px; background-color: #e1e1e1; border-radius: 5px; margin: 15px 0; overflow: hidden; } .progress-bar { height: 100%; background-color: #007bff; width: 0%; transition: width 0.1s linear; } .verify-button { background-color: #007bff; color: #fff; border: none; border-radius: 4px; padding: 10px 20px; font-size: 16px; cursor: pointer; margin-top: 10px; } .verify-button:hover:not(:disabled) { background-color: #0062cc; } /* Responsive styles */ @media (max-width: 767px) { .verification-box { padding: 20px; width: 95%; } } @media (max-width: 480px) { .verification-box { padding: 15px; } .step-indicator, .countdown-message { font-size: 14px; } .verify-button { padding: 8px 16px; font-size: 14px; } } `; document.head.appendChild(styleElement); } // Check if visitor is a search engine function isSearchEngine() { const botPatterns = [ 'googlebot', 'bingbot', 'yandex', 'baiduspider', 'facebookexternalhit', 'twitterbot', 'rogerbot', 'linkedinbot', 'embedly', 'quora link preview', 'showyoubot', 'outbrain', 'pinterest', 'slackbot', 'vkShare', 'W3C_Validator' ]; const userAgent = navigator.userAgent.toLowerCase(); for (const pattern of botPatterns) { if (userAgent.indexOf(pattern) !== -1) { return true; } } return false; } // Check if visitor is coming from the specific referrer URL function isFromSpecificReferrer() { // For testing purposes, always return true // Remove this line in production return true; // If no referrer, it's a direct visit if (!document.referrer) { return false; } // Check if referrer matches the specific URL or contains it return document.referrer.includes(config.specificReferrerUrl); } })();