From 95a417841a29f811686b9260bb0ba81d0ac76fe5 Mon Sep 17 00:00:00 2001 From: MinePlayersPE Date: Mon, 14 Jun 2021 21:34:17 +0700 Subject: [PATCH 01/11] Add vidio.com Add guides from vidio.com, for Indonesian channels. Note that there guides for international channels, but I'm not sure if I should add them too --- sites/vidio.com.channels.xml | 19 +++++++++++++ sites/vidio.com.config.js | 55 ++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 sites/vidio.com.channels.xml create mode 100644 sites/vidio.com.config.js diff --git a/sites/vidio.com.channels.xml b/sites/vidio.com.channels.xml new file mode 100644 index 00000000..5476a31d --- /dev/null +++ b/sites/vidio.com.channels.xml @@ -0,0 +1,19 @@ + + + + SCTV + Indosiar + RCTI + O Channel + Kompas TV + BeritaSatu + METRO TV + NET. + TRANS TV HD + TVRI Nasional + TRANS 7 HD + MNCTV + GTV + iNews + + \ No newline at end of file diff --git a/sites/vidio.com.config.js b/sites/vidio.com.config.js new file mode 100644 index 00000000..52da26a2 --- /dev/null +++ b/sites/vidio.com.config.js @@ -0,0 +1,55 @@ +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) +dayjs.tz.setDefault('Asia/Jakarta') + +module.exports = { + lang: 'id', + site: 'vidio.com', + channels: 'vidio.com.channels.xml', + output: '.gh-pages/guides/vidio.com.channels.xml', + url({ channel }) { + return `https://www.vidio.com/live/${channel.site_id}/schedules` + }, + parser({ content, date }) { + const programs = [] + const dom = new JSDOM(content) + if (dom.window.document.querySelector('div.livestreaming-empty-state')) return programs + + const currdate = dayjs( + dom.window.document.querySelector('div.b-livestreaming-daily-schedule__date-label').textContent, + 'DDDD, DD MMMM YYYY', 'id') + const items = dom.window.document.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('b-livestreaming-daily-schedule__item-content-caption') || { textContent: '' }).textContent + const it_date = currdate.add(JSON.parse(item.getAttribute('data-ahoy-props') || '{}').schedule_day, 'day') + + if (title && time) { + let start = dayjs(it_date.format('YYYY-MM-DD ').concat(time.substring(0,5)), 'YYYY-MM-DD HH:mm') + let stop = dayjs(it_date.format('YYYY-MM-DD ').concat(time.substring(8,13)), 'YYYY-MM-DD HH:mm') + if start.diff(stop, 'h') < 0 { + stop = stop.add(1, 'day') + } + + if (it_date.diff(date.format('YYYY-MM-DD'), 'd') === 0) { + programs.push({ + title, + start, + stop + }) + } + } + }) + + return programs + } +} From 1c7a1c989c560a7650ea7185fd5d30bd504660a7 Mon Sep 17 00:00:00 2001 From: MinePlayersPE Date: Wed, 16 Jun 2021 05:30:41 +0700 Subject: [PATCH 02/11] whoops, again --- sites/vidio.com.channels.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sites/vidio.com.channels.xml b/sites/vidio.com.channels.xml index 5476a31d..a2c26270 100644 --- a/sites/vidio.com.channels.xml +++ b/sites/vidio.com.channels.xml @@ -6,8 +6,8 @@ RCTI O Channel Kompas TV - BeritaSatu - METRO TV + BeritaSatu + METRO TV NET. TRANS TV HD TVRI Nasional @@ -16,4 +16,4 @@ GTV iNews - \ No newline at end of file + From c91733e143cf5ed950926f12a304811e8b941867 Mon Sep 17 00:00:00 2001 From: MinePlayersPE Date: Wed, 16 Jun 2021 06:42:07 +0700 Subject: [PATCH 03/11] revamp it should work now --- sites/vidio.com.config.js | 45 ++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/sites/vidio.com.config.js b/sites/vidio.com.config.js index 52da26a2..84f68428 100644 --- a/sites/vidio.com.config.js +++ b/sites/vidio.com.config.js @@ -21,33 +21,34 @@ module.exports = { parser({ content, date }) { const programs = [] const dom = new JSDOM(content) - if (dom.window.document.querySelector('div.livestreaming-empty-state')) return programs const currdate = dayjs( - dom.window.document.querySelector('div.b-livestreaming-daily-schedule__date-label').textContent, - 'DDDD, DD MMMM YYYY', 'id') - const items = dom.window.document.querySelectorAll('div.b-livestreaming-daily-schedule__item') + dom.window.document.querySelector('div.b-livestreaming-daily-schedule__date-label').textContent) + const lists = dom.window.document.querySelectorAll('div.b-livestreaming-daily-schedule__content') + lists.forEach(list => { + const listdate = currdate.add( + JSON.parse(list.querySelector('div.b-livestreaming-schedule__ahoy-impression').getAttribute('data-ahoy-props') || {}).schedule_day, 'day') - items.forEach(item => { - const title = (item.querySelector('div.b-livestreaming-daily-schedule__item-content-title') || { textContent: '' }).textContent - const time = (item.querySelector('b-livestreaming-daily-schedule__item-content-caption') || { textContent: '' }).textContent - const it_date = currdate.add(JSON.parse(item.getAttribute('data-ahoy-props') || '{}').schedule_day, 'day') + 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(listdate.format('YYYY-MM-DD ').concat(time.substring(0,5)), 'YYYY-MM-DD HH:mm') + let stop = dayjs(listdate.format('YYYY-MM-DD ').concat(time.substring(8,13)), 'YYYY-MM-DD HH:mm') + if (start.diff(stop, 'h') < 0) { + stop = stop.add(1, 'day') + } - if (title && time) { - let start = dayjs(it_date.format('YYYY-MM-DD ').concat(time.substring(0,5)), 'YYYY-MM-DD HH:mm') - let stop = dayjs(it_date.format('YYYY-MM-DD ').concat(time.substring(8,13)), 'YYYY-MM-DD HH:mm') - if start.diff(stop, 'h') < 0 { - stop = stop.add(1, 'day') + if (listdate.diff(date.format('YYYY-MM-DD'), 'd') === 0) { + programs.push({ + title, + start, + stop + }) + } } - - if (it_date.diff(date.format('YYYY-MM-DD'), 'd') === 0) { - programs.push({ - title, - start, - stop - }) - } - } + }) }) return programs From b7733f761b056e2f15095f787b08424317e07618 Mon Sep 17 00:00:00 2001 From: MinePlayersPE Date: Wed, 16 Jun 2021 16:54:08 +0700 Subject: [PATCH 04/11] Update vidio.com.config.js --- sites/vidio.com.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sites/vidio.com.config.js b/sites/vidio.com.config.js index 84f68428..1c8cd1a3 100644 --- a/sites/vidio.com.config.js +++ b/sites/vidio.com.config.js @@ -14,7 +14,7 @@ module.exports = { lang: 'id', site: 'vidio.com', channels: 'vidio.com.channels.xml', - output: '.gh-pages/guides/vidio.com.channels.xml', + output: '.gh-pages/guides/vidio.com.guide.xml', url({ channel }) { return `https://www.vidio.com/live/${channel.site_id}/schedules` }, From ac5fe18a91bccd019bedc0de95599d65851ed989 Mon Sep 17 00:00:00 2001 From: MinePlayersPE Date: Fri, 18 Jun 2021 07:59:21 +0700 Subject: [PATCH 05/11] return UTC time --- sites/vidio.com.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sites/vidio.com.config.js b/sites/vidio.com.config.js index 1c8cd1a3..d6662394 100644 --- a/sites/vidio.com.config.js +++ b/sites/vidio.com.config.js @@ -43,8 +43,8 @@ module.exports = { if (listdate.diff(date.format('YYYY-MM-DD'), 'd') === 0) { programs.push({ title, - start, - stop + start.utc(), + stop.utc() }) } } From ae36f830a56deacaaa0f7f4c38c911ff8b3c8981 Mon Sep 17 00:00:00 2001 From: MinePlayersPE Date: Mon, 21 Jun 2021 19:59:23 +0700 Subject: [PATCH 06/11] actually set utc() + fixed time overflow detection --- sites/vidio.com.config.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sites/vidio.com.config.js b/sites/vidio.com.config.js index d6662394..d2e86308 100644 --- a/sites/vidio.com.config.js +++ b/sites/vidio.com.config.js @@ -34,17 +34,17 @@ module.exports = { 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(listdate.format('YYYY-MM-DD ').concat(time.substring(0,5)), 'YYYY-MM-DD HH:mm') - let stop = dayjs(listdate.format('YYYY-MM-DD ').concat(time.substring(8,13)), 'YYYY-MM-DD HH:mm') - if (start.diff(stop, 'h') < 0) { + let start = dayjs(listdate.format('YYYY-MM-DD ').concat(time.substring(0,5)), 'YYYY-MM-DD HH:mm').utc() + let stop = dayjs(listdate.format('YYYY-MM-DD ').concat(time.substring(8,13)), 'YYYY-MM-DD HH:mm').utc() + if (start.diff(stop, 'h') > 0) { stop = stop.add(1, 'day') } if (listdate.diff(date.format('YYYY-MM-DD'), 'd') === 0) { programs.push({ title, - start.utc(), - stop.utc() + start, + stop }) } } From c88424e16dedd9c53f71313edac4d8f5350a061b Mon Sep 17 00:00:00 2001 From: MinePlayersPE Date: Mon, 21 Jun 2021 20:30:24 +0700 Subject: [PATCH 07/11] hacky way for utc time because wtf wtf --- sites/vidio.com.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sites/vidio.com.config.js b/sites/vidio.com.config.js index d2e86308..d16a00b8 100644 --- a/sites/vidio.com.config.js +++ b/sites/vidio.com.config.js @@ -34,8 +34,8 @@ module.exports = { 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(listdate.format('YYYY-MM-DD ').concat(time.substring(0,5)), 'YYYY-MM-DD HH:mm').utc() - let stop = dayjs(listdate.format('YYYY-MM-DD ').concat(time.substring(8,13)), 'YYYY-MM-DD HH:mm').utc() + let start = dayjs(listdate.format('YYYY-MM-DD ').concat(time.substring(0,5)), 'YYYY-MM-DD HH:mm').subtract(7, 'hour') + let stop = dayjs(listdate.format('YYYY-MM-DD ').concat(time.substring(8,13)), 'YYYY-MM-DD HH:mm').subtract(7, 'hour') if (start.diff(stop, 'h') > 0) { stop = stop.add(1, 'day') } From 2208f7a0d2161c790c8e7728c9319651a45ba7a9 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 21 Jun 2021 21:50:50 +0300 Subject: [PATCH 08/11] Fixes timezone issue --- sites/vidio.com.config.js | 68 +++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/sites/vidio.com.config.js b/sites/vidio.com.config.js index d16a00b8..56b16d64 100644 --- a/sites/vidio.com.config.js +++ b/sites/vidio.com.config.js @@ -8,7 +8,6 @@ const timezone = require('dayjs/plugin/timezone') dayjs.extend(utc) dayjs.extend(customParseFormat) dayjs.extend(timezone) -dayjs.tz.setDefault('Asia/Jakarta') module.exports = { lang: 'id', @@ -22,33 +21,48 @@ module.exports = { const programs = [] const dom = new JSDOM(content) - const currdate = dayjs( - dom.window.document.querySelector('div.b-livestreaming-daily-schedule__date-label').textContent) - const lists = dom.window.document.querySelectorAll('div.b-livestreaming-daily-schedule__content') - lists.forEach(list => { - const listdate = currdate.add( - JSON.parse(list.querySelector('div.b-livestreaming-schedule__ahoy-impression').getAttribute('data-ahoy-props') || {}).schedule_day, 'day') - - 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(listdate.format('YYYY-MM-DD ').concat(time.substring(0,5)), 'YYYY-MM-DD HH:mm').subtract(7, 'hour') - let stop = dayjs(listdate.format('YYYY-MM-DD ').concat(time.substring(8,13)), 'YYYY-MM-DD HH:mm').subtract(7, 'hour') - if (start.diff(stop, 'h') > 0) { - stop = stop.add(1, 'day') - } - - if (listdate.diff(date.format('YYYY-MM-DD'), 'd') === 0) { - programs.push({ - title, - start, - stop - }) - } + 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 From a664b295a378ccb1ed0b9cf3e233850018ea876b Mon Sep 17 00:00:00 2001 From: MinePlayersPE Date: Thu, 24 Jun 2021 08:57:40 +0700 Subject: [PATCH 09/11] Add more Vidio channel guides... ...with some degree of guessing and omission. (i.e. why are there so many variant names for arirang 1? https://github.com/iptv-org/iptv/blob/master/channels/kr.m3u#L14-L33 ) --- sites/vidio.com.channels.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sites/vidio.com.channels.xml b/sites/vidio.com.channels.xml index a2c26270..a83a6e74 100644 --- a/sites/vidio.com.channels.xml +++ b/sites/vidio.com.channels.xml @@ -15,5 +15,17 @@ 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 From 5a2fca797a16d5fbf51c9a800ba4471db7e1dcb4 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Thu, 24 Jun 2021 17:01:58 +0300 Subject: [PATCH 10/11] Update auto-update.yml --- .github/workflows/auto-update.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From e7a175246a2dcf1e925704f14abb7098f47e26a3 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Thu, 24 Jun 2021 17:02:02 +0300 Subject: [PATCH 11/11] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) 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