diff --git a/sites/vidio.com/vidio.com.channels.xml b/sites/vidio.com/vidio.com.channels.xml index ec55371c..c14ffa10 100644 --- a/sites/vidio.com/vidio.com.channels.xml +++ b/sites/vidio.com/vidio.com.channels.xml @@ -1,16 +1,7 @@ - Prambors On Air - TRAX - ELGANGGA - Geronimo - SWARA SEMARANG - GAJAHMADA - MUSICA - Metro Globe Network - World Cup 1 - World Cup 2 ABC Australia + AFRICANEWS TV AJWA TV Aljazeera ANTV @@ -18,16 +9,17 @@ Bein 1 Bein 3 BTV - CTV 1 - CTV 2 - CTV 3 - CTV 5 - CTV 6 + Champions TV 1 + Champions TV 2 + Champions TV 3 + Champions TV 5 + Champions TV 6 Premier League TV News Asia DAAI TV DW English Elshinta TV + Euro News Fashion TV - Global FashionTV L'Original Fashion TV Midnight Secrets @@ -35,13 +27,13 @@ Horee Indosiar Jaktv - JPM TV + jawaposTV JTV Kompas TV - Liverpool TV Magna TV Makkah TV Mentari TV + Metro Globe Network Metro TV Moji NBA TV @@ -54,15 +46,17 @@ ROCK Entertainment Rock Action SCTV - SPOTV + SEA TODAY SPOTV 2 + SPOTV Tawaf TV Trans7 TRANS TV + TV5Monde TVN TVOne TVRI + TV Tempo U-Channel TV - Zee Bioskop Zoomoo diff --git a/sites/vidio.com/vidio.com.config.js b/sites/vidio.com/vidio.com.config.js index 5661a27b..a4b4fcc5 100644 --- a/sites/vidio.com/vidio.com.config.js +++ b/sites/vidio.com/vidio.com.config.js @@ -41,23 +41,30 @@ module.exports = { .catch(console.error) const $ = cheerio.load(result) - const items = $('.home-content a').toArray() + const itemGroups = $('.home-content').toArray() const channels = [] - items.forEach(item => { - const $item = $(item) + const processedIds = [] - const name = $item.find('p').text() - if (name.toUpperCase().indexOf('FM') < 0 && name.toUpperCase().indexOf('RADIO') < 0) { - channels.push({ - lang: 'id', - site_id: $item.attr('href').substr($item.attr('href').lastIndexOf('/') + 1).split('-')[0], - name - }) + itemGroups.forEach(group => { + const $group = $(group) + const props = $group.data('ahoy-props') + const name = props.content_title + const siteId = props.content_id + + if (props.section.includes('Radio') || processedIds.includes(siteId)) { + return } + + channels.push({ + lang: 'id', + site_id: siteId, + name: name + }) + processedIds.push(siteId) }) return channels - } + } } function parseStart($item, date) {