Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IDs + titulo :
- javascript:(function() { var links = document.querySelectorAll('a#video-title'); var videoData = new Set(); for (var i = 0; i < links.length; i++) { var link = links[i]; var href = link.getAttribute('href'); var videoId = href.match(/watch\?v=([^&]+)/); var title = link.textContent.trim(); if (videoId) { videoData.add("'" + videoId[1] + "'\\" + title); } } if (videoData.size > 0) { var csvContent = 'ID\\Título\n'; videoData.forEach(function(item) { csvContent += item + '\n'; }); var blob = new Blob([csvContent], { type: 'text/csv' }); var url = window.URL.createObjectURL(blob); var a = document.createElement('a'); a.href = url; a.download = 'videos.csv'; a.style.display = 'none'; document.body.appendChild(a); a.click(); window.URL.revokeObjectURL(url); document.body.removeChild(a); } else { alert('No se encontraron enlaces con el atributo id="video-title".'); }})();
- id solo :
- javascript:(function() { var links = document.querySelectorAll('a#video-title'); var videoIds = []; for (var i = 0; i < links.length; i++) { var href = links[i].getAttribute('href'); var videoId = href.match(/watch\?v=([^&]+)/); if (videoId) { videoIds.push("'" + videoId[1] + "'"); } } if (videoIds.length > 0) { var idsString = videoIds.join(', '); var textarea = document.createElement('textarea'); textarea.value = idsString; document.body.appendChild(textarea); textarea.select(); document.execCommand('copy'); document.body.removeChild(textarea); alert('Los IDs se han copiado al portapapeles:\n\n' + idsString); } else { alert('No se encontraron enlaces con el atributo id="video-title".'); }})();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement