diff --git a/sites/tivu.tv/readme.md b/sites/tivu.tv/readme.md new file mode 100644 index 00000000..6b2e27d6 --- /dev/null +++ b/sites/tivu.tv/readme.md @@ -0,0 +1,21 @@ +# tivu.tv + +https://www.tivu.tv/ + +### Download the guide + +```sh +npm run grab -- --site=tivu.tv +``` + +### Update channel list + +```sh +npm run channels:parse -- --config=./sites/tivu.tv/tivu.tv.config.js --output=./sites/tivu.tv/tivu.tv.channels.xml +``` + +### Test + +```sh +npm test -- tivu.tv +``` diff --git a/sites/tivu.tv/tivu.tv.channels.xml b/sites/tivu.tv/tivu.tv.channels.xml index 545e25fd..d2d63a1d 100644 --- a/sites/tivu.tv/tivu.tv.channels.xml +++ b/sites/tivu.tv/tivu.tv.channels.xml @@ -1,7 +1,8 @@ + 20 Mediaset - 27 Al Jazeera BBC World News Bloomberg European TV @@ -20,7 +21,7 @@ France 24 HD (en Français) frisbee GIALLO - Gold TV + HGTV Horse TV Iris @@ -46,29 +47,30 @@ Rai 2 Rai 3 Rai 4 - Rai 4K + Rai 5 Rai Gulp Rai Movie Rai News 24 - Rai Premium - Rai Scuola Rai Sport Rai Storia - Rai yoyo + Rai yoyo RDS Social TV Real Time Rete 4 RTL 102.5 - Solocalcio + Super! TgCom24 Topcrime Travel XP TRM h24 - TRT World HD + TV2000 TV8 + 27 VH1 - Warner TV + Warner TV Italy + Zona DAZN + Zona DAZN 2 diff --git a/sites/tivu.tv/tivu.tv.config.js b/sites/tivu.tv/tivu.tv.config.js index 8f16d2d4..7849be39 100644 --- a/sites/tivu.tv/tivu.tv.config.js +++ b/sites/tivu.tv/tivu.tv.config.js @@ -38,6 +38,31 @@ module.exports = { }) return programs + }, + async channels() { + const axios = require('axios') + const html = await axios + .get('https://www.tivu.tv/epg_ajax_sat.aspx?d=0') + .then(r => r.data) + .catch(console.log) + + let channels = [] + + const $ = cheerio.load(html) + $('.q').each((i, el) => { + const site_id = $(el).attr('id') + const name = $(el).find('a').first().data('channel') + + if (!name) return + + channels.push({ + lang: 'it', + site_id, + name + }) + }) + + return channels } } diff --git a/sites/tivu.tv/tivu.tv.test.js b/sites/tivu.tv/tivu.tv.test.js index 47ed98e9..b243072a 100644 --- a/sites/tivu.tv/tivu.tv.test.js +++ b/sites/tivu.tv/tivu.tv.test.js @@ -1,5 +1,3 @@ -// npm run grab -- --site=tivu.tv - const { parser, url } = require('./tivu.tv.config.js') const fs = require('fs') const path = require('path')