wip
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
const jsdom = require('jsdom')
|
||||
const { JSDOM } = jsdom
|
||||
const { htmlToText } = require('html-to-text')
|
||||
const dayjs = require('dayjs')
|
||||
var customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||
dayjs.extend(customParseFormat)
|
||||
|
||||
module.exports = {
|
||||
site: 'ontvtonight.com',
|
||||
lang: 'en',
|
||||
output: '../../.gh-pages/guides/ontvtonight.com.xml',
|
||||
site: 'ontvtonight.com',
|
||||
output: '.gh-pages/guides/ontvtonight.com.xml',
|
||||
url: function ({ date, channel }) {
|
||||
return `https://www.ontvtonight.com/uk/guide/listings/channel/${
|
||||
channel.site_id
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const jsdom = require('jsdom')
|
||||
const { JSDOM } = jsdom
|
||||
const parse = require('parse-duration')
|
||||
const parseDuration = require('parse-duration')
|
||||
const dayjs = require('dayjs')
|
||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||
const duration = require('dayjs/plugin/duration')
|
||||
@@ -8,9 +8,9 @@ dayjs.extend(duration)
|
||||
dayjs.extend(customParseFormat)
|
||||
|
||||
module.exports = {
|
||||
site: 'programme-tv.net',
|
||||
lang: 'fr',
|
||||
output: '../../.gh-pages/guides/programme-tv.net.xml',
|
||||
site: 'programme-tv.net',
|
||||
output: '.gh-pages/guides/programme-tv.net.xml',
|
||||
url: function ({ date, channel }) {
|
||||
return `https://www.programme-tv.net/programme/chaine/${date.format('YYYY-MM-DD')}/programme-${
|
||||
channel.site_id
|
||||
@@ -49,7 +49,7 @@ module.exports = {
|
||||
.set('M', date.get('M'))
|
||||
.set('y', date.get('y'))
|
||||
|
||||
const durationInMilliseconds = parse(durationContent)
|
||||
const durationInMilliseconds = parseDuration(durationContent)
|
||||
const stop = start.add(dayjs.duration(durationInMilliseconds))
|
||||
|
||||
programs.push({
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<site site="tv.yandex.ru">
|
||||
<channels>
|
||||
<channel site_id="1hd-99" xmltv_id="1HDMusicTelevision.ru">1 HD Music Television</channel>
|
||||
<channel site_id="2x2-29" xmltv_id="2x2.ru">2x2</channel>
|
||||
<channel site_id="360-95" xmltv_id="360deg.ru">360°</channel>
|
||||
<!-- <channel site_id="2x2-29" xmltv_id="2x2.ru">2x2</channel> -->
|
||||
<!-- <channel site_id="360-95" xmltv_id="360deg.ru">360°</channel>
|
||||
<channel site_id="365-dney-tv-470" xmltv_id="365dneyTV.ru">365 дней ТВ</channel>
|
||||
<channel site_id="7-tv-1241" xmltv_id="7TV.ru">7 TV</channel>
|
||||
<channel site_id="8-kanal-456" xmltv_id="8Kanal.ru">8 Канал</channel>
|
||||
@@ -289,6 +289,6 @@
|
||||
<channel site_id="zee-tv-627" xmltv_id="ZeeTVRussia.in">Zee TV Russia</channel>
|
||||
<channel site_id="zoo-tv-477" xmltv_id="ZooTV.ru">Зоо ТВ</channel>
|
||||
<channel site_id="zoopark-509" xmltv_id="Zoopark.ru">Zooпарк</channel>
|
||||
<channel site_id="zvezda-15" xmltv_id="Zvezda.ru">Звезда</channel>
|
||||
<channel site_id="zvezda-15" xmltv_id="Zvezda.ru">Звезда</channel> -->
|
||||
</channels>
|
||||
</site>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module.exports = {
|
||||
site: 'tv.yandex.ru',
|
||||
lang: 'ru',
|
||||
output: '../../.gh-pages/guides/tv.yandex.ru.xml',
|
||||
site: 'tv.yandex.ru',
|
||||
output: '.gh-pages/guides/tv.yandex.ru.xml',
|
||||
cookie:
|
||||
'yandexuid=8747786251615498142; Expires=Tue, 11 Mar 2031 21:29:02 GMT; Domain=yandex.ru; Path=/',
|
||||
url: function ({ date, channel }) {
|
||||
@@ -10,7 +10,8 @@ module.exports = {
|
||||
parser: function ({ channel, content, lang }) {
|
||||
const initialState = content.match(/window.__INITIAL_STATE__ = (.*);/i)
|
||||
let programs = []
|
||||
if (initialState && initialState[1]) return programs
|
||||
if (!initialState && !initialState[1]) return programs
|
||||
|
||||
const data = JSON.parse(initialState[1], null, 2)
|
||||
if (data.channel) {
|
||||
programs = data.channel.schedule.events.map(i => {
|
||||
|
||||
@@ -6,9 +6,9 @@ var customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||
dayjs.extend(customParseFormat)
|
||||
|
||||
module.exports = {
|
||||
site: 'tvguide.co.uk',
|
||||
lang: 'en',
|
||||
output: '../../.gh-pages/guides/tvguide.co.uk.xml',
|
||||
site: 'tvguide.co.uk',
|
||||
output: '.gh-pages/guides/tvguide.co.uk.xml',
|
||||
url: function ({ date, channel }) {
|
||||
return `https://www.tvguide.co.uk/mobile/channellisting.asp?ch=${channel.site_id}`
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user