From 8300d81575c4a8be4d9a6fbf31aa4330bde6928a Mon Sep 17 00:00:00 2001 From: freearhey Date: Wed, 21 Apr 2021 15:57:21 +0300 Subject: [PATCH] Added guide from comteco.com.bo --- .github/workflows/auto-update.yml | 15 ++++++ README.md | 1 + sites/comteco.com.bo.channels.xml | 87 +++++++++++++++++++++++++++++++ sites/comteco.com.bo.config.js | 64 +++++++++++++++++++++++ 4 files changed, 167 insertions(+) create mode 100755 sites/comteco.com.bo.channels.xml create mode 100644 sites/comteco.com.bo.config.js diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 25a22299..604a7091 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -4,6 +4,21 @@ on: schedule: - cron: '0 0 * * *' jobs: + comteco_com_bo: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2.3.1 + - name: Install Dependencies + run: npm install + - name: Run EPG Grabber + run: npx epg-grabber --config=sites/comteco.com.bo.config.js + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@4.1.1 + with: + branch: gh-pages + folder: .gh-pages + clean: false albepg_com: runs-on: ubuntu-latest steps: diff --git a/README.md b/README.md index a3cc21ca..32b42df6 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ To load a program guide, all you need to do is copy the link to one of the guide 🇦🇷 Argentinahttps://iptv-org.github.io/epg/guides/mi.tv.guide.xml 🇦🇺 Australiahttps://iptv-org.github.io/epg/guides/ontvtonight.com.guide.xml 🇧🇾 Belarushttps://iptv-org.github.io/epg/guides/tv.yandex.ru.guide.xml + 🇧🇴 Boliviahttps://iptv-org.github.io/epg/guides/comteco.com.bo.guide.xml 🇧🇷 Brasilhttps://iptv-org.github.io/epg/guides/mi.tv.guide.xml 🇨🇦 Canadahttps://iptv-org.github.io/epg/guides/tvtv.ca.guide.xml 🇨🇱 Chilehttps://iptv-org.github.io/epg/guides/mi.tv.guide.xml diff --git a/sites/comteco.com.bo.channels.xml b/sites/comteco.com.bo.channels.xml new file mode 100755 index 00000000..a8062e4d --- /dev/null +++ b/sites/comteco.com.bo.channels.xml @@ -0,0 +1,87 @@ + + + + A&E Latinoamérica + AMC Latin America + ATB + AXN Latinoamérica + AZ Mundo + Abya Yala TV + Animal Planet Latinoamérica + Bolivia TV + Bolivia TV 7.2 + Bolivisión + CNN International Latin America + Cadena A + Canal 24 horas + Caracol Internacional + Cartoon Network Latin America + Cinecanal + Cinemax Latinoamérica + Cubavisión + De Pelicula + Discovery Channel Latinoamérica + Discovery Home & Health Latinoamérica + Discovery Kids América Latina + Disney Channel Latinoamérica + Disney Junior Latinoamérica + Disney XD Latin America + E! Latinoamérica + ESPN 2 América Latina + ESPN 3 América Latina + ESPN América Latina + EWTN España + El Gourmet + El Trece + Euronews en Español + Europa Europa + FX Latinoamérica + FXM Latinoamérica + Fox Sports 2 Latin America + Fox Sports 3 Latin America + Fox Sports Latin America + HBO Latinoamérica + HTV + History Latinoamérica + Investigation Discovery Latinoamérica + Las Estrellas Latinoamérica + MTV Latino Norte + María Visión + Mi Música Urbana + Más Chic Lationamérica + Nat Geo Kids + National Geographic Latinoamérica + Nickelodeon Latinoamérica + PAT + RTP + Record TV Américas + Red Uno + SBT + Sony Channel Latinoamérica + Space México + Star Channel Latin America + Star Life Latin + Studio Universal América Latina + TBS Latinoamérica + TCM América Latina + TLC Latinoamérica + TLNovelas + TNT América Latina + TNT Series Brasil + TV Chile + TV Culturas + TV Globo Internacional Américas + TV Perú + TVE Internacional América + Telefe Internacional + Telemundo Internacional + Tooncast + TyC Sports + Unitel + Universal TV América Latina + VH1 Latinoamérica + Warner Channel Atlántico Sur + XTO TV + teleSUR English + + \ No newline at end of file diff --git a/sites/comteco.com.bo.config.js b/sites/comteco.com.bo.config.js new file mode 100644 index 00000000..b0594535 --- /dev/null +++ b/sites/comteco.com.bo.config.js @@ -0,0 +1,64 @@ +const jsdom = require('jsdom') +const { JSDOM } = jsdom +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: 'es', + site: 'comteco.com.bo', + channels: 'comteco.com.bo.channels.xml', + output: '.gh-pages/guides/comteco.com.bo.guide.xml', + url: function ({ channel }) { + return `https://comteco.com.bo/pages/canales-y-programacion-tv/paquete-oro/${encodeURI( + channel.site_id + )}` + }, + logo: function ({ content }) { + const dom = new JSDOM(content) + const img = dom.window.document.querySelector( + '#myform > div.row > div:nth-child(1) > div.col-xs-5.col-sm-7 > img' + ) + + return img ? `https://comteco.com.bo${img.src}` : null + }, + parser: function ({ content, date }) { + const programs = [] + const dom = new JSDOM(content) + const items = dom.window.document.querySelectorAll('#datosasociados > div > .list-group-item') + items.forEach(item => { + const time = ( + item.querySelector('div > div.col-xs-11 > p > span') || { textContent: '' } + ).textContent + .toString() + .trim() + const title = ( + item.querySelector('div > div.col-xs-11 > p > strong') || { textContent: '' } + ).textContent + .toString() + .trim() + + if (time && title) { + const start = dayjs + .utc(time, 'HH:mm:ss') + .set('D', date.get('D')) + .set('M', date.get('M')) + .set('y', date.get('y')) + + if (programs.length && !programs[programs.length - 1].stop) { + programs[programs.length - 1].stop = start + } + + programs.push({ + title, + start: start.toString() + }) + } + }) + + return programs + } +}