Added guide from mediaset.it

This commit is contained in:
freearhey 2021-03-18 20:30:05 +03:00
parent 6e50884c01
commit 3558087a40
3 changed files with 72 additions and 0 deletions

View File

@ -13,6 +13,7 @@ To load a program guide, all you need to do is copy the link to one of the guide
<tbody>
<tr><td align="left" nowrap>ontvtonight.com</td><td align="right">en</td><td align="right">122</td><td align="left" nowrap><code>https://iptv-org.github.io/epg/guides/ontvtonight.com.guide.xml</code></td></tr>
<tr><td align="left" nowrap>programme-tv.net</td><td align="right">fr</td><td align="right">266</td><td align="left" nowrap><code>https://iptv-org.github.io/epg/guides/programme-tv.net.guide.xml</code></td></tr>
<tr><td align="left" nowrap>mediaset.it</td><td align="right">it</td><td align="right">16</td><td align="left" nowrap><code>https://iptv-org.github.io/epg/guides/mediaset.it.guide.xml</code></td></tr>
<tr><td align="left" nowrap>tv.yandex.ru</td><td align="right">ru</td><td align="right">378</td><td align="left" nowrap><code>https://iptv-org.github.io/epg/guides/tv.yandex.ru.guide.xml</code></td></tr>
</tbody>
</table>

21
sites/mediaset.it.channels.xml Executable file
View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<site site="mediaset.it">
<channels>
<channel site_id="C5" xmltv_id="Canale5.it">Canale 5</channel>
<channel site_id="FU" xmltv_id="Focus.it">Focus</channel>
<channel site_id="I1" xmltv_id="Italia1.it">Italia 1</channel>
<channel site_id="I2" xmltv_id="Italia2.it">Italia 2</channel>
<channel site_id="KA" xmltv_id="La5.it">La 5</channel>
<channel site_id="KB" xmltv_id="BoingItalia.it">Boing Italia</channel>
<channel site_id="KD" xmltv_id="Mya.it">Mya</channel>
<channel site_id="KI" xmltv_id="Iris.it">Iris</channel>
<channel site_id="KQ" xmltv_id="MediasetExtra.it">Mediaset Extra</channel>
<channel site_id="KS" xmltv_id="PremiumAction.it">Premium Action</channel>
<channel site_id="LA" xmltv_id="CartoonitoItalia.us">Cartoonito Italia</channel>
<channel site_id="LB" xmltv_id="20Mediaset.it">20 Mediaset</channel>
<channel site_id="LR" xmltv_id="PremiumCrime.it">Premium Crime</channel>
<channel site_id="LT" xmltv_id="TopCrime.it">Top Crime</channel>
<channel site_id="R4" xmltv_id="Rete4.it">Rete 4</channel>
<channel site_id="TG24" xmltv_id="TGCOM24.it">TGCOM24</channel>
</channels>
</site>

View File

@ -0,0 +1,50 @@
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
dayjs.extend(utc)
dayjs.extend(customParseFormat)
module.exports = {
lang: 'it',
site: 'mediaset.it',
channels: 'mediaset.it.channels.xml',
output: '.gh-pages/guides/mediaset.it.guide.xml',
url: function ({ date, channel }) {
return `http://www.mediaset.it/guidatv/inc/canali/${date.format('YYYYMM')}/${date.format(
'YYYYMMDD'
)}_${channel.site_id}.sjson`
},
parser: function ({ content, date }) {
const programs = []
if (!content.events) return programs
content.events.forEach(item => {
if (item.title && item.startTime && item.endTime) {
const start = dayjs
.utc(item.startTime, 'HH:mm')
.set('D', date.get('D'))
.set('M', date.get('M'))
.set('y', date.get('y'))
.toString()
const stop = dayjs
.utc(item.endTime, 'HH:mm')
.set('D', date.get('D'))
.set('M', date.get('M'))
.set('y', date.get('y'))
.toString()
programs.push({
title: item.displayTitle || item.title,
description: item.description,
category: item.genere,
start,
stop
})
}
})
return programs
}
}