From b042e14b9aeb1e7dbfad2a24dfec8b0c163e1523 Mon Sep 17 00:00:00 2001
From: freearhey <7253922+freearhey@users.noreply.github.com>
Date: Sun, 2 Feb 2025 07:27:42 +0300
Subject: [PATCH 1/5] Delete __data__
---
sites/cablego.com.pe/__data__/content.json | 1 -
sites/cablego.com.pe/__data__/no_content.json | 1 -
2 files changed, 2 deletions(-)
delete mode 100644 sites/cablego.com.pe/__data__/content.json
delete mode 100644 sites/cablego.com.pe/__data__/no_content.json
diff --git a/sites/cablego.com.pe/__data__/content.json b/sites/cablego.com.pe/__data__/content.json
deleted file mode 100644
index 34ab546c..00000000
--- a/sites/cablego.com.pe/__data__/content.json
+++ /dev/null
@@ -1 +0,0 @@
-{"state":[],"snippets":{"snippet--channelGrid":"
\n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n \n 16:00 \n \n \n Elif\n \n\n\n \n \n \n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n","snippet--loadMore":" Show more \n"}}
\ No newline at end of file
diff --git a/sites/cablego.com.pe/__data__/no_content.json b/sites/cablego.com.pe/__data__/no_content.json
deleted file mode 100644
index 64c6171c..00000000
--- a/sites/cablego.com.pe/__data__/no_content.json
+++ /dev/null
@@ -1 +0,0 @@
-{"state":[],"snippets":{"snippet--channelGrid":" \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n \n
\n\n
\n
\n \n \n \n \n
\n \n \n
\n\n
\n
\n
\n Program Guide not available\n
\n
\n
\n\n
\n \n \n \n \n \n
\n
\n","snippet--loadMore":" Show more \n"}}
\ No newline at end of file
From 3719cd725da97ffc0557975a656db86201505606 Mon Sep 17 00:00:00 2001
From: freearhey <7253922+freearhey@users.noreply.github.com>
Date: Sun, 2 Feb 2025 07:27:45 +0300
Subject: [PATCH 2/5] Delete cablego.com.pe.test.js
---
sites/cablego.com.pe/cablego.com.pe.test.js | 51 ---------------------
1 file changed, 51 deletions(-)
delete mode 100644 sites/cablego.com.pe/cablego.com.pe.test.js
diff --git a/sites/cablego.com.pe/cablego.com.pe.test.js b/sites/cablego.com.pe/cablego.com.pe.test.js
deleted file mode 100644
index 46a51d1f..00000000
--- a/sites/cablego.com.pe/cablego.com.pe.test.js
+++ /dev/null
@@ -1,51 +0,0 @@
-const { parser, url, request } = require('./cablego.com.pe.config.js')
-const fs = require('fs')
-const path = require('path')
-const dayjs = require('dayjs')
-const utc = require('dayjs/plugin/utc')
-const customParseFormat = require('dayjs/plugin/customParseFormat')
-dayjs.extend(customParseFormat)
-dayjs.extend(utc)
-
-const date = dayjs.utc('2022-11-28', 'YYYY-MM-DD').startOf('d')
-const channel = {
- site_id: '0#LATINA',
- xmltv_id: 'Latina.pe'
-}
-
-it('can generate valid url', () => {
- expect(url({ channel, date })).toBe(
- 'https://cablego.com.pe/epg/default/2022-11-28?page=0&do=loadPage'
- )
-})
-
-it('can generate valid request method', () => {
- expect(request.method).toBe('POST')
-})
-
-it('can generate valid request headers', () => {
- expect(request.headers).toMatchObject({
- 'x-requested-with': 'XMLHttpRequest'
- })
-})
-
-it('can parse response', () => {
- const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
- let results = parser({ content, channel, date }).map(p => {
- p.start = p.start.toJSON()
- p.stop = p.stop.toJSON()
- return p
- })
-
- expect(results[0]).toMatchObject({
- start: '2022-11-28T05:00:00.000Z',
- stop: '2022-11-28T06:30:00.000Z',
- title: 'Especiales Qatar'
- })
-})
-
-it('can handle empty guide', () => {
- const content = fs.readFileSync(path.resolve(__dirname, '__data__/no_content.json'))
- const result = parser({ content, channel, date })
- expect(result).toMatchObject([])
-})
From b2588e80dfb4dc9789d8f483244db4f659e06403 Mon Sep 17 00:00:00 2001
From: freearhey <7253922+freearhey@users.noreply.github.com>
Date: Sun, 2 Feb 2025 07:27:48 +0300
Subject: [PATCH 3/5] Delete cablego.com.pe.config.js
---
sites/cablego.com.pe/cablego.com.pe.config.js | 108 ------------------
1 file changed, 108 deletions(-)
delete mode 100644 sites/cablego.com.pe/cablego.com.pe.config.js
diff --git a/sites/cablego.com.pe/cablego.com.pe.config.js b/sites/cablego.com.pe/cablego.com.pe.config.js
deleted file mode 100644
index 9a0d247d..00000000
--- a/sites/cablego.com.pe/cablego.com.pe.config.js
+++ /dev/null
@@ -1,108 +0,0 @@
-const dayjs = require('dayjs')
-const axios = require('axios')
-const cheerio = require('cheerio')
-const utc = require('dayjs/plugin/utc')
-const timezone = require('dayjs/plugin/timezone')
-const customParseFormat = require('dayjs/plugin/customParseFormat')
-
-dayjs.extend(utc)
-dayjs.extend(timezone)
-dayjs.extend(customParseFormat)
-
-module.exports = {
- site: 'cablego.com.pe',
- days: 2,
- request: {
- method: 'POST',
- headers: {
- 'x-requested-with': 'XMLHttpRequest',
- cookie: '_nss=1'
- },
- cache: {
- ttl: 60 * 60 * 1000 // 1 hour
- }
- },
- url({ channel, date }) {
- const [page] = channel.site_id.split('#')
-
- return `https://cablego.com.pe/epg/default/${date.format(
- 'YYYY-MM-DD'
- )}?page=${page}&do=loadPage`
- },
- parser: function ({ content, channel, date }) {
- let programs = []
- const items = parseItems(content, channel)
- items.forEach(item => {
- const $item = cheerio.load(item)
- const prev = programs[programs.length - 1]
- let start = parseStart($item, date)
- if (!start) return
- if (prev) {
- if (start.isBefore(prev.start)) {
- start = start.add(1, 'd')
- date = date.add(1, 'd')
- }
- prev.stop = start
- }
- const stop = start.add(30, 'm')
- programs.push({
- title: parseTitle($item),
- start,
- stop
- })
- })
-
- return programs
- },
- async channels() {
- const pages = [0, 1, 2, 3, 4]
-
- let channels = []
- for (const page of pages) {
- const url = `https://cablego.com.pe/epg/default/${dayjs().format(
- 'YYYY-MM-DD'
- )}?page=${page}&do=loadPage`
- const data = await axios
- .post(url, null, {
- headers: {
- 'x-requested-with': 'XMLHttpRequest',
- cookie: '_nss=1'
- }
- })
- .then(r => r.data)
- .catch(console.log)
-
- const $ = cheerio.load(data.snippets['snippet--channelGrid'])
- $('.epg-channel-strip').each((i, el) => {
- const channelId = $(el).find('.epg-channel-logo').attr('id')
- channels.push({
- lang: 'es',
- site_id: `${page}#${channelId}`,
- name: $(el).find('img').attr('alt')
- })
- })
- }
-
- return channels
- }
-}
-
-function parseTitle($item) {
- return $item('span:nth-child(2) > a').text().trim()
-}
-
-function parseStart($item, date) {
- const time = $item('.epg-show-start').text().trim()
-
- return dayjs.tz(`${date.format('YYYY-MM-DD')} ${time}`, 'YYYY-MM-DD HH:mm', 'America/Lima')
-}
-
-function parseItems(content, channel) {
- const [, channelId] = channel.site_id.split('#')
- const data = JSON.parse(content)
- if (!data || !data.snippets || !data.snippets['snippet--channelGrid']) return []
- const html = data.snippets['snippet--channelGrid']
- const $ = cheerio.load(html)
-
- return $(`#${channelId}`).parent().find('.epg-show').toArray()
-}
From 466d8b2147360104d2bd5daf48aead08a3179860 Mon Sep 17 00:00:00 2001
From: freearhey <7253922+freearhey@users.noreply.github.com>
Date: Sun, 2 Feb 2025 07:27:52 +0300
Subject: [PATCH 4/5] Delete cablego.com.pe.channels.xml
---
.../cablego.com.pe.channels.xml | 103 ------------------
1 file changed, 103 deletions(-)
delete mode 100644 sites/cablego.com.pe/cablego.com.pe.channels.xml
diff --git a/sites/cablego.com.pe/cablego.com.pe.channels.xml b/sites/cablego.com.pe/cablego.com.pe.channels.xml
deleted file mode 100644
index 0f0cd0d2..00000000
--- a/sites/cablego.com.pe/cablego.com.pe.channels.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
- AXN
- CINECANAL
- STAR CHANNEL
- QUVO TV
- SONY
- UNIVERSAL
- A&E
- AMC
- ANIMAL PLANET
- CINEMA INOLVIDABLE
- CLOVER CHANNEL
- DISCOVERY CHANNEL
- DISCOVERY SCIENCE
- DISCOVERY TURBO
- FILMS & ARTS
- FX
- GOLDEN LATINO
- ID
- NATGEO
- PARAMOUNT CHANNEL
- SONY MOVIES
- STUDIO UNIVERSAL
- USA
- CLIC
- CORAZON
- MUNDO
- CANAL DE LAS ESTRELLAS
- DISCOVERY KIDS
- DISCOVERY THEATER
- DISCOVERY WORLD
- DISNEY JUNIOR
- DISTRITO COMEDIA
- FOOD NETWORK
- GOURMET
- HGTV
- HOME & HEALTH
- KANAL D
- MAS CHIC
- TELEMUNDO
- TELENOVELAS
- TLC
- UNIVISION
- BITME
- CNBC
- DISNEY CHANNEL
- DREAMWORKS
- ESPN
- ESPN2
- ESPN3
- ESPN EXTRA
- FOX NEWS
- ESPN4
- FOX SPORTS 2
- FOX SPORTS 3
- KARIBEÑA
- MTV
- NICKELODEON
- NICK JR
- NICKMUSIC
- NOTICIAS CARACOL
- PLIM PLIM
- ZOOMOO
- AMERICA TV
- ANTENA 3
- BANDAMAX
- BETHEL
- E!
- ENLACE
- EWTN
- HISTORY 2
- HISTORY CHANNEL
- IVC NETWORKS
- JN19
- LIFE TIME
- OVACION
- PLAYBOY
- TELEFE
- TELEHIT LATINO
- TELEHIT MUSICA
- TRECE ARGENTINA
- ATV
- ATV+
- BHTV
- CONECTA2 TV
- CONGRESO TV
- DE PELICULA
- ECUADOR TV
- EUROPA EUROPA
- EXITOSA TV
- GLOBAL
- GOLDEN EDGE
- LATINA
- NATIVA
- PANAMERICANA TV
- PASIONES
- PBO
- TV PERU
- USMP TV
- VENUS
- WILLAX
-
From 637edef0190a782d3ed9c42e42db335dd0b67221 Mon Sep 17 00:00:00 2001
From: freearhey <7253922+freearhey@users.noreply.github.com>
Date: Sun, 2 Feb 2025 07:27:55 +0300
Subject: [PATCH 5/5] Delete readme.md
---
sites/cablego.com.pe/readme.md | 21 ---------------------
1 file changed, 21 deletions(-)
delete mode 100644 sites/cablego.com.pe/readme.md
diff --git a/sites/cablego.com.pe/readme.md b/sites/cablego.com.pe/readme.md
deleted file mode 100644
index d72d71e6..00000000
--- a/sites/cablego.com.pe/readme.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# cablego.com.pe
-
-https://cablego.com.pe/
-
-### Download the guide
-
-```sh
-npm run grab --- --site=cablego.com.pe
-```
-
-### Update channel list
-
-```sh
-npm run channels:parse --- --config=./sites/cablego.com.pe/cablego.com.pe.config.js --output=./sites/cablego.com.pe/cablego.com.pe.channels.xml
-```
-
-### Test
-
-```sh
-npm test --- cablego.com.pe
-```