Customize Website

x
Color Swatches
Theme
Font Size
100%

YouTube Similar Channels Finder

100% FREE

Discover similar channels with AI-powered niche, size, and content analysis. Get free actionable insights based on how you compare.

'); w.document.close(); w.document.body.appendChild(w.document.importNode($clone[0],true)); setTimeout(function(){w.focus();w.print();},300); } function downloadPdf(){ if(!currentData) return; if(pdfBusy){setActionStatus('A PDF is already being prepared.',false);return;} pdfBusy=true; const $button=$('#ysc-export-pdf'); let finished=false; $button.prop('disabled',true).attr('aria-busy','true'); document.body.classList.add('ysc-pdf-exporting'); setActionStatus('Preparing the complete report as a PDF…',false); function finish(error){ if(finished)return; finished=true; clearPdfArtifacts(); pdfBusy=false; $button.prop('disabled',false).removeAttr('aria-busy'); if(error)showPdfFailure(error);else setActionStatus('PDF downloaded.',false); } loadPdfLibrary().then(function(){ const $clone=printableClone(); const worker=window.html2pdf().set({margin:9,filename:reportName('pdf'),pagebreak:{mode:['css','legacy']},image:{type:'jpeg',quality:.94},html2canvas:{scale:1.25,useCORS:true,allowTaint:false,backgroundColor:'#ffffff',logging:false,onclone:normalizePdfClone},jsPDF:{unit:'mm',format:'a4',orientation:'portrait'}}).from($clone[0]).save(); const timeout=new Promise((resolve,reject)=>setTimeout(()=>reject(new Error('rendering timed out')),60000)); return Promise.race([Promise.resolve(worker),timeout]); }).then(()=>finish(null)).catch(error=>finish(error||new Error('unknown rendering error'))); } /* ───────────────────── SHARE REPORT ───────────────────── */ function shareReport(){ if(!currentData || !/^[a-f0-9]{32}$/i.test(currentData.cache_key||'')){ setActionStatus('This older analysis cannot be shared. Run the search once more to create a fresh report.',true); return; } const $button=$('#ysc-share-report').prop('disabled',true).attr('aria-busy','true'); setActionStatus('Creating a private share link…',false); $.ajax({ type:'POST', url:window.location.origin+'/wp-admin/admin-ajax.php', dataType:'json', timeout:30000, data:{action:'yt_similar_channels_share_create',nonce:nonce(),cache_key:currentData.cache_key} }).done(function(r){ if(!r || !r.success || !r.token){setActionStatus(r&&r.error?r.error:'Could not create the share link.',true);return;} let shareUrl; try{const u=new URL(window.location.href);u.searchParams.set('similar_channels_share',r.token);u.hash='';shareUrl=u.href;} catch(e){shareUrl=window.location.origin+window.location.pathname+'?similar_channels_share='+encodeURIComponent(r.token);} copyValue(shareUrl,function(copied){ const $status=$('#ysc-action-status').removeClass('error').addClass('active').empty(); $status.append(document.createTextNode(copied?'Share link copied. ':'Share link created. ')); $status.append($('',{href:shareUrl,target:'_blank',rel:'noopener noreferrer',text:'Open shared report'})); $status.append(document.createTextNode(' — expires in 30 days.')); }); }).fail(function(xhr,status){ setActionStatus(status==='timeout'?'Sharing timed out. Please try again.':'Could not create the share link. Please try again.',true); }).always(function(){$button.prop('disabled',false).removeAttr('aria-busy');}); } /* ───────────────────── EVENT DELEGATION ───────────────────── */ $(document).off('.ysc'); $(document).on('input.ysc', '#ysc-search-input', function(){ uiState.search = this.value; renderChannels(); }); $(document).on('change.ysc', '#ysc-sort', function(){ uiState.sort = this.value; renderChannels(); }); $(document).on('click.ysc', '.ysc-chip', function(){ uiState[$(this).data('group')] = String($(this).data('val')); $('.ysc-chip[data-group="'+$(this).data('group')+'"]').removeClass('active'); $(this).addClass('active'); renderChannels(); }); $(document).on('click.ysc', '.ysc-view-toggle button', function(){ uiState.view = $(this).data('view'); $('.ysc-view-toggle button').removeClass('active'); $(this).addClass('active'); renderChannels(); }); $(document).on('click.ysc', '.ysc-table th[data-sort]', function(){ uiState.sort = $(this).data('sort'); renderChannels(); }); $(document).on('click.ysc', '.ysc-ch-copy', function(){ copy($(this).data('url')); }); $(document).on('click.ysc', '#ysc-reset-filters', function(e){ e.preventDefault(); uiState.tier='all'; uiState.activity='all'; uiState.overlap='all'; uiState.search=''; $('#ysc-search-input').val(''); $('.ysc-chip').removeClass('active'); $('.ysc-chip[data-val="all"]').addClass('active'); renderChannels(); }); $(document).on('click.ysc', '#ysc-export-csv', exportCsv); $(document).on('click.ysc', '#ysc-export-pdf', downloadPdf); $(document).on('click.ysc', '.ysc-print-pdf', printReport); $(document).on('click.ysc', '#ysc-share-report', shareReport); $(document).on('click.ysc', '#ysc-copy-all', function(){ const links = filteredChannels().map(c=>c.url).join('\n'); if (links) copy(links); }); /* ───────────────────── CHANNEL PREVIEW OVERLAY ───────────────────── */ function yscChannelLabel(url) { var m; if (m = url.match(/@([^/?#]+)/u)) { try{return '@'+decodeURIComponent(m[1]);}catch(e){return '@'+m[1];} } if (m = url.match(/\/channel\/(UC[\w-]{22})/)) return m[1]; if (m = url.match(/\/(?:c|user)\/([\w.\-]+)/)) return m[1]; if (/^UC[\w-]{22}$/.test(url)) return url; return url; } function yscShowOverlay(label) { $('#youtube-overlay,.ysc-preview-error').remove(); var ov = $('
'); ov.append($('').text(label)).append($('

Tool Comments