Move sites into a folders
This commit is contained in:
87
sites/vidio.com/vidio.com.config.js
Normal file
87
sites/vidio.com/vidio.com.config.js
Normal file
@@ -0,0 +1,87 @@
|
||||
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 = {
|
||||
site: 'vidio.com',
|
||||
url({ channel }) {
|
||||
return `https://www.vidio.com/live/${channel.site_id}/schedules`
|
||||
},
|
||||
parser({ content, date }) {
|
||||
let PM = false
|
||||
const programs = []
|
||||
const items = parseItems(content, date)
|
||||
items.forEach(item => {
|
||||
const title = parseTitle(item)
|
||||
const start = parseStart(item, date)
|
||||
let stop = parseStop(item, date)
|
||||
if (!stop) return
|
||||
if (stop.hour() > 11) PM = true
|
||||
if (stop.hour() < 12 && PM) stop = stop.add(1, 'd')
|
||||
|
||||
programs.push({
|
||||
title,
|
||||
start,
|
||||
stop
|
||||
})
|
||||
})
|
||||
|
||||
return programs
|
||||
}
|
||||
}
|
||||
|
||||
function parseStop(item, date) {
|
||||
const time = (
|
||||
item.querySelector('div.b-livestreaming-daily-schedule__item-content-caption') || {
|
||||
textContent: ''
|
||||
}
|
||||
).textContent
|
||||
|
||||
return dayjs.tz(
|
||||
date.format('YYYY-MM-DD ').concat(time.substring(8, 13)),
|
||||
'YYYY-MM-DD HH:mm',
|
||||
'Asia/Jakarta'
|
||||
)
|
||||
}
|
||||
|
||||
function parseStart(item, date) {
|
||||
const time = (
|
||||
item.querySelector('div.b-livestreaming-daily-schedule__item-content-caption') || {
|
||||
textContent: ''
|
||||
}
|
||||
).textContent
|
||||
|
||||
return dayjs.tz(
|
||||
date.format('YYYY-MM-DD ').concat(time.substring(0, 5)),
|
||||
'YYYY-MM-DD HH:mm',
|
||||
'Asia/Jakarta'
|
||||
)
|
||||
}
|
||||
|
||||
function parseTitle(item) {
|
||||
return (
|
||||
item.querySelector('div.b-livestreaming-daily-schedule__item-content-title') || {
|
||||
textContent: ''
|
||||
}
|
||||
).textContent
|
||||
}
|
||||
|
||||
function parseItems(content, date) {
|
||||
const dom = new JSDOM(content)
|
||||
const list = dom.window.document.querySelector(
|
||||
`#schedule-content-${date.format(
|
||||
'YYYYMMDD'
|
||||
)} > .b-livestreaming-daily-schedule__scroll-container`
|
||||
)
|
||||
|
||||
if (!list) return []
|
||||
|
||||
return list.querySelectorAll('div.b-livestreaming-daily-schedule__item')
|
||||
}
|
||||
35
sites/vidio.com/vidio.com_id.channels.xml
Normal file
35
sites/vidio.com/vidio.com_id.channels.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<site site="vidio.com">
|
||||
<channels>
|
||||
<channel lang="id" xmltv_id="AjwaTV.id" site_id="7464">Ajwa TV</channel>
|
||||
<channel lang="id" xmltv_id="AljazeeraEnglish.qa" site_id="6410">Aljazeera English</channel>
|
||||
<channel lang="id" xmltv_id="ArirangWorld.kr" site_id="6784">Arirang World</channel>
|
||||
<channel lang="id" xmltv_id="BeInSports1Indonesia.qa" site_id="6299">BeIn Sports 1 Indonesia</channel>
|
||||
<channel lang="id" xmltv_id="BeInSports2Indonesia.qa" site_id="6317">BeIn Sports 2 Indonesia</channel>
|
||||
<channel lang="id" xmltv_id="BeritaSatuHD.id" site_id="6165">Berita Satu HD</channel>
|
||||
<channel lang="id" xmltv_id="ChampionsTV1.id" site_id="6685">Champions TV 1</channel>
|
||||
<channel lang="id" xmltv_id="ChampionsTV2.id" site_id="6686">Champions TV 2</channel>
|
||||
<channel lang="id" xmltv_id="ChampionsTV3.id" site_id="6786">Champions TV 3</channel>
|
||||
<channel lang="id" xmltv_id="CNA.sg" site_id="6411">CNA</channel>
|
||||
<channel lang="id" xmltv_id="DaAiTV.tw" site_id="6482">Da Ai TV</channel>
|
||||
<channel lang="id" xmltv_id="DWEnglish.de" site_id="5075">DW English</channel>
|
||||
<channel lang="id" xmltv_id="EuroNewsEnglish.fr" site_id="6412">EuroNews English</channel>
|
||||
<channel lang="id" xmltv_id="GTV.id" site_id="778">GTV</channel>
|
||||
<channel lang="id" xmltv_id="Indosiar.id" site_id="205">Indosiar</channel>
|
||||
<channel lang="id" xmltv_id="INews.id" site_id="5409">INews</channel>
|
||||
<channel lang="id" xmltv_id="JakTV.id" site_id="5415">Jak TV</channel>
|
||||
<channel lang="id" xmltv_id="KompasTV.id" site_id="874">Kompas TV</channel>
|
||||
<channel lang="id" xmltv_id="MetroTV.id" site_id="777">Metro TV</channel>
|
||||
<channel lang="id" xmltv_id="MNCTV.id" site_id="870">MNC TV</channel>
|
||||
<channel lang="id" xmltv_id="MyTV.id" site_id="6711">My TV</channel>
|
||||
<channel lang="id" xmltv_id="NET.id" site_id="875">NET</channel>
|
||||
<channel lang="id" xmltv_id="Nusantara.id" site_id="7432">Nusantara</channel>
|
||||
<channel lang="id" xmltv_id="OChannel.id" site_id="206">O Channel</channel>
|
||||
<channel lang="id" xmltv_id="RCTI.id" site_id="665">RCTI</channel>
|
||||
<channel lang="id" xmltv_id="SCTV.id" site_id="204">SCTV</channel>
|
||||
<channel lang="id" xmltv_id="Trans7.id" site_id="734">Trans 7</channel>
|
||||
<channel lang="id" xmltv_id="TransTV.id" site_id="733">Trans TV</channel>
|
||||
<channel lang="id" xmltv_id="TVRINasional.id" site_id="6441">TVRI Nasional</channel>
|
||||
<channel lang="id" xmltv_id="ZeeBioskop.in" site_id="6399">Zee Bioskop</channel>
|
||||
</channels>
|
||||
</site>
|
||||
Reference in New Issue
Block a user