quiero poder leer ficheros m3u y listas http varias de iptv, poder verlos categorizados por pais y asi elegirlo para visualizar el canal, ademas de poder buscar y filtrar.
Browse filesFiles changed (2)
- README.md+7-4
- index.html+408-18
12345678910---title: Streamsphere Exploreremoji: 📉colorFrom: graycolorTo: yellowsdk: staticpinned: false---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference12345678910111213---title: StreamSphere Explorer 🌍colorFrom: pinkcolorTo: yellowemoji: 🐳sdk: staticpinned: falsetags:- deepsite-v3---# Welcome to your new DeepSite project!This project was created with [DeepSite](https://deepsite.hf.co).
12345678910111213141516171819<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>My static Space</title><link rel="stylesheet" href="style.css" /></head><body><div class="card"><h1>Welcome to your static Space!</h1><p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p><p>Also don't forget to check the<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.</p></div></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>StreamSphere Explorer - IPTV Player</title><link rel="icon" type="image/x-icon" href="/static/favicon.ico"><script src="https://cdn.tailwindcss.com"></script><script src="https://unpkg.com/feather-icons"></script><script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script><script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.globe.min.js"></script><style>.channel-card:hover {transform: translateY(-5px);transition: all 0.3s ease;}.video-container {background: #000;border-radius: 12px;overflow: hidden;}.country-flag {width: 24px;height: 16px;object-fit: cover;border-radius: 2px;}</style></head><body class="bg-gradient-to-br from-gray-900 to-black text-white min-h-screen"><!-- Navigation --><nav class="bg-gray-800/80 backdrop-blur-md border-b border-gray-700 sticky top-0 z-50"><div class="container mx-auto px-4 py-3"><div class="flex items-center justify-between"><div class="flex items-center space-x-2"><i data-feather="globe" class="text-blue-400"></i><h1 class="text-xl font-bold bg-gradient-to-r from-blue-400 to-purple-500 bg-clip-text text-transparent">StreamSphere Explorer</h1></div><div class="flex items-center space-x-4"><button id="uploadBtn" class="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-lg flex items-center space-x-2 transition-colors"><i data-feather="upload" class="w-4 h-4"></i><span>Upload M3U</span></button><button id="addUrlBtn" class="bg-purple-600 hover:bg-purple-700 px-4 py-2 rounded-lg flex items-center space-x-2 transition-colors"><i data-feather="link" class="w-4 h-4"></i><span>Add URL</span></button></div></div></div></nav><!-- Main Content --><div class="container mx-auto px-4 py-8"><div class="grid lg:grid-cols-4 gap-8"><!-- Sidebar --><div class="lg:col-span-1 space-y-6"><!-- Search --><div class="bg-gray-800/50 rounded-xl p-4 backdrop-blur-sm"><div class="flex items-center space-x-2 mb-4"><i data-feather="search" class="text-gray-400"></i><input type="text" id="searchInput" placeholder="Search channels..."class="bg-gray-700/50 border border-gray-600 rounded-lg px-3 py-2 text-white w-full focus:outline-none focus:ring-2 focus:ring-blue-500"></div><!-- Country Filter --><div class="space-y-3"><h3 class="font-semibold text-gray-300 flex items-center space-x-2"><i data-feather="map-pin" class="w-4 h-4"></i><span>Filter by Country</span></h3><select id="countryFilter" class="w-full bg-gray-700/50 border border-gray-600 rounded-lg px-3 py-2 text-white focus:outline-none focus:ring-2 focus:ring-blue-500"><option value="">All Countries</option></select></div><!-- Category Filter --><div class="space-y-3 mt-4"><h3 class="font-semibold text-gray-300 flex items-center space-x-2"><i data-feather="grid" class="w-4 h-4"></i><span>Filter by Category</span></h3><select id="categoryFilter" class="w-full bg-gray-700/50 border border-gray-600 rounded-lg px-3 py-2 text-white focus:outline-none focus:ring-2 focus:ring-blue-500"><option value="">All Categories</option></select></div></div><!-- Playlists --><div class="bg-gray-800/50 rounded-xl p-4 backdrop-blur-sm"><h3 class="font-semibold text-gray-300 mb-3 flex items-center space-x-2"><i data-feather="list" class="w-4 h-4"></i><span>Playlists</span></h3><div id="playlistList" class="space-y-2 max-h-60 overflow-y-auto"><!-- Playlists will be populated here --></div></div></div><!-- Main Content Area --><div class="lg:col-span-3"><!-- Video Player --><div class="video-container mb-8 shadow-2xl"><video id="videoPlayer" controls class="w-full h-64 lg:h-96" poster="http://static.photos/abstract/1024x576/42">Your browser does not support the video tag.</video></div><!-- Channels Grid --><div class="mb-6 flex items-center justify-between"><h2 class="text-2xl font-bold">Available Channels</h2><div class="text-gray-400 text-sm" id="channelCount">0 channels</div></div><div id="channelsGrid" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4"><!-- Channels will be populated here --><div class="text-center py-12 text-gray-500"><i data-feather="tv" class="w-12 h-12 mx-auto mb-3"></i><p>Upload an M3U file or add a playlist URL to get started</p></div></div></div></div></div><!-- Modals --><!-- Upload Modal --><div id="uploadModal" class="fixed inset-0 bg-black/70 flex items-center justify-center z-50 hidden"><div class="bg-gray-800 rounded-2xl p-6 w-full max-w-md mx-4"><div class="flex items-center justify-between mb-4"><h3 class="text-lg font-semibold">Upload M3U File</h3><button id="closeUploadModal" class="text-gray-400 hover:text-white"><i data-feather="x" class="w-5 h-5"></i></button></div><input type="file" id="m3uFile" accept=".m3u,.m3u8" class="w-full mb-4"><button id="processM3U" class="w-full bg-blue-600 hover:bg-blue-700 py-2 rounded-lg transition-colors">Process File</button></div></div><!-- URL Modal --><div id="urlModal" class="fixed inset-0 bg-black/70 flex items-center justify-center z-50 hidden"><div class="bg-gray-800 rounded-2xl p-6 w-full max-w-md mx-4"><div class="flex items-center justify-between mb-4"><h3 class="text-lg font-semibold">Add Playlist URL</h3><button id="closeUrlModal" class="text-gray-400 hover:text-white"><i data-feather="x" class="w-5 h-5"></i></button></div><input type="url" id="playlistUrl" placeholder="https://example.com/playlist.m3u"class="w-full bg-gray-700 border border-gray-600 rounded-lg px-3 py-2 text-white mb-4 focus:outline-none focus:ring-2 focus:ring-blue-500"><button id="addPlaylistUrl" class="w-full bg-purple-600 hover:bg-purple-700 py-2 rounded-lg transition-colors">Add Playlist</button></div></div><script>// Vanta.js BackgroundVANTA.GLOBE({el: "body",mouseControls: true,touchControls: true,gyroControls: false,minHeight: 200.00,minWidth: 200.00,scale: 1.00,scaleMobile: 1.00,color: 0x3b82f6,backgroundColor: 0x111827,size: 0.8});// Global statelet playlists = [];let channels = [];let filteredChannels = [];// DOM Elementsconst uploadBtn = document.getElementById('uploadBtn');const addUrlBtn = document.getElementById('addUrlBtn');const uploadModal = document.getElementById('uploadModal');const urlModal = document.getElementById('urlModal');const closeUploadModal = document.getElementById('closeUploadModal');const closeUrlModal = document.getElementById('closeUrlModal');const processM3U = document.getElementById('processM3U');const addPlaylistUrl = document.getElementById('addPlaylistUrl');const m3uFile = document.getElementById('m3uFile');const playlistUrl = document.getElementById('playlistUrl');const searchInput = document.getElementById('searchInput');const countryFilter = document.getElementById('countryFilter');const categoryFilter = document.getElementById('categoryFilter');const channelsGrid = document.getElementById('channelsGrid');const playlistList = document.getElementById('playlistList');const videoPlayer = document.getElementById('videoPlayer');const channelCount = document.getElementById('channelCount');// Event ListenersuploadBtn.addEventListener('click', () => uploadModal.classList.remove('hidden'));addUrlBtn.addEventListener('click', () => urlModal.classList.remove('hidden'));closeUploadModal.addEventListener('click', () => uploadModal.classList.add('hidden'));closeUrlModal.addEventListener('click', () => urlModal.classList.add('hidden'));processM3U.addEventListener('click', processM3UFile);addPlaylistUrl.addEventListener('click', addPlaylistFromUrl);searchInput.addEventListener('input', filterChannels);countryFilter.addEventListener('change', filterChannels);categoryFilter.addEventListener('change', filterChannels);// Functionsfunction processM3UFile() {const file = m3uFile.files[0];if (!file) return;const reader = new FileReader();reader.onload = function(e) {const content = e.target.result;parseM3UContent(content, file.name);uploadModal.classList.add('hidden');};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');playlistUrl.value = '';} catch (error) {alert('Error loading playlist from URL: ' + error.message);}}function parseM3UContent(content, source) {const lines = content.split('\n');const newChannels = [];let currentChannel = {};for (let i = 0; i < lines.length; i++) {const line = lines[i].trim();if (line.startsWith('#EXTINF:')) {currentChannel = parseExtinfLine(line);} else if (line.startsWith('http')) {currentChannel.url = line;currentChannel.source = source;newChannels.push(currentChannel);currentChannel = {};}}// Add new channels to global listchannels = [...channels, ...newChannels];// Add playlist if it doesn't existif (!playlists.find(p => p.source === source)) {playlists.push({source: source,name: source.split('/').pop() || 'Custom Playlist',channelCount: newChannels.length});}updatePlaylistList();updateFilters();filterChannels();}function parseExtinfLine(line) {const channel = {};// Extract duration and nameconst match = line.match(/#EXTINF:(-?\d+)(.*?),(.*)/);if (match) {channel.duration = parseInt(match[1]);const 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 presentif (!channel.country) channel.country = 'Unknown';if (!channel.group) channel.group = 'General';}return 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"><i data-feather="play-circle" class="w-4 h-4 text-green-400"></i><span class="text-sm truncate">${playlist.name}</span></div><span class="text-xs text-gray-400 bg-gray-600 px-2 py-1 rounded">${playlist.channelCount}</span></div>`).join('');feather.replace();}function updateFilters() {// Update country filterconst countries = [...new Set(channels.map(c => c.country).filter(Boolean))].sort();countryFilter.innerHTML = '<option value="">All Countries</option>' +countries.map(country => `<option value="${country}">${country}</option>`).join('');// Update category filterconst categories = [...new Set(channels.map(c => c.group).filter(Boolean))].sort();categoryFilter.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;filteredChannels = channels.filter(channel => {const matchesSearch = !searchTerm ||channel.name.toLowerCase().includes(searchTerm) ||(channel.group && channel.group.toLowerCase().includes(searchTerm));const matchesCountry = !selectedCountry || channel.country === selectedCountry;const matchesCategory = !selectedCategory || channel.group === selectedCategory;return matchesSearch && matchesCountry && matchesCategory;});displayChannels();}function displayChannels() {channelCount.textContent = `${filteredChannels.length} channels`;if (filteredChannels.length === 0) {channelsGrid.innerHTML = `<div class="col-span-full text-center py-12 text-gray-500"><i data-feather="search" class="w-12 h-12 mx-auto mb-3"></i><p>No channels found matching your criteria</p></div>`;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 => {console.error('Error playing video:', e);alert('Error playing channel. The stream might be unavailable.');});// Update UI to show current playing channeldocument.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>
README.md+7-4
index.html+408-18