no deja buscar, no se ve la lista, no funciona la busqueda por url
Browse files225 unmodified lines2262272282292302312322332342352362372382 unmodified lines24124224324424524624724827 unmodified lines2762772782792802812824 unmodified lines2872882892902912922932942952963 unmodified lines3003013023033043053063077 unmodified lines3153163173183193203215 unmodified lines32732832933033133233333424 unmodified lines3593603613623633643653663673683693703713723733743753763773783793803813823833843853863875 unmodified lines393394395396397398399400401402403404405406407408409225 unmodified lines};reader.readAsText(file);}async function addPlaylistFromUrl() {const url = playlistUrl.value.trim();if (!url) return;try {const response = await fetch(url);const content = await response.text();parseM3UContent(content, url);urlModal.classList.add('hidden');2 unmodified linesalert('Error loading playlist from URL: ' + error.message);}}function parseM3UContent(content, source) {const lines = content.split('\n');const newChannels = [];let currentChannel = {};27 unmodified linesupdateFilters();filterChannels();}function parseExtinfLine(line) {const channel = {};4 unmodified linesconst attributes = match[2];channel.name = match[3].trim();// Extract attributesconst attrMatches = attributes.matchAll(/(\w+)="([^"]*)"/g);for (const match of attrMatches) {channel[match[1].toLowerCase()] = match[2];}// Set default values if not present3 unmodified linesreturn channel;}function updatePlaylistList() {playlistList.innerHTML = playlists.map(playlist => `<div class="flex items-center justify-between p-2 bg-gray-700/30 rounded-lg hover:bg-gray-700/50 cursor-pointer transition-colors"><div class="flex items-center space-x-2">7 unmodified lines`).join('');feather.replace();}function updateFilters() {// Update country filterconst countries = [...new Set(channels.map(c => c.country).filter(Boolean))].sort();5 unmodified linescategoryFilter.innerHTML = '<option value="">All Categories</option>' +categories.map(category => `<option value="${category}">${category}</option>`).join('');}function filterChannels() {const searchTerm = searchInput.value.toLowerCase();const selectedCountry = countryFilter.value;const selectedCategory = categoryFilter.value;24 unmodified lines`;return;}channelsGrid.innerHTML = filteredChannels.map(channel => `<div class="channel-card bg-gray-800/50 backdrop-blur-sm rounded-xl p-4 border border-gray-700 hover:border-blue-500 cursor-pointer transition-all duration-300"onclick="playChannel('${channel.url}', '${channel.name.replace(/'/g, "\\'")}')"><div class="flex items-center space-x-3 mb-3"><div class="w-12 h-12 bg-gradient-to-br from-blue-500 to-purple-600 rounded-lg flex items-center justify-center"><i data-feather="play" class="w-5 h-5 text-white"></i></div><div class="flex-1 min-w-0"><h4 class="font-semibold text-white truncate">${channel.name}</h4><div class="flex items-center space-x-2 mt-1">${channel.country && channel.country !== 'Unknown' ? `<span class="text-xs text-gray-400">${channel.country}</span>` : ''}</div></div><div class="text-xs text-gray-400 mt-2 flex items-center justify-between"><span class="bg-gray-700 px-2 py-1 rounded">${channel.group || 'General'}</span></div>`).join('');feather.replace();}function playChannel(url, name) {videoPlayer.src = url;videoPlayer.play().catch(e => {5 unmodified linesdocument.querySelectorAll('.channel-card').forEach(card => {card.classList.remove('border-blue-500', 'bg-blue-500/20');});event.currentTarget.classList.add('border-blue-500', 'bg-blue-500/20');}// Close modals when clicking outsidewindow.addEventListener('click', (e) => {if (e.target === uploadModal) uploadModal.classList.add('hidden');if (e.target === urlModal) urlModal.classList.add('hidden');});// Initializefeather.replace();</script></body></html>225 unmodified lines2262272282292302312322332342352362372382392402 unmodified lines24324424524624724824927 unmodified lines2772782792802812824 unmodified lines2872882892902912922932942952962972982993003013023033043053063073083093 unmodified lines3133143153163173183197 unmodified lines3273283293303313325 unmodified lines33833934034134234334424 unmodified lines3693703713723733743753763773783793803813823833843853863873883893903913923933943953965 unmodified lines402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435225 unmodified lines};reader.readAsText(file);}async function addPlaylistFromUrl() {const url = playlistUrl.value.trim();if (!url) return;try {// Add CORS proxy to bypass CORS restrictionsconst proxyUrl = 'https://cors-anywhere.herokuapp.com/';const response = await fetch(proxyUrl + url);if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);const content = await response.text();parseM3UContent(content, url);urlModal.classList.add('hidden');2 unmodified linesalert('Error loading playlist from URL: ' + error.message);}}function parseM3UContent(content, source) {const lines = content.split('\n');const newChannels = [];let currentChannel = {};27 unmodified linesupdateFilters();filterChannels();}function parseExtinfLine(line) {const channel = {};4 unmodified linesconst attributes = match[2];channel.name = match[3].trim();// Extract attributes using a more robust approachif (attributes) {// Extract tvg-nameconst tvgNameMatch = attributes.match(/tvg-name="([^"]*)"/i);if (tvgNameMatch) channel.tvgName = tvgNameMatch[1];// Extract tvg-logoconst tvgLogoMatch = attributes.match(/tvg-logo="([^"]*)"/i);if (tvgLogoMatch) channel.tvgLogo = tvgLogoMatch[1];// Extract group-titleconst groupTitleMatch = attributes.match(/group-title="([^"]*)"/i);if (groupTitleMatch) channel.group = groupTitleMatch[1];// Extract countryconst countryMatch = attributes.match(/tvg-country="([^"]*)"/i);if (countryMatch) channel.country = countryMatch[1];}// Set default values if not present3 unmodified linesreturn channel;}function updatePlaylistList() {playlistList.innerHTML = playlists.map(playlist => `<div class="flex items-center justify-between p-2 bg-gray-700/30 rounded-lg hover:bg-gray-700/50 cursor-pointer transition-colors"><div class="flex items-center space-x-2">7 unmodified lines`).join('');feather.replace();}function updateFilters() {// Update country filterconst countries = [...new Set(channels.map(c => c.country).filter(Boolean))].sort();5 unmodified linescategoryFilter.innerHTML = '<option value="">All Categories</option>' +categories.map(category => `<option value="${category}">${category}</option>`).join('');}function filterChannels() {const searchTerm = searchInput.value.toLowerCase();const selectedCountry = countryFilter.value;const selectedCategory = categoryFilter.value;24 unmodified lines`;return;}channelsGrid.innerHTML = filteredChannels.map(channel => `<div class="channel-card bg-gray-800/50 backdrop-blur-sm rounded-xl p-4 border border-gray-700 hover:border-blue-500 cursor-pointer transition-all duration-300"onclick="playChannel('${channel.url.replace(/'/g, "\\'")}', '${channel.name ? channel.name.replace(/'/g, "\\'") : 'Unknown'}')"><div class="flex items-center space-x-3 mb-3"><div class="w-12 h-12 bg-gradient-to-br from-blue-500 to-purple-600 rounded-lg flex items-center justify-center"><i data-feather="play" class="w-5 h-5 text-white"></i></div><div class="flex-1 min-w-0"><h4 class="font-semibold text-white truncate">${channel.name || 'Unknown Channel'}</h4><div class="flex items-center space-x-2 mt-1">${channel.country && channel.country !== 'Unknown' ? `<span class="text-xs text-gray-400">${channel.country}</span>` : ''}</div></div><div class="text-xs text-gray-400 mt-2 flex items-center justify-between"><span class="bg-gray-700 px-2 py-1 rounded">${channel.group || 'General'}</span></div></div>`).join('');feather.replace();}function playChannel(url, name) {videoPlayer.src = url;videoPlayer.play().catch(e => {5 unmodified linesdocument.querySelectorAll('.channel-card').forEach(card => {card.classList.remove('border-blue-500', 'bg-blue-500/20');});// Find and highlight the current playing channel cardconst channelCards = document.querySelectorAll('.channel-card');for (let card of channelCards) {if (card.querySelector('h4').textContent === name) {card.classList.add('border-blue-500', 'bg-blue-500/20');}}}// Close modals when clicking outsidewindow.addEventListener('click', (e) => {if (e.target === uploadModal) uploadModal.classList.add('hidden');if (e.target === urlModal) urlModal.classList.add('hidden');});// Initialize with sample data for testingfeather.replace();// Add sample playlist for testingsetTimeout(() => {const samplePlaylist = `#EXTM3U#EXTINF:-1 tvg-id="Example1" tvg-name="Example Channel 1" tvg-logo="https://example.com/logo1.png" group-title="Entertainment" tvg-country="US",Example Channel 1http://example.com/stream1.m3u8#EXTINF:-1 tvg-id="Example2" tvg-name="Example Channel 2" tvg-logo="https://example.com/logo2.png" group-title="News" tvg-country="UK",Example Channel 2http://example.com/stream2.m3u8#EXTINF:-1 tvg-id="Example3" tvg-name="Example Channel 3" tvg-logo="https://example.com/logo3.png" group-title="Sports" tvg-country="ES",Example Channel 3http://example.com/stream3.m3u8`;parseM3UContent(samplePlaylist, 'Sample Playlist');}, 1000);</script></body></html>
index.html+55-29