// ===== كوورة 10 =====
async function loadKoora10Content() {
const statusEl = document.getElementById('koora10Status');
const container = document.getElementById('koora10Matches');
const baseURL = "https://kkk.alkoora.live/albaplayer/on-time-sport-1/?serv=";
const totalServs = 9;
try {
let allMatches = [];
for (let i = 1; i <= totalServs; i++) {
const url = baseURL + i;
const proxy = "https://api.allorigins.win/raw?url=" + encodeURIComponent(url);
const response = await fetch(proxy);
if (!response.ok) throw new Error("فشل الجلب");
const html = await response.text();
const targetLinkMatch = html.match(/https?:\/\/[^\s"'<>]+\/chtv\/ch1\.php/);
if (targetLinkMatch) {
const alkooraLink = targetLinkMatch[0].replace(/\/chtv\/ch1\.php$/, "/alkoora.txt");
const alkooraProxy = "https://api.allorigins.win/raw?url=" + encodeURIComponent(alkooraLink);
const alkResponse = await fetch(alkooraProxy);
const alkHtml = await alkResponse.text();
const matchPattern = /(\d{1,2}:\d{2})\s+([^\|]+)\s+\|\s+(https?:\/\/[^\s"'<>]+\/chtv\/ch\d+\.php)/gi;
const matches = [...alkHtml.matchAll(matchPattern)];
if (matches.length > 0) {
allMatches = matches.map(m => ({ time: m[1], teams: m[2], link: m[3], serv: i }));
break; // التوقف عند أول سيرفر يوجد فيه مباريات
}
}
}
if (allMatches.length > 0) {
statusEl.className = 'status';
statusEl.textContent = `تم تحميل ${allMatches.length} مباراة`;
allMatches.forEach(match => {
const card = document.createElement('div');
card.className = 'content-card';
card.innerHTML = `
${match.time}
${match.teams}
CH${match.serv}
`;
container.appendChild(card);
});
} else {
statusEl.className = 'status error';
statusEl.textContent = 'لم يتم العثور على مباريات';
}
} catch (e) {
console.error('خطأ في تحميل محتوى كوورة 10:', e);
statusEl.className = 'status error';
statusEl.textContent = 'حدث خطأ أثناء تحميل المباريات';
}
}
Comments
Post a Comment