diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index f6c97a89..c45bbe30 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -34,7 +34,8 @@ jobs: tvtv.ca, tvtv.us, tv.lv, - maxtv.hrvatskitelekom.hr + elcinema.com, + maxtv.hrvatskitelekom.hr, mncvision.id, tvguide.com, tvprofil.com diff --git a/README.md b/README.md index e86f4b38..7d979e55 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ To load a program guide, all you need to do is copy the link to one of the guide CountryEPG + 🇩🇿 Algeriahttps://iptv-org.github.io/epg/guides/elcinema.com.guide.xml 🇦🇱 Albaniahttps://iptv-org.github.io/epg/guides/tvprofil.com.guide.xml 🇦🇩 Andorrahttps://iptv-org.github.io/epg/guides/andorradifusio.ad.guide.xml 🇦🇷 Argentinahttps://iptv-org.github.io/epg/guides/mi.tv.guide.xml @@ -29,6 +30,7 @@ To load a program guide, all you need to do is copy the link to one of the guide 🇭🇷 Croatiahttps://iptv-org.github.io/epg/guides/maxtv.hrvatskitelekom.hr.guide.xml 🇭🇷 Croatiahttps://iptv-org.github.io/epg/guides/tvprofil.com.guide.xml 🇨🇿 Czechiahttps://iptv-org.github.io/epg/guides/m.tv.sms.cz.guide.xml + 🇪🇬 Egypthttps://iptv-org.github.io/epg/guides/elcinema.com.guide.xml 🇸🇻 El Salvadorhttps://iptv-org.github.io/epg/guides/mi.tv.guide.xml 🇫🇮 Finlandhttps://iptv-org.github.io/epg/guides/telkussa.fi.guide.xml 🇫🇷 Francehttps://iptv-org.github.io/epg/guides/programme-tv.net.guide.xml @@ -40,10 +42,16 @@ To load a program guide, all you need to do is copy the link to one of the guide 🇭🇺 Hungaryhttps://iptv-org.github.io/epg/guides/tvprofil.com.guide.xml 🇮🇹 Italyhttps://iptv-org.github.io/epg/guides/guidatv.sky.it.guide.xml 🇮🇪 Irelandhttps://iptv-org.github.io/epg/guides/ontvtonight.com.guide.xml + 🇮🇷 Iranhttps://iptv-org.github.io/epg/guides/elcinema.com.guide.xml + 🇮🇶 Iraqhttps://iptv-org.github.io/epg/guides/elcinema.com.guide.xml + 🇯🇴 Jordanhttps://iptv-org.github.io/epg/guides/elcinema.com.guide.xml 🇰🇿 Kazakhstanhttps://iptv-org.github.io/epg/guides/tv.yandex.ru.guide.xml + 🇰🇼 Kuwaithttps://iptv-org.github.io/epg/guides/elcinema.com.guide.xml 🇱🇻 Latviahttps://iptv-org.github.io/epg/guides/tv.lv.guide.xml + 🇱🇾 Libyahttps://iptv-org.github.io/epg/guides/elcinema.com.guide.xml 🇲🇾 Malaysiahttps://iptv-org.github.io/epg/guides/astro.com.my.guide.xml 🇲🇽 Mexicohttps://iptv-org.github.io/epg/guides/mi.tv.guide.xml + 🇲🇦 Moroccohttps://iptv-org.github.io/epg/guides/elcinema.com.guide.xml 🇲🇪 Montenegrohttps://iptv-org.github.io/epg/guides/tvprofil.com.guide.xml 🇲🇰 North Macedoniahttps://iptv-org.github.io/epg/guides/tvprofil.com.guide.xml 🇵🇾 Paraguayhttps://iptv-org.github.io/epg/guides/mi.tv.guide.xml @@ -52,13 +60,17 @@ To load a program guide, all you need to do is copy the link to one of the guide 🇵🇹 Portugalhttps://iptv-org.github.io/epg/guides/meo.pt.guide.xml 🇷🇴 Romaniahttps://iptv-org.github.io/epg/guides/programetv.ro.guide.xml 🇷🇺 Russiahttps://iptv-org.github.io/epg/guides/tv.yandex.ru.guide.xml + 🇸🇦 Saudi Arabiahttps://iptv-org.github.io/epg/guides/elcinema.com.guide.xml 🇷🇸 Serbiahttps://iptv-org.github.io/epg/guides/maxtv.hrvatskitelekom.hr.guide.xml 🇷🇸 Serbiahttps://iptv-org.github.io/epg/guides/tvprofil.com.guide.xml 🇸🇮 Sloveniahttps://iptv-org.github.io/epg/guides/tvprofil.com.guide.xml 🇪🇸 Spainhttps://iptv-org.github.io/epg/guides/programacion-tv.elpais.com.guide.xml 🇸🇪 Swedenhttps://iptv-org.github.io/epg/guides/telkussa.fi.guide.xml + 🇸🇾 Syriahttps://iptv-org.github.io/epg/guides/elcinema.com.guide.xml + 🇹🇳 Tunisiahttps://iptv-org.github.io/epg/guides/elcinema.com.guide.xml 🇹🇷 Turkeyhttps://iptv-org.github.io/epg/guides/digiturk.com.tr.guide.xml 🇺🇦 Ukrainehttps://iptv-org.github.io/epg/guides/tvgid.ua.guide.xml + 🇦🇪 United Arab Emirateshttps://iptv-org.github.io/epg/guides/elcinema.com.guide.xml 🇬🇧 United Kingdomhttps://iptv-org.github.io/epg/guides/ontvtonight.com.guide.xml 🇺🇸 United Stateshttps://iptv-org.github.io/epg/guides/tvtv.us.guide.xml 🇿🇲 Zambiahttps://iptv-org.github.io/epg/guides/znbc.co.zm.guide.xml diff --git a/sites/elcinema.com.channels.xml b/sites/elcinema.com.channels.xml new file mode 100755 index 00000000..9eb3d2dd --- /dev/null +++ b/sites/elcinema.com.channels.xml @@ -0,0 +1,141 @@ + + + + 2M Monde + Abu Dhabi Drama + Abu Dhabi TV + Al Aoula + Al Dafrah TV + Al Hayat TV + Al Jadeed TV + Al Kahera Wal Nas + Al Kahera Wal Nas + Al Oula + Al Rasheed TV + Al Safwa + Al Sharqiya + Al Youm + Al-Manar TV + Al-Nahar Drama + Al-Nahar TV + Al-Saeedah + Alfa Series + Alfa Series +2 + Alrai TV + Alsumaria + Amman TV + ART Aflam 1 + ART Aflam 2 + ART Cinema + ART Hekayat + ART Hekayat 2 + beIN Box Office 1 + beIN Box Office 2 + beIN Drama + beIN Movies Action + beIN Movies Drama 3 + beIN Movies Family + beIN Movies Premiere + beIn Series 1 + beIn Series 2 + Cartoon Network Arabic + CBC + CBC Drama + CBC Sofra + Cima + Cinema 1 + Cinema 2 + Discovery Channel Middle East & Africa + Disney Channel Middle East + DMC + DMC Drama + Dubai One + Dubai TV + Dubai Zaman + E! Middle East + Echorouk TV + El Mehwar TV + Emarat TV + Fann + Fox Action Movies + Fox Family Movies + Fox Middle East + FX Middle East + iFilm Arabic + KTV Al Qurain + KTV Khallik Bilbait + Kuwait TV + Lana TV + Lana+ TV + LBC + LBCI + LDC + Maspero Zaman + MBC + MBC 2 + MBC 3 + MBC 4 + MBC 5 + MBC Action + MBC Bollywood + MBC Drama + MBC Drama + + MBC Iraq + MBC Masr + MBC Masr 2 + MBC Max + Mix + Mix Bel Araby + MTV + Musawa + National Geographic Middle East + National Geographic Middle East + Nessma + Nile Cinema + Nile Comedy + Nile Drama + Nile Life + On Drama + On E + OSN Action + OSN Comedy + OSN Enigma + OSN Family + OSN Kids + OSN Movies + OSN Movies First +2 + OSN Movies First +2 + OSN Series + OSN Series First + OSN Ya Hala + OSN Ya Hala Al Oula + OSN Ya Hala Cinema + Rotana Cinema + Rotana Cinema + Rotana Classic + Rotana Comedy + Rotana Drama + Rotana Khalejia + Roya TV + Sada El Balad + Sada El Balad 2 + Sada El Balad Drama + Sama Dubai + Sama TV + Saudi TV + SBC + Sharjah TV + Star Movies Middle East + Star World Middle East + Syria Drama + Syria TV + TCM Middle East + TeN TV + Thikrayat TV + TLC Arabia + UTV + Watania 1 + Zee Aflam + Zee Alwan + + \ No newline at end of file diff --git a/sites/elcinema.com.config.js b/sites/elcinema.com.config.js new file mode 100644 index 00000000..a5f864ee --- /dev/null +++ b/sites/elcinema.com.config.js @@ -0,0 +1,129 @@ +const jsdom = require('jsdom') +const { JSDOM } = jsdom +const dayjs = require('dayjs') +const utc = require('dayjs/plugin/utc') +const timezone = require('dayjs/plugin/timezone') +const customParseFormat = require('dayjs/plugin/customParseFormat') + +dayjs.extend(customParseFormat) +dayjs.extend(timezone) +dayjs.extend(utc) + +module.exports = { + lang: 'ar', + site: 'elcinema.com', + channels: 'elcinema.com.channels.xml', + output: '.gh-pages/guides/elcinema.com.guide.xml', + url({ channel }) { + return `https://elcinema.com/tvguide/${channel.site_id}/` + }, + logo({ content }) { + const dom = new JSDOM(content) + const img = dom.window.document.querySelector('.intro-box > .row > div.columns.large-2 > img') + + return img.src || null + }, + parser({ content, date }) { + const programs = [] + + const items = parseItems(content) + items.forEach(item => { + const title = parseTitle(item) + const description = parseDescription(item) + const category = parseCategory(item) + const icon = parseIcon(item) + const start = parseStart(item, date) + const duration = parseDuration(item) + const stop = start.add(duration, 'm') + + programs.push({ + title, + description, + category, + icon, + start, + stop + }) + }) + + return programs + } +} + +function parseIcon(item) { + const img = + item.querySelector('.row > div.columns.small-3.large-1 > a > img') || + item.querySelector('.row > div.columns.small-5.large-1 > img') + + return img.dataset.src || null +} + +function parseCategory(item) { + const category = ( + item.querySelector('.row > div.columns.small-6.large-3 > ul > li:nth-child(2)') || { + textContent: '' + } + ).textContent + + return category.replace(/\(\d+\)/, '').trim() +} + +function parseDuration(item) { + const duration = ( + item.querySelector('.row > div.columns.small-3.large-2 > ul > li:nth-child(2) > span') || + item.querySelector('.row > div.columns.small-7.large-11 > ul > li:nth-child(2) > span') || { + textContent: '' + } + ).textContent + + return duration.replace(/\D/g, '') +} + +function parseStart(item, initDate) { + let time = ( + item.querySelector('.row > div.columns.small-3.large-2 > ul > li:nth-child(1)') || + item.querySelector('.row > div.columns.small-7.large-11 > ul > li:nth-child(2)') || { + textContent: '' + } + ).textContent + + time = time + .replace(/\[.*\]/, '') + .replace('مساءً', 'PM') + .replace('صباحًا', 'AM') + .trim() + + time = `${initDate.format('DD/MM/YYYY')} ${time}` + + return dayjs.tz(time, 'DD/MM/YYYY H:mm A', 'Africa/Algiers') +} + +function parseTitle(item) { + return ( + item.querySelector('.row > div.columns.small-6.large-3 > ul > li:nth-child(1) > a') || + item.querySelector('.row > div.columns.small-7.large-11 > ul > li:nth-child(1)') || { + textContent: '' + } + ).textContent +} + +function parseDescription(item) { + const excerpt = ( + item.querySelector('.row > div.columns.small-12.large-6 > ul > li:nth-child(3)') || { + textContent: '' + } + ).textContent + const desc = ( + item.querySelector('.row > div.columns.small-12.large-6 > ul > li:nth-child(3) > .hide') || { + textContent: '' + } + ).textContent + + return excerpt.replace('...اقرأ المزيد', '') + desc +} + +function parseItems(content) { + const dom = new JSDOM(content) + + return dom.window.document.querySelectorAll('.tvgrid > div:nth-child(2) > .padded-half') +}