From f20b5254111c993fa155f64421d9147331f0fd4c Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Fri, 1 Dec 2023 13:38:48 +0300 Subject: [PATCH] Update tvhebdo.com --- sites/tvhebdo.com/readme.md | 21 ++++ sites/tvhebdo.com/tvhebdo.com.channels.xml | 131 +++++++++++++++++---- sites/tvhebdo.com/tvhebdo.com.config.js | 13 +- sites/tvhebdo.com/tvhebdo.com.test.js | 3 - 4 files changed, 137 insertions(+), 31 deletions(-) create mode 100644 sites/tvhebdo.com/readme.md diff --git a/sites/tvhebdo.com/readme.md b/sites/tvhebdo.com/readme.md new file mode 100644 index 00000000..d8dcf382 --- /dev/null +++ b/sites/tvhebdo.com/readme.md @@ -0,0 +1,21 @@ +# tvhebdo.com + +https://www.tvhebdo.com/ + +### Download the guide + +```sh +npm run grab -- --site=tvhebdo.com +``` + +### Update channel list + +```sh +npm run channels:parse -- --config=./sites/tvhebdo.com/tvhebdo.com.config.js --output=./sites/tvhebdo.com/tvhebdo.com.channels.xml +``` + +### Test + +```sh +npm test -- tvhebdo.com +``` diff --git a/sites/tvhebdo.com/tvhebdo.com.channels.xml b/sites/tvhebdo.com/tvhebdo.com.channels.xml index 5c3601a6..c96df452 100644 --- a/sites/tvhebdo.com/tvhebdo.com.channels.xml +++ b/sites/tvhebdo.com/tvhebdo.com.channels.xml @@ -1,7 +1,108 @@ - CPAC English + 2M SPARK addikTV @@ -15,8 +116,6 @@ Animal Planet Aboriginal Peoples Television Network Art America - Assemblée Nationale - ASIAN TELEVISION NETWORK AZ Mundo BBC Earth BBC World @@ -27,7 +126,6 @@ D Canal Vie Caracol TV - Cartoon Network SD CASA CBC News Network CBFT @@ -39,7 +137,6 @@ CFCF Omni 1 CFTM - Savm CHAN TFO CICA @@ -80,7 +177,6 @@ STAR! Elle Fictions SD ERT World OTN2 - ESPN classics Euronews Évasion EWTN @@ -93,14 +189,13 @@ FOX Sports Racing Festival Portuguese Television France 24 - Frissons TV + Frissons TV SD FX Canada FXX SD GAME SHOW NETWORK GAME TV Super Channel 4 GOLF - Haïti HD HBO HGTV Historia @@ -122,11 +217,8 @@ LCN LIFETIME SD Oasis HD - DIY MAMTL MAX SD - MBC (USA) - MBCM (Masr) Mediaset Italia METEO Mezzo @@ -153,18 +245,17 @@ Hard Prise 2 RAI News - RDS RDS2 + RDS RDS Info - REVT + REV Rewind Saint-Pierre-et-Miquelon - Saisons + Saisons SD Salt + Light TV Séries Plus SHOW Silver Screen Classics - SkyNews HD Slice Sportsman Canada The Score @@ -189,27 +280,26 @@ TLN Ninos TOONF TGCOM 24 - The Shopping Channel WTHR TLC TLAT Travel & Escape TREE + The Shopping Channel TSN1 TSN2 TSN3 TSN4 TSN (5) TV5 - TVA Sports TVA Sports 2 + TVA Sports Tv Chile international TVE1 RAI Nettuno Sat Uno UNIS Univision Canada VISION - Vrak TV WCAX WCFE WETK @@ -217,11 +307,8 @@ WFFF WGN TV 9 WGN9 HD - CHRGD SD Wild WTN - Peachtree HD - WPCH-TV WPIX WPTZ WSBK @@ -229,7 +316,5 @@ WWE YOOPA YTV - Z Zeste - Z HD diff --git a/sites/tvhebdo.com/tvhebdo.com.config.js b/sites/tvhebdo.com/tvhebdo.com.config.js index 17bb5586..be4cf8b4 100644 --- a/sites/tvhebdo.com/tvhebdo.com.config.js +++ b/sites/tvhebdo.com/tvhebdo.com.config.js @@ -34,6 +34,8 @@ module.exports = { return programs }, async channels() { + const _ = require('lodash') + let items = [] const offsets = [ 0, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 320, 340, 360 @@ -55,21 +57,22 @@ module.exports = { items = items.concat(rows) } - console.log(`Found ${items.length} channels`) - - return items.map(item => { + let channels = [] + items.forEach(item => { const $item = cheerio.load(item) const name = $item('.gr_row_head > div > a.gr_row_head_logo.link_to_station > img').attr( 'alt' ) const url = $item('.gr_row_head > div > div.gr_row_head_poste > a').attr('href') const [, site_id] = url.match(/horaire-tele\/(.*)/) || [null, null] - return { + channels.push({ lang: 'fr', site_id, name - } + }) }) + + return _.uniqBy(channels, 'site_id') } } diff --git a/sites/tvhebdo.com/tvhebdo.com.test.js b/sites/tvhebdo.com/tvhebdo.com.test.js index 4bf559a2..550ec8e0 100644 --- a/sites/tvhebdo.com/tvhebdo.com.test.js +++ b/sites/tvhebdo.com/tvhebdo.com.test.js @@ -1,6 +1,3 @@ -// npm run channels:parse -- --config=./sites/tvhebdo.com/tvhebdo.com.config.js --output=./sites/tvhebdo.com/tvhebdo.com.channels.xml -// npm run grab -- --site=tvhebdo.com - const { parser, url } = require('./tvhebdo.com.config.js') const fs = require('fs') const path = require('path')