diff --git a/SITES.md b/SITES.md index 28cf665e..3e20036f 100644 --- a/SITES.md +++ b/SITES.md @@ -26,6 +26,7 @@ | [comteco.com.bo](sites/comteco.com.bo) | 🟡 | https://github.com/iptv-org/epg/issues/2239 | | [cosmote.gr](sites/cosmote.gr) | 🟢 | | | [cubmu.com](sites/cubmu.com) | 🟢 | | +| [dens.tv](sites/dens.tv) | 🟢 | | | [digiturk.com.tr](sites/digiturk.com.tr) | 🟢 | | | [directv.com](sites/directv.com) | 🟢 | | | [directv.com.ar](sites/directv.com.ar) | 🟡 | https://github.com/iptv-org/epg/issues/2248 | diff --git a/sites/dens.tv/dens.tv.channels.xml b/sites/dens.tv/dens.tv.channels.xml index 5117cd0e..7af3c474 100644 --- a/sites/dens.tv/dens.tv.channels.xml +++ b/sites/dens.tv/dens.tv.channels.xml @@ -1,34 +1,35 @@ - - antv + Dance TV + --> Al Jazeera Arabic Al Jazeera English Quran TV Sunna TV ANIPLUS HD + antv BTV CCM (Celestial Classic MV) CCTV-4 - CGTN Documentary - CNA Celestial Movies HD + CGTN Documentary CinemaWorld HD + CNA DAAI TV - DW-TV - Deluxe Lounge HD + Deluxe Lounge DensFood Channel - DensLearning & Knowledge + DensKnowledge DensLife & Style DensPlay DensShowBiz + DW-TV Elshinta TV FIGHT SPORTS HD France 24 @@ -37,8 +38,8 @@ HorizonSports Jak tv KIX HD - K-PLUS HD Kompas TV + K-PLUS HD Magna Channel Metro TV Motorvision+ @@ -47,22 +48,23 @@ My Cinema Europe HD My Family Channel My Kidz HD - NET. - NHK WORLD-JAPAN NaDoo Commerce NaDooKorean + NET. + NHK WORLD-JAPAN + RTV ROCK Action ROCK Entertainment HD RodjaTV Stingray Classica + Thrill TRT World TV5MONDE ASIE TV5MONDE Style HD - TVRI - TVRI Sport - Thrill - WION tvN HD tvN Movies HD tvOne + TVRI + TVRI Sport + WION diff --git a/sites/dens.tv/dens.tv.config.js b/sites/dens.tv/dens.tv.config.js index abf94251..2f8fa29e 100644 --- a/sites/dens.tv/dens.tv.config.js +++ b/sites/dens.tv/dens.tv.config.js @@ -10,22 +10,17 @@ dayjs.extend(customParseFormat) module.exports = { site: 'dens.tv', days: 2, - url: function ({ channel, date }) { + url({ channel, date }) { return `https://www.dens.tv/tvpage_octo/epgchannel2/${date.format('YYYY-MM-DD')}/${ channel.site_id }` }, - parser: function ({ content }) { + parser({ content }) { // parsing const response = JSON.parse(content) const programs = [] - if ( - response.response !== undefined && - response.response === 0 && - response.data !== undefined && - Array.isArray(response.data) - ) { + if (Array.isArray(response?.data)) { response.data.forEach(item => { programs.push({ title: item.title, @@ -46,14 +41,14 @@ module.exports = { international: 3 } - let channels = [] + const channels = [] for (const id_category of Object.values(categories)) { const data = await axios .get(`https://www.dens.tv/api/dens3/tv/TvChannels/listByCategory`, { params: { id_category } }) .then(r => r.data) - .catch(console.log) + .catch(console.error) data.data.contents.forEach(item => { channels.push({ diff --git a/sites/dens.tv/dens.tv.test.js b/sites/dens.tv/dens.tv.test.js index c2f80910..7824b998 100644 --- a/sites/dens.tv/dens.tv.test.js +++ b/sites/dens.tv/dens.tv.test.js @@ -1,14 +1,12 @@ -// npm run channels:parse -- --config=./sites/dens.tv/dens.tv.config.js --output=./sites/dens.tv/dens.tv.channels.xml -// npm run grab -- --site=dens.tv - const { url, parser } = require('./dens.tv.config.js') const fs = require('fs') const path = require('path') const dayjs = require('dayjs') const utc = require('dayjs/plugin/utc') + dayjs.extend(utc) -const date = dayjs.utc('2023-11-10', 'YYYY-MM-DD').startOf('d') +const date = dayjs.utc('2023-11-10').startOf('d') const channel = { site_id: '6', xmltv_id: 'MetroTV.id', lang: 'id' } it('can generate valid url', () => { diff --git a/sites/dens.tv/readme.md b/sites/dens.tv/readme.md new file mode 100644 index 00000000..1723d7f1 --- /dev/null +++ b/sites/dens.tv/readme.md @@ -0,0 +1,21 @@ +# dens.tv + +https://www.dens.tv/ + +### Download the guide + +```sh +npm run grab -- --site=dens.tv +``` + +### Update channel list + +```sh +npm run channels:parse -- --config=sites/dens.tv/dens.tv.config.js --output=sites/dens.tv/dens.tv.channels.xml +``` + +### Test + +```sh +npm test -- dens.tv +```