Update index.html

This commit is contained in:
VlastikYoutubeKo 2025-08-15 12:29:18 +02:00 committed by GitHub
parent 2623494ccd
commit 78d5df5962
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,7 +60,7 @@
margin-bottom: 2rem; margin-bottom: 2rem;
} }
.project-info h2 { .project-info h2, .project-info h3 {
margin-top: 0; margin-top: 0;
} }
@ -73,6 +73,10 @@
.project-info a:hover { .project-info a:hover {
text-decoration: underline; text-decoration: underline;
} }
.playlist-links p {
margin: 0.5rem 0;
}
.category-folder { .category-folder {
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
@ -95,17 +99,29 @@
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
} }
.channel-table th, .channel-table td {
padding: 0.75rem 1.5rem;
border-top: 1px solid var(--border-color);
text-align: left;
}
.channel-table td { .channel-table th {
text-align: left; font-weight: 600;
padding: 0.75rem 1.5rem; font-size: 0.9rem;
border-top: 1px solid var(--border-color); color: var(--muted-text-color);
} }
.channel-name { .channel-name {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.channel-table a {
color: var(--accent-color);
text-decoration: none;
font-weight: 500;
}
.unstable-icon { .unstable-icon {
color: #ffc107; color: #ffc107;
@ -131,24 +147,28 @@
const parseM3U = (m3uContent, isStable) => { const parseM3U = (m3uContent, isStable) => {
const lines = m3uContent.split('\n'); const lines = m3uContent.split('\n');
const channels = {}; const channels = {};
const regex = /group-title="([^"]+)"/ const regex = /group-title="([^"]+)"/;
for (const line of lines) { for (let i = 0; i < lines.length; i++) {
const line = lines[i];
if (line.startsWith('#EXTINF:-1')) { if (line.startsWith('#EXTINF:-1')) {
try { try {
const nextLine = lines[i + 1];
if (!nextLine || nextLine.startsWith('#')) continue;
const countryMatch = line.match(regex); const countryMatch = line.match(regex);
if (!countryMatch) continue; if (!countryMatch) continue;
const country = countryMatch[1].trim(); const country = countryMatch[1].trim();
const channelName = line.split(',').pop().trim(); const channelName = line.split(',').pop().trim();
const streamUrl = nextLine.trim();
if (!channels[country]) { if (!channels[country]) {
channels[country] = {}; channels[country] = {};
} }
// Přidáme kanál, pouze pokud ještě neexistuje, abychom předešli duplicitám
if (!channels[country][channelName]) { if (!channels[country][channelName]) {
channels[country][channelName] = { name: channelName, stable: isStable }; channels[country][channelName] = { name: channelName, stable: isStable, url: streamUrl };
} }
} catch (e) { } catch (e) {
console.error("Chyba při parsování řádku:", line, e); console.error("Chyba při parsování řádku:", line, e);
@ -169,6 +189,12 @@
</div> </div>
{isOpen && ( {isOpen && (
<table className="channel-table"> <table className="channel-table">
<thead>
<tr>
<th>Channel</th>
<th>Stream Link</th>
</tr>
</thead>
<tbody> <tbody>
{channels.map(channel => ( {channels.map(channel => (
<tr key={channel.name}> <tr key={channel.name}>
@ -180,6 +206,9 @@
} }
</div> </div>
</td> </td>
<td>
<a href={channel.url} target="_blank" rel="noopener noreferrer">Link</a>
</td>
</tr> </tr>
))} ))}
</tbody> </tbody>
@ -196,7 +225,6 @@
useEffect(() => { useEffect(() => {
const fetchAndParseData = async () => { const fetchAndParseData = async () => {
try { try {
// Načtení obou M3U souborů
const [ariaRes, ariaPlusRes] = await Promise.all([ const [ariaRes, ariaPlusRes] = await Promise.all([
fetch('aria.m3u'), fetch('aria.m3u'),
fetch('aria+.m3u') fetch('aria+.m3u')
@ -205,16 +233,12 @@
const ariaText = await ariaRes.text(); const ariaText = await ariaRes.text();
const ariaPlusText = await ariaPlusRes.text(); const ariaPlusText = await ariaPlusRes.text();
// Parsování
const stableChannels = parseM3U(ariaText, true); const stableChannels = parseM3U(ariaText, true);
const unstableChannels = parseM3U(ariaPlusText, false); const unstableChannels = parseM3U(ariaPlusText, false);
// Sloučení dat: nestabilní kanály nepřepíší stabilní, pokud mají stejné jméno
const allChannels = { ...stableChannels }; const allChannels = { ...stableChannels };
for (const country in unstableChannels) { for (const country in unstableChannels) {
if (!allChannels[country]) { if (!allChannels[country]) allChannels[country] = {};
allChannels[country] = {};
}
for (const channelName in unstableChannels[country]) { for (const channelName in unstableChannels[country]) {
if (!allChannels[country][channelName]) { if (!allChannels[country][channelName]) {
allChannels[country][channelName] = unstableChannels[country][channelName]; allChannels[country][channelName] = unstableChannels[country][channelName];
@ -222,7 +246,6 @@
} }
} }
// Převod na pole pro snadné renderování a seřazení
const formattedData = Object.keys(allChannels).sort().map(country => ({ const formattedData = Object.keys(allChannels).sort().map(country => ({
country, country,
channels: Object.values(allChannels[country]).sort((a, b) => a.name.localeCompare(b.name)) channels: Object.values(allChannels[country]).sort((a, b) => a.name.localeCompare(b.name))
@ -251,9 +274,14 @@
<p> <p>
Aria provides a curated collection of IPTV channels from around the world. The channels are organized by their countries. Unlike our predecessor Mystique, this git is only using official streams, tvheadends, astra control panel among others. Aria provides a curated collection of IPTV channels from around the world. The channels are organized by their countries. Unlike our predecessor Mystique, this git is only using official streams, tvheadends, astra control panel among others.
</p> </p>
<div className="playlist-links">
<h3>Playlist Files</h3>
<p><a href="./aria.m3u" download>Download aria.m3u</a> (Stable Streams)</p>
<p><a href="./aria+.m3u" download>Download aria+.m3u</a> (Potentially Unstable Streams)</p>
</div>
<h3>Want to help us?</h3> <h3>Want to help us?</h3>
<p> <p>
You can go to the <a href="https://github.com/theariatv/theariatv.github.io/issues" target="_blank" rel="noopener noreferrer">Issues tab</a> on GitHub to request a channel-specific action (e.g., removing a dead link, adding a new channel). You can go to the <a href="https://github.com/theariatv/theariatv.github.io/issues" target="_blank" rel="noopener noreferrer">Issues tab</a> on GitHub to request a channel-specific action.
</p> </p>
</div> </div>