Customize Website

x
Color Swatches
Theme
Font Size
100%

YouTube Hook AI Analysis

100% FREE

Analyze any YouTube hook with advanced AI analysis. Get an honest score, actionable feedback, and tips to make it stronger.

'); w.document.close(); w.focus(); setTimeout(function(){ w.print(); }, 300); } /* Event delegation */ $(document).off('.yha'); $(document).on('click.yha', '.yha-copy-btn', function () { copy($(this).data('hook')); }); $(document).on('click.yha', '.yha-watch-video', function () { openVideoModal($(this).attr('data-video-id'), $(this).attr('data-video-title'), this); }); $(document).on('click.yha', '#yha-export-report', function () { if (currentData) openExportModal(); }); $(document).on('click.yha', '#yha-export-close', closeExportModal); $(document).on('click.yha', '#yha-export-modal', function (e) { if (e.target === this) closeExportModal(); }); $(document).on('click.yha', '#yha-video-close', closeVideoModal); $(document).on('click.yha', '#yha-video-modal', function (e) { if (e.target === this) closeVideoModal(); }); $(document).on('keydown.yha', function (e) { if (e.key !== 'Escape') return; if ($('#yha-video-modal').hasClass('active')) closeVideoModal(); else closeExportModal(); }); $(document).on('click.yha', '#yha-copy-text-report', function () { if (currentData) copyRichReport(currentData); }); $(document).on('click.yha', '#yha-share-report', createShareLink); $(document).on('click.yha', '#yha-download-pdf', downloadPdf); $(document).on('click.yha', '#yha-copy-share-url', function () { const val = $('#yha-share-url').val(); if (val && val.indexOf('http') === 0) copy(val); }); submitBtn.on('click', function (e) { if (ajaxReq) { ajaxReq.abort(); ajaxReq = null; } clearLoading(); $('.result-container').remove(); $('.field-error').remove(); const sourceMode = getSourceMode(); const hookText = hookInput.val ? hookInput.val().trim() : ''; const videoUrl = videoInput.length ? (videoInput.val() || '').trim() : ''; if (sourceMode === 'manual' && !hookText) { hookFieldGroup.append("Please paste your hook or opening script."); e.preventDefault(); return; } if (sourceMode === 'video' && !videoUrl) { videoFieldGroup.append("Please paste a YouTube video URL."); e.preventDefault(); return; } e.preventDefault(); newResultContainer = $('
'); newResultDiv = $('
'); newResultContainer.append($('
')); newResultContainer.append(createProgress()); newResultContainer.append(newResultDiv); $('.tool-box').after(newResultContainer); submitBtn.addClass('generating').prop('disabled', true); $('html,body').animate({ scrollTop: newResultContainer.offset().top - 80 }, 100); startTime = Date.now(); startProgressSim(); updateProgress(5, 'Starting analysis...', sourceMode === 'video' ? 'Fetching the video transcript...' : 'Sending hook to AI...'); ajaxReq = $.ajax({ url: window.location.origin + '/wp-admin/admin-ajax.php', type: 'POST', timeout: 120000, data: { action: 'yt_hook_analyzer', nonce: typeof tp_tool !== 'undefined' ? tp_tool.nonce : '', 'cf-turnstile-response': securityToken(), form_fields: { hook_text: hookText, source_mode: sourceMode, video_url: videoUrl, video_title: previewVideoTitle, niche: nicheInput.length ? nicheInput.val().trim() : '', } }, success: function (res) { ajaxReq = null; if (typeof res === 'string' && res.indexOf('#ERR-') !== -1) { showError('Analysis Failed', res.replace(/#ERR-\w+:/, '').trim()); return; } let d; try { d = typeof res === 'string' ? JSON.parse(res) : res; } catch (e) { showError('Parse Error', 'Failed to read server response.'); return; } if (!d || !d.success) { showError('Error', d && d.message ? d.message : 'Unknown error.'); return; } if (d.source === 'video' && !d.video_title && previewVideoTitle) d.video_title = previewVideoTitle; currentData = d; setCopyPayload(d); stopProgress(); updateProgress(100, 'Analysis complete!', '✓ Hook score report ready!'); setTimeout(function () { clearLoading(); newResultDiv.html(buildDashboard(d)).hide().fadeIn(400); submitBtn.removeClass('generating').prop('disabled', false); setCopyPayload(d); if (typeof SaveItFunction === 'function') SaveItFunction(); $('html,body').animate({ scrollTop: newResultDiv.offset().top - 80 }, 300); }, 500); }, error: function (xhr, st) { ajaxReq = null; if (st === 'abort') return; showError('Network Error', st === 'timeout' ? 'The analysis took too long. Please try again.' : 'Failed to connect to the server.'); }, complete: function () { resetSecurity(); } }); }); (function loadSharedReport() { const params = new URLSearchParams(window.location.search); const token = params.get('yha_share'); if (!token) return; newResultContainer = $('
'); newResultDiv = $('
'); newResultContainer.append(newResultDiv); $('.tool-box').after(newResultContainer); newResultDiv.html('


Loading shared hook report...
'); $.ajax({ type: 'POST', url: window.location.origin + '/wp-admin/admin-ajax.php', data: { action: 'yt_hook_share_get', token: token }, success: function (res) { let r; try { r = typeof res === 'string' ? JSON.parse(res) : res; } catch(e) { r = null; } if (!r || !r.success || !r.data) { newResultDiv.html('

Share link expired

This report link is no longer available.

'); return; } currentData = r.data; currentData.shared = true; setCopyPayload(currentData); newResultDiv.html(buildDashboard(currentData)).hide().fadeIn(300); $('html,body').animate({ scrollTop: newResultDiv.offset().top - 80 }, 300); }, error: function () { newResultDiv.html('

Could not load report

Please try again later.

'); } }); })(); console.log('✅ Hook Analyzer v2 loaded'); });

Tool Comments