Merge pull request #1992 from iptv-org/add-nuevosiglo.com.uy

Add guide from nuevosiglo.com.uy
This commit is contained in:
Aleksandr Statciuk 2023-02-13 05:57:42 +03:00 committed by GitHub
commit ab663ab7a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 407 additions and 0 deletions

17
.github/workflows/nuevosiglo.com.uy.yml vendored Normal file
View file

@ -0,0 +1,17 @@
name: nuevosiglo.com.uy
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
workflow_run:
workflows: [_trigger]
types:
- completed
jobs:
load:
uses: ./.github/workflows/_load.yml
with:
site: ${{github.workflow}}
secrets:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
{"main_title":"Jurassic World: Dominion","short_argument":"A\u00f1os despu\u00e9s de la destrucci\u00f3n de Isla Nublar, los dinosaurios viven y cazan junto a los humanos. Este equilibrio determinar\u00e1, si los humanos seguir\u00e1n siendo los depredadores m\u00e1ximos en un planeta que comparten con las criaturas temibles.","start_date":"Jueves 09 de Febrero de 2023, 22:11hs.","org_time_start":"2023-02-09 22:11:00","org_time_end":"2023-02-10 00:46:00","time_start":"2023-02-09 22:11:00","time_end":"2023-02-10 00:46:00","channel_name":"HBO","image":"23354476.jpg","year":"2022","parental_rating":"PG-13","actors":"Jeff Goldblum, Sam Neill, Bryce Dallas Howard","repeticiones":[],"restricciones":{"platforms_operator_1":[],"platforms_operator_2":[]},"permisos":{"packages_operator_1":[],"packages_operator_2":[]}}

View file

@ -0,0 +1 @@
{"main_title":"Black Adam","short_argument":"Black Adam es liberado de su tumba casi cinco mil a\u00f1os despu\u00e9s de haber sido encarcelado y recibir sus poderes de los antiguos dioses. Ahora est\u00e1 listo para desatar su forma \u00fanica de justicia en el mundo.","start_date":"Viernes 10 de Febrero de 2023, 23:06hs.","org_time_start":"2023-02-10 23:06:00","org_time_end":"2023-02-11 01:16:00","time_start":"2023-02-10 23:06:00","time_end":"2023-02-11 01:16:00","channel_name":"HBO","image":"24638423.jpg","year":"2022","parental_rating":"PG-13","actors":"Aldis Hodge, Dwayne Johnson, Noah Centineo, Sarah Shahi, Marwan Kenzari, Pierce Brosnan, Quintessa Swindell, Mohammed Amer, Bodhi Sabongui, James Cusati-Moyer","repeticiones":[],"restricciones":{"platforms_operator_1":[],"platforms_operator_2":[]},"permisos":{"packages_operator_1":[],"packages_operator_2":[]}}

View file

@ -0,0 +1,179 @@
<?xml version="1.0" encoding="UTF-8"?>
<site site="nuevosiglo.com.uy">
<channels>
<channel lang="es" xmltv_id="A24.ar" site_id="A24">A24</channel>
<channel lang="es" xmltv_id="BBCWorldNewsLatinAmerica.uk" site_id="BBC WORLD">BBC WORLD</channel>
<channel lang="es" xmltv_id="BloombergTV.us" site_id="BLOOMBERG">BLOOMBERG</channel>
<channel lang="es" xmltv_id="C5N.ar" site_id="C5N">C5N</channel>
<channel lang="es" xmltv_id="Canal10.uy" site_id="SAETA">SAETA</channel>
<channel lang="es" xmltv_id="Canal26.ar" site_id="26 TV HD">26 TV HD</channel>
<channel lang="es" xmltv_id="Canal4.uy" site_id="CANAL 4 MONTECARLO">CANAL 4 MONTECARLO</channel>
<channel lang="es" xmltv_id="Canal5.uy" site_id="CANAL 5">CANAL 5</channel>
<channel lang="es" xmltv_id="CartoonitoLatinAmerica.us" site_id="CARTOONITO">CARTOONITO</channel>
<channel lang="es" xmltv_id="CiudadMagazine.ar" site_id="CIUDAD MAGAZINE">CIUDAD MAGAZINE</channel>
<channel lang="es" xmltv_id="CNNenEspanol.us" site_id="CNN EN ESPAÑOL">CNN EN ESPAÑOL</channel>
<channel lang="es" xmltv_id="CronicaTV.ar" site_id="CRONICA TV">CRONICA TV</channel>
<channel lang="es" xmltv_id="ETBBasque.es" site_id="CANAL VASCO">CANAL VASCO</channel>
<channel lang="es" xmltv_id="Eurochannel.uk" site_id="EUROCHANNEL">EUROCHANNEL</channel>
<channel lang="es" xmltv_id="EuropaEuropa.ar" site_id="EUROPA EUROPA">EUROPA EUROPA</channel>
<channel lang="es" xmltv_id="EWTNEspanaLatinAmerica.us" site_id="EWTN">EWTN</channel>
<channel lang="es" xmltv_id="FoxNewsChannel.us" site_id="FOX NEWS">FOX NEWS</channel>
<channel lang="es" xmltv_id="GaliciaTVAmerica.es" site_id="GALICIA TV">GALICIA TV</channel>
<channel lang="es" xmltv_id="GoldenPlus.mx" site_id="GOLDEN PLUS">GOLDEN PLUS</channel>
<channel lang="es" xmltv_id="GoldenPremier.mx" site_id="GOLDEN PREMIER HD">GOLDEN PREMIER HD</channel>
<channel lang="es" xmltv_id="GolTVLatinAmerica.us" site_id="GOL TV">GOL TV</channel>
<channel lang="es" xmltv_id="HBOFamilyLatinAmerica.us" site_id="HBO FAMILY HD">HBO FAMILY HD</channel>
<channel lang="es" xmltv_id="HBOLatinAmerica.us" site_id="HBO">HBO</channel>
<channel lang="es" xmltv_id="HBOMundiLatinAmerica.us" site_id="HBO MUNDI HD">HBO MUNDI HD</channel>
<channel lang="es" xmltv_id="HBOSignatureLatinAmerica.us" site_id="HBO SIGNATURE HD">HBO SIGNATURE HD</channel>
<channel lang="es" xmltv_id="HBOXtremeLatinAmerica.us" site_id="HBO XTREME HD">HBO XTREME HD</channel>
<channel lang="es" xmltv_id="HolaTVLatinAmerica.us" site_id="HOLA TV">HOLA TV</channel>
<channel lang="es" xmltv_id="KanalDDrama.tr" site_id="KANAL D DRAMA">KANAL D DRAMA</channel>
<channel lang="es" xmltv_id="LaNacionPlus.ar" site_id="LN+">LN+</channel>
<channel lang="es" xmltv_id="LasEstrellasLatinAmerica.mx" site_id="LAS ESTRELLAS HD">LAS ESTRELLAS HD</channel>
<channel lang="es" xmltv_id="NSEventos1.uy" site_id="NS EVENTOS 1">NS EVENTOS 1</channel>
<channel lang="es" xmltv_id="NSEventos2.uy" site_id="NS EVENTOS 2">NS EVENTOS 2</channel>
<channel lang="es" xmltv_id="NSEventos3.uy" site_id="NS EVENTOS 3">NS EVENTOS 3</channel>
<channel lang="es" xmltv_id="NuevoSigloTV.uy" site_id="NUEVO SIGLO TV">NUEVO SIGLO TV</channel>
<channel lang="es" xmltv_id="PasionesLatinAmerica.us" site_id="PASIONES">PASIONES</channel>
<channel lang="es" xmltv_id="PlayboyTVLatinAmerica.us" site_id="PLAYBOY">PLAYBOY</channel>
<channel lang="es" xmltv_id="Sextreme.br" site_id="SEXTREME">SEXTREME</channel>
<channel lang="es" xmltv_id="Teledoce.uy" site_id="TELEDOCE">TELEDOCE</channel>
<channel lang="es" xmltv_id="TelefeInternacional.ar" site_id="TELEFE INTER">TELEFE INTER</channel>
<channel lang="es" xmltv_id="TN.ar" site_id="TN">TN</channel>
<channel lang="es" xmltv_id="Tooncast.us" site_id="TOONCAST">TOONCAST</channel>
<channel lang="es" xmltv_id="truTVLatinAmerica.us" site_id="TRU TV">TRU TV</channel>
<channel lang="es" xmltv_id="TVChile.cl" site_id="TVN CHILE">TVN CHILE</channel>
<channel lang="es" xmltv_id="TVCiudad.uy" site_id="TEVECIUDAD">TEVECIUDAD</channel>
<channel lang="es" xmltv_id="Venus.ar" site_id="VENUS">VENUS</channel>
<channel lang="es" xmltv_id="VTV.uy" site_id="VTV">VTV</channel>
<channel lang="es" xmltv_id="VTVPlus.uy" site_id="VTV PLUS">VTV PLUS</channel>
<!-- <channel lang="es" xmltv_id="" site_id="A&E MUNDO HD">A&amp;E MUNDO HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="A&E MUNDO">A&amp;E MUNDO</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="A3CINE">A3CINE</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="ALLEGRO HD">ALLEGRO HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="AMC HD">AMC HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="AMC">AMC</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="AMERICA 2">AMERICA 2</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="ANIMAL PLANET HD">ANIMAL PLANET HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="ANIMAL PLANET">ANIMAL PLANET</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="ANTENA3 HD">ANTENA3 HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="ATRESERIES">ATRESERIES</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="AXN HD">AXN HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="AXN">AXN</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="BABY TV">BABY TV</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="CANAL 24 HS">CANAL 24 HS</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="CANAL 4 MONTECARLO">CANAL 4 MONTECARLO</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="CARTOON NETWORK HD">CARTOON NETWORK HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="CARTOON NETWORK">CARTOON NETWORK</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="CINECANAL HD">CINECANAL HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="CINECANAL">CINECANAL</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="CINEMAX HD">CINEMAX HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="CINEMAX">CINEMAX</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="DEUTSCHE WELLE">DEUTSCHE WELLE</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="DISCOVERY HD THEATER">DISCOVERY HD THEATER</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="DISCOVERY HD">DISCOVERY HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="DISCOVERY ID HD">DISCOVERY ID HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="DISCOVERY ID">DISCOVERY ID</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="DISCOVERY KIDS HD">DISCOVERY KIDS HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="DISCOVERY KIDS">DISCOVERY KIDS</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="DISCOVERY SCIENCE HD">DISCOVERY SCIENCE HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="DISCOVERY TLC HD">DISCOVERY TLC HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="DISCOVERY TURBO HD">DISCOVERY TURBO HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="DISCOVERY WORLD HD">DISCOVERY WORLD HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="DISCOVERY">DISCOVERY</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="DISNEY HD">DISNEY HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="DISNEY JR">DISNEY JR</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="DISNEY">DISNEY</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="EL GOURMET HD">EL GOURMET HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="EL GOURMET">EL GOURMET</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="ENTERTAINMENT TELEVISION">ENTERTAINMENT TELEVISION</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="ESPN 2 HD">ESPN 2 HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="ESPN 2">ESPN 2</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="ESPN 3 HD">ESPN 3 HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="ESPN 3">ESPN 3</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="ESPN 4 HD">ESPN 4 HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="ESPN 4">ESPN 4</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="ESPN EXTRA HD">ESPN EXTRA HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="ESPN HD">ESPN HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="ESPN">ESPN</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="FILM&ARTS HD">FILM&amp;ARTS HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="FILM&ARTS">FILM&amp;ARTS</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="FOOD NETWORK">FOOD NETWORK</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="FOX SPORTS 2 HD">FOX SPORTS 2 HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="FOX SPORTS 2">FOX SPORTS 2</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="FOX SPORTS 3 HD">FOX SPORTS 3 HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="FOX SPORTS 3">FOX SPORTS 3</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="FX HD">FX HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="FX">FX</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="GLITZ">GLITZ</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="H2 HD">H2 HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="H2">H2</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="HBO 2 HD">HBO 2 HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="HBO HD">HBO HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="HBO PLUS HD">HBO PLUS HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="HBO POP HD">HBO POP HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="HGTV">HGTV</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="HISTORY HD">HISTORY HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="HISTORY">HISTORY</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="HOME AND HEALTH HD">HOME AND HEALTH HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="HOME AND HEALTH">HOME AND HEALTH</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="I-SAT">I-SAT</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="IVC">IVC</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="LIFETIME">LIFETIME</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="MAS CHIC HD">MAS CHIC HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="MAS CHIC">MAS CHIC</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="MTV 80S">MTV 80S</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="MTV CLUB">MTV CLUB</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="MTV HD">MTV HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="MTV HITS">MTV HITS</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="MTV">MTV</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="NAT GEO HD">NAT GEO HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="NATIONAL GEOGRAPHIC">NATIONAL GEOGRAPHIC</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="NICK JR">NICK JR</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="NICKELODEON">NICKELODEON</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="PARAMOUNT NETWORK HD">PARAMOUNT NETWORK HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="PARAMOUNT NETWORK">PARAMOUNT NETWORK</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="PENTHOUSE">PENTHOUSE</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="QUIERO">QUIERO</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="RAI">RAI</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="REDE RECORD">REDE RECORD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="REDE TV">REDE TV</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="SONY HD">SONY HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="SONY MOVIES HD">SONY MOVIES HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="SONY">SONY</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="SPACE HD">SPACE HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="SPACE">SPACE</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="SPORTV">SPORTV</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="STAR CHANNEL HD">STAR CHANNEL HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="STAR CHANNEL">STAR CHANNEL</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="STUDIO UNIVERSAL HD">STUDIO UNIVERSAL HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="STUDIO UNIVERSAL">STUDIO UNIVERSAL</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="SY FY">SY FY</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TBS">TBS</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TCM">TCM</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TELEMUNDO HD">TELEMUNDO HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TELEMUNDO">TELEMUNDO</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TLC">TLC</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TNT HD">TNT HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TNT SERIES HD">TNT SERIES HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TNT SERIES">TNT SERIES</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TNT">TNT</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TRU TV HD">TRU TV HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TV 5">TV 5</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TV GLOBO HD">TV GLOBO HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TVE HD">TVE HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TVE">TVE</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TYC SPORTS HD">TYC SPORTS HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="TYC SPORTS">TYC SPORTS</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="UNIVERSAL CHANNEL HD">UNIVERSAL CHANNEL HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="UNIVERSAL CHANNEL">UNIVERSAL CHANNEL</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="UNIVERSAL CINEMA HD">UNIVERSAL CINEMA HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="UNIVERSAL COMEDY HD">UNIVERSAL COMEDY HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="UNIVERSAL CRIME HD">UNIVERSAL CRIME HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="UNIVERSAL PREMIERE HD">UNIVERSAL PREMIERE HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="UNIVERSAL REALITY HD">UNIVERSAL REALITY HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="WARNER HD">WARNER HD</channel> -->
<!-- <channel lang="es" xmltv_id="" site_id="WARNER">WARNER</channel> -->
</channels>
</site>

View file

@ -0,0 +1,108 @@
const axios = require('axios')
const cheerio = require('cheerio')
const dayjs = require('dayjs')
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)
const API_ENDPOINT = 'https://www.nuevosiglo.com.uy/programacion/getGrilla'
module.exports = {
site: 'nuevosiglo.com.uy',
days: 2,
url({ date }) {
return `${API_ENDPOINT}?fecha=${date.format('YYYY/MM/DD')}`
},
request: {
cache: {
ttl: 60 * 60 * 1000 // 1 hour
}
},
async parser({ content, channel }) {
const programs = []
const items = parseItems(content, channel)
for (let item of items) {
const $item = cheerio.load(item)
const programId = parseProgramId($item)
const details = await loadProgramDetails(programId)
if (!details) continue
const start = parseStart(details)
const stop = parseStop(details)
programs.push({
title: details.main_title,
description: details.short_argument,
icon: parseIcon(details),
actors: parseActors(details),
rating: parseRating(details),
date: details.year,
start: parseStart(details),
stop: parseStop(details)
})
}
return programs
},
async channels() {
const data = await axios
.get(`${API_ENDPOINT}?fecha=${dayjs().format('YYYY/MM/DD')}`)
.then(r => r.data)
.catch(console.error)
const $ = cheerio.load(data)
return $('img')
.map(function () {
return {
lang: 'es',
site_id: $(this).attr('alt').replace('&', '&amp;'),
name: $(this).attr('alt')
}
})
.get()
}
}
function parseProgramId($item) {
return $item('*').data('schedule')
}
function loadProgramDetails(programId) {
return axios
.get(`https://www.nuevosiglo.com.uy/Programacion/getScheduleXId/${programId}`)
.then(r => r.data)
.catch(console.log)
}
function parseRating(details) {
return details.parental_rating
? {
system: 'MPAA',
value: details.parental_rating
}
: null
}
function parseActors(details) {
return details.actors.split(', ')
}
function parseIcon(details) {
return details.image ? `https://img-ns.s3.amazonaws.com/grid_data/${details.image}` : null
}
function parseStart(details) {
return dayjs.tz(details.time_start, 'YYYY-MM-DD HH:mm:ss', 'America/Montevideo')
}
function parseStop(details) {
return dayjs.tz(details.time_end, 'YYYY-MM-DD HH:mm:ss', 'America/Montevideo')
}
function parseItems(content, channel) {
const $ = cheerio.load(content)
return $(`img[alt="${channel.site_id}"]`).first().nextUntil('img').toArray()
}

View file

@ -0,0 +1,100 @@
// npm run channels:parse -- --config=./sites/nuevosiglo.com.uy/nuevosiglo.com.uy.config.js --output=./sites/nuevosiglo.com.uy/nuevosiglo.com.uy.channels.xml
// npx epg-grabber --config=sites/nuevosiglo.com.uy/nuevosiglo.com.uy.config.js --channels=sites/nuevosiglo.com.uy/nuevosiglo.com.uy.channels.xml --output=guide.xml --days=2
const { parser, url } = require('./nuevosiglo.com.uy.config.js')
const fs = require('fs')
const path = require('path')
const axios = require('axios')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
dayjs.extend(customParseFormat)
dayjs.extend(utc)
jest.mock('axios')
const date = dayjs.utc('2023-02-10', 'YYYY-MM-DD').startOf('d')
const channel = {
site_id: 'HBO',
xmltv_id: 'HBOLatinAmerica.us'
}
it('can generate valid url', () => {
expect(url({ date })).toBe(
'https://www.nuevosiglo.com.uy/programacion/getGrilla?fecha=2023/02/10'
)
})
it('can parse response', async () => {
axios.get.mockImplementation(url => {
if (url === 'https://www.nuevosiglo.com.uy/Programacion/getScheduleXId/133769227') {
return Promise.resolve({
data: JSON.parse(fs.readFileSync(path.resolve(__dirname, '__data__/program1.json')))
})
} else if (url === 'https://www.nuevosiglo.com.uy/Programacion/getScheduleXId/133769239') {
return Promise.resolve({
data: JSON.parse(fs.readFileSync(path.resolve(__dirname, '__data__/program2.json')))
})
} else {
return Promise.resolve({ data: '' })
}
})
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html'), 'utf8')
let results = await parser({ content, channel })
results = results.map(p => {
p.start = p.start.toJSON()
p.stop = p.stop.toJSON()
return p
})
expect(results[0]).toMatchObject({
start: '2023-02-10T01:11:00.000Z',
stop: '2023-02-10T03:46:00.000Z',
title: `Jurassic World: Dominion`,
description:
'Años después de la destrucción de Isla Nublar, los dinosaurios viven y cazan junto a los humanos. Este equilibrio determinará, si los humanos seguirán siendo los depredadores máximos en un planeta que comparten con las criaturas temibles.',
icon: 'https://img-ns.s3.amazonaws.com/grid_data/23354476.jpg',
date: '2022',
rating: {
system: 'MPAA',
value: 'PG-13'
},
actors: ['Jeff Goldblum', 'Sam Neill', 'Bryce Dallas Howard']
})
expect(results[1]).toMatchObject({
start: '2023-02-11T02:06:00.000Z',
stop: '2023-02-11T04:16:00.000Z',
title: `Black Adam`,
description:
'Black Adam es liberado de su tumba casi cinco mil años después de haber sido encarcelado y recibir sus poderes de los antiguos dioses. Ahora está listo para desatar su forma única de justicia en el mundo.',
icon: 'https://img-ns.s3.amazonaws.com/grid_data/24638423.jpg',
date: '2022',
rating: {
system: 'MPAA',
value: 'PG-13'
},
actors: [
'Aldis Hodge',
'Dwayne Johnson',
'Noah Centineo',
'Sarah Shahi',
'Marwan Kenzari',
'Pierce Brosnan',
'Quintessa Swindell',
'Mohammed Amer',
'Bodhi Sabongui',
'James Cusati-Moyer'
]
})
})
it('can handle empty guide', async () => {
const results = await parser({
channel,
content: ``
})
expect(results).toMatchObject([])
})