mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-11 01:20:08 -04:00
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
This commit is contained in:
parent
0e6b2d1cb2
commit
95a417841a
2 changed files with 74 additions and 0 deletions
19
sites/vidio.com.channels.xml
Normal file
19
sites/vidio.com.channels.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<site site="vidio.com">
|
||||
<channels>
|
||||
<channel site_id="204" xmltv_id="SCTV.id">SCTV</channel>
|
||||
<channel site_id="205" xmltv_id="Indosiar.id">Indosiar</channel>
|
||||
<channel site_id="665" xmltv_id="RCTI.id">RCTI</channel>
|
||||
<channel site_id="206" xmltv_id="OChannel.id">O Channel</channel>
|
||||
<channel site_id="874" xmltv_id="KompasTV.id">Kompas TV</channel>
|
||||
<channel site_id="6165" xmltv_id="KompasTV.id">BeritaSatu</channel>
|
||||
<channel site_id="777" xmltv_id="BeritaSatu.id">METRO TV</channel>
|
||||
<channel site_id="875" xmltv_id="NET.id">NET.</channel>
|
||||
<channel site_id="733" xmltv_id="TRANSTVHD.id">TRANS TV HD</channel>
|
||||
<channel site_id="6441" xmltv_id="TVRINasional.id">TVRI Nasional</channel>
|
||||
<channel site_id="734" xmltv_id="TRANS7HD.id">TRANS 7 HD</channel>
|
||||
<channel site_id="870" xmltv_id="MNCTV.id">MNCTV</channel>
|
||||
<channel site_id="778" xmltv_id="GTV.id">GTV</channel>
|
||||
<channel site_id="5409" xmltv_id="iNews.id">iNews</channel>
|
||||
</channels>
|
||||
</site>
|
55
sites/vidio.com.config.js
Normal file
55
sites/vidio.com.config.js
Normal file
|
@ -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
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue