diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 5d0fb960..99411305 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -34,7 +34,8 @@ jobs: tv.yandex.ru, tvtv.ca, tvtv.us, - tv.lv + tv.lv, + vidio.com ] steps: - name: Checkout diff --git a/README.md b/README.md index ac42a3a8..fa8767c7 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ To load a program guide, all you need to do is copy the link to one of the guide 🇬🇷 Greecehttps://iptv-org.github.io/epg/guides/cosmote.gr.guide.xml 🇬🇹 Guatemalahttps://iptv-org.github.io/epg/guides/mi.tv.guide.xml 🇭🇳 Hondurashttps://iptv-org.github.io/epg/guides/mi.tv.guide.xml + 🇮🇩 Indonesiahttps://iptv-org.github.io/epg/guides/vidio.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 🇰🇿 Kazakhstanhttps://iptv-org.github.io/epg/guides/tv.yandex.ru.guide.xml diff --git a/sites/vidio.com.channels.xml b/sites/vidio.com.channels.xml new file mode 100644 index 00000000..a83a6e74 --- /dev/null +++ b/sites/vidio.com.channels.xml @@ -0,0 +1,31 @@ + + + + SCTV + Indosiar + RCTI + O Channel + Kompas TV + BeritaSatu + METRO TV + NET. + TRANS TV HD + TVRI Nasional + TRANS 7 HD + MNCTV + GTV + iNews + Fox Sports Asia + beIN Sports 1 Asia + Fox Sports 2 Asia + Fox Sports 3 Asia + Arirang TV + Zee Bioskop + CNA + Al Jazeera English + Euronews + DW English + ABC TV + Smithsonian Channel Asia + + diff --git a/sites/vidio.com.config.js b/sites/vidio.com.config.js new file mode 100644 index 00000000..56b16d64 --- /dev/null +++ b/sites/vidio.com.config.js @@ -0,0 +1,70 @@ +const jsdom = require('jsdom') +const { JSDOM } = jsdom +const dayjs = require('dayjs') +const utc = require('dayjs/plugin/utc') +const customParseFormat = require('dayjs/plugin/customParseFormat') +const timezone = require('dayjs/plugin/timezone') + +dayjs.extend(utc) +dayjs.extend(customParseFormat) +dayjs.extend(timezone) + +module.exports = { + lang: 'id', + site: 'vidio.com', + channels: 'vidio.com.channels.xml', + output: '.gh-pages/guides/vidio.com.guide.xml', + url({ channel }) { + return `https://www.vidio.com/live/${channel.site_id}/schedules` + }, + parser({ content, date }) { + const programs = [] + const dom = new JSDOM(content) + + const scheduleDate = dom.window.document.querySelector( + 'div.b-livestreaming-daily-schedule__date-label' + ).textContent + const currdate = dayjs(scheduleDate) + const list = dom.window.document.querySelector( + `#schedule-content-${currdate.format( + 'YYYYMMDD' + )} > .b-livestreaming-daily-schedule__scroll-container` + ) + const items = list.querySelectorAll('div.b-livestreaming-daily-schedule__item') + items.forEach(item => { + const title = ( + item.querySelector('div.b-livestreaming-daily-schedule__item-content-title') || { + textContent: '' + } + ).textContent + const time = ( + item.querySelector('div.b-livestreaming-daily-schedule__item-content-caption') || { + textContent: '' + } + ).textContent + if (title && time) { + let start = dayjs.tz( + currdate.format('YYYY-MM-DD ').concat(time.substring(0, 5)), + 'YYYY-MM-DD HH:mm', + 'Asia/Jakarta' + ) + let stop = dayjs.tz( + currdate.format('YYYY-MM-DD ').concat(time.substring(8, 13)), + 'YYYY-MM-DD HH:mm', + 'Asia/Jakarta' + ) + if (start.diff(stop, 'h') > 0) { + stop = stop.add(1, 'day') + } + + programs.push({ + title, + start, + stop + }) + } + }) + + return programs + } +}