diff --git a/sites/guiadetv.com/__data__/content.html b/sites/guiadetv.com/__data__/content.html new file mode 100644 index 00000000..24c349bc --- /dev/null +++ b/sites/guiadetv.com/__data__/content.html @@ -0,0 +1,2978 @@ + + + + + + + + + + + + + + + + + + + + + + + + Programação Canal Rural Hoje, Programação de TV - Guia de TV - Guiadetv.com + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + +
+ + +
+
+
+
+ +
+ + Canal Aberto +

Programação Canal Rural

+ +
+
+ + +
+ +
+ +
+ +
+ +
+ +
+
+ + + + +
+
+ Hoje +
+
+ + +
+
+ Amanhã +
+
+ + +
+
+ Sexta +
+
+ + +
+
+ Sábado +
+
+ + +
+
+ Domingo +
+
+ +
+
+ + + +
+
+
+

Programação de Hoje, 15 janeiro 2025 na tv

+
+
+
+ + + + +
+
+ + + 18:15 + No Ar + +
+
+

+ + + + + Planeta Campo Talks + + +

+

Grandes reportagens, notícias, entrevistas e debates com foco em ações de sustentabilidade e indicadores ESG. Informações para apoiar o produtor rural a plantar e criar com olhar para o futuro.

+
+ +
+
+
+
+ + + +
+
+ + 18:45 + +
+
+

+ + + + + + Rural Notícias + + +

+ +

Jornalismo + Fique por dentro das principais notícias do agronegócio e os fatos mais relevantes do setor. +

+
+
+ + + +
+
+ + 19:45 + +
+ +
+ + + +
+
+ + 20:00 + +
+
+

+ + + + + + ABCZ Notícias + + +

+ +

Jornalismo + +

+
+
+ + + +
+
+ + 20:04 + +
+
+

+ + + + + + Pantanal + + +

+ +

+ +

+
+
+ + + +
+
+ + 22:00 + +
+
+

+ + + + + + LanceCast + + +

+ +

+ +

+
+
+ + + +
+
+ + 23:00 + +
+
+

+ + + + + + Giro do Boi + + +

+ +

+ +

+
+
+ + + +
+
+
+

Programação de Amanhã, 16 janeiro 2025 na tv

+
+
+
+ + +
+
+ + 00:00 + +
+ +
+ + + +
+
+ + 03:00 + +
+
+

+ + + + + + TV Verdade + + +

+ +

Jornalismo + +

+
+
+ + + +
+
+ + 06:00 + +
+
+

+ + + + + + Cooper News SC + + +

+ +

Jornalismo + +

+
+
+ + + +
+
+ + 06:30 + +
+
+

+ + + + + + Planeta Campo + + +

+ +

+ +

+
+
+ + + +
+
+ + 06:45 + +
+ +
+ + + +
+
+ + 07:00 + +
+
+

+ + + + + + Giro do Boi + + +

+ +

+ +

+
+
+ + + +
+
+ + 08:00 + +
+
+

+ + + + + + Odair Terra + + +

+ +

+ +

+
+
+ + + +
+
+ + 08:30 + +
+ +
+ + + +
+
+ + 09:00 + +
+ +
+ + + +
+
+ + 09:30 + +
+ +
+ + + +
+
+ + 11:00 + +
+ +
+ + + +
+
+ + 11:30 + +
+ +
+ + + +
+
+ + 11:45 + +
+ +
+ + + +
+
+ + 12:00 + +
+
+

+ + + + + + Planeta Campo + + +

+ +

+ +

+
+
+ + + +
+
+ + 12:30 + +
+
+

+ + + + + + Mercado & Cia + + +

+ +

Jornalismo + +

+
+
+ + + +
+
+ + 13:35 + +
+ +
+ + + +
+
+ + 14:04 + +
+ +
+ + + +
+
+ + 16:34 + +
+
+

+ + + + + + Planeta Campo + + +

+ +

+ +

+
+
+ + + +
+
+ + 16:50 + +
+
+

+ + + + + + Odair Terra + + +

+ +

+ +

+
+
+ + + +
+
+ + 17:45 + +
+ +
+ + + +
+
+ + 18:15 + +
+ +
+ + + +
+
+ + 18:45 + +
+
+

+ + + + + + Rural Notícias + + +

+ +

Jornalismo + +

+
+
+ + + +
+
+ + 19:45 + +
+
+

+ + + + + + Lance na TV + + +

+ +

+ +

+
+
+ + + +
+
+ + 20:00 + +
+
+

+ + + + + + ABCZ Notícias + + +

+ +

Jornalismo + +

+
+
+ + + +
+
+ + 20:04 + +
+
+

+ + + + + + LanceCast + + +

+ +

+ +

+
+
+ + + +
+
+ + 22:00 + +
+
+

+ + + + + + LanceCast + + +

+ +

+ +

+
+
+ + + +
+
+
+

Programação de Sexta, 17 janeiro 2025 na tv

+
+
+
+ + +
+
+ + 00:00 + +
+ +
+ + + +
+
+ + 03:00 + +
+
+

+ + + + + + TV Verdade + + +

+ +

Jornalismo + +

+
+
+ + + +
+
+ + 06:00 + +
+
+

+ + + + + + Cooper News SC + + +

+ +

Jornalismo + +

+
+
+ + + +
+
+ + 06:30 + +
+
+

+ + + + + + Ouro Branco + + +

+ +

+ +

+
+
+ + + +
+
+ + 07:00 + +
+
+

+ + + + + + Giro do Boi + + +

+ +

+ +

+
+
+ + + +
+
+ + 08:00 + +
+
+

+ + + + + + Ouro Branco + + +

+ +

+ +

+
+
+ + + +
+
+ + 08:05 + +
+ +
+ + + +
+
+ + 08:35 + +
+ +
+ + + +
+
+ + 08:50 + +
+
+

+ + + + + + Economia 360 + + +

+ +

+ +

+
+
+ + + +
+
+ + 09:26 + +
+ +
+ + + +
+
+ + 11:00 + +
+ +
+ + + +
+
+ + 11:30 + +
+ +
+ + + +
+
+ + 12:15 + +
+
+

+ + + + + + Planeta Campo + + +

+ +

+ +

+
+
+ + + +
+
+ + 12:30 + +
+
+

+ + + + + + Mercado & Cia + + +

+ +

Jornalismo + +

+
+
+ + + +
+
+ + 13:35 + +
+
+

+ + + + + + Soja Brasil + + +

+ +

+ +

+
+
+ + + +
+
+ + 14:04 + +
+ +
+ + + +
+
+ + 16:34 + +
+ +
+ + + +
+
+ + 17:05 + +
+ +
+ + + +
+
+ + 18:00 + +
+
+

+ + + + + + Planeta Campo + + +

+ +

+ +

+
+
+ + + +
+
+ + 18:15 + +
+
+

+ + + + + + Odair Terra + + +

+ +

+ +

+
+
+ + + +
+
+ + 18:45 + +
+
+

+ + + + + + Rural Notícias + + +

+ +

Jornalismo + +

+
+
+ + + +
+
+ + 19:45 + +
+ +
+ + + +
+
+ + 20:00 + +
+
+

+ + + + + + ABCZ Notícias + + +

+ +

Jornalismo + +

+
+
+ + + +
+
+ + 20:04 + +
+ +
+ + + +
+
+ + 20:30 + +
+
+

+ + + + + + Giro do Boi + + +

+ +

+ +

+
+
+ + + +
+
+ + 22:00 + +
+
+

+ + + + + + Giro do Boi + + +

+ +

+ +

+
+
+ + + +
+
+ + 23:10 + +
+ +
+ + + +
+
+
+

Programação de Sábado, 18 janeiro 2025 na tv

+
+
+
+ + +
+
+ + 00:00 + +
+
+

+ + + + + + Leilão + + +

+ +

+ +

+
+
+ + + +
+
+ + 01:00 + +
+
+

+ + + + + + Programa Pago + + +

+ +

+ +

+
+
+ + + +
+
+ + 03:00 + +
+
+

+ + + + + + TV Verdade + + +

+ +

Jornalismo + +

+
+
+ + + +
+
+ + 06:00 + +
+ +
+ + + +
+
+ + 06:30 + +
+ +
+ + + +
+
+ + 07:00 + +
+ +
+ + + +
+
+ + 07:30 + +
+
+

+ + + + + + Odair Terra + + +

+ +

+ +

+
+
+ + + +
+
+ + 08:30 + +
+
+

+ + + + + + Cooperativismo em Notícia + + +

+ +

Jornalismo + +

+
+
+ + + +
+
+ + 09:00 + +
+ +
+ + + +
+
+ + 09:15 + +
+ +
+ + + +
+
+ + 09:30 + +
+ +
+ + + +
+
+ + 10:00 + +
+ +
+ + + +
+
+ + 11:00 + +
+
+

+ + + + + + Odair Terra + + +

+ +

+ +

+
+
+ + + +
+
+ + 12:00 + +
+ +
+ + + +
+
+ + 13:00 + +
+
+

+ + + + + + Leilão + + +

+ +

+ +

+
+
+ + + +
+
+ + 21:00 + +
+
+

+ + + + + + Leilão + + +

+ +

+ +

+
+
+ + + +
+
+
+

Programação de Domingo, 19 janeiro 2025 na tv

+
+
+
+ + +
+
+ + 00:00 + +
+
+

+ + + + + + Leilão + + +

+ +

+ +

+
+
+ + + +
+
+ + 01:00 + +
+
+

+ + + + + + Programa Pago + + +

+ +

+ +

+
+
+ + + +
+
+ + 03:00 + +
+
+

+ + + + + + TV Verdade + + +

+ +

Jornalismo + +

+
+
+ + + +
+
+ + 06:00 + +
+
+

+ + + + + + Agro Nacional + + +

+ +

+ +

+
+
+ + + +
+
+ + 07:00 + +
+
+

+ + + + + + Ouro Branco + + +

+ +

+ +

+
+
+ + + +
+
+ + 07:30 + +
+ +
+ + + +
+
+ + 08:00 + +
+ +
+ + + +
+
+ + 09:00 + +
+
+

+ + + + + + Leilão + + +

+ +

+ +

+
+
+ +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + diff --git a/sites/guiadetv.com/__data__/no_content.html b/sites/guiadetv.com/__data__/no_content.html new file mode 100644 index 00000000..762b0006 --- /dev/null +++ b/sites/guiadetv.com/__data__/no_content.html @@ -0,0 +1,471 @@ + + + + + + + + + + + + + + + + + + + + + + + + Estamos com Problemas de Conexão - Guia de TV + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + + +
+ + +
+
+
+
+
+ 500 +

500

+
+ +
+ Estamos com Problemas de Conexão
+
+
+
+ + + + + + + + + + + + + + + + + + + + + diff --git a/sites/guiadetv.com/guiadetv.com.channels.xml b/sites/guiadetv.com/guiadetv.com.channels.xml new file mode 100644 index 00000000..ea316734 --- /dev/null +++ b/sites/guiadetv.com/guiadetv.com.channels.xml @@ -0,0 +1,127 @@ + + + A&E + Agro+ + AMC + Animal Planet + Arte 1 + AXN + Band + Bandnews + Bandsports + BBC World + Bis + Bloomberg + Box Kids + Canal Educação + Canal Rural + Canção Nova + Cartoon Network + Cartoonito + Cinecanal + Cinemax + CNN Brasil + Combate + Comedy Central + Curta! + Discovery Channel + Discovery Home & Health + Discovery Kids + Discovery Science + Discovery Theater + Discovery Turbo + Discovery World + Disney + E! + ESPN + ESPN 2 + ESPN 3 + ESPN 4 + ESPN 5 + ESPN 6 + Film & Arts + Food Network + Fox News + Futura + FX + Globo + Globo News + Gloob + Gloobinho + GNT + HBO + HBO 2 + HBO Family + HBO Mundi + HBO Plus + HBO Pop + HBO Signature + HBO Xtreme + HGTV + History + History 2 + Investigação Discovery + Jovem Pan News + Lifetime + Megapix + MTV + MTV LIVE + Multishow + National Geographic + Nick Jr. + Nickelodeon + Off + Paramount Network + Premiere 2 + Premiere 3 + Premiere 4 + Premiere 5 + Premiere 6 + Premiere 7 + Premiere FC + Prime Box Brazil + Record News + Record TV + Rede Brasil + Rede Família + Rede Gospel + Rede Século 21 + Rede TV + Rede Vida + SBT + Sony + SONY Movies + Space + SporTV + SporTV 2 + SporTV 3 + STAR Channel + Studio Universal + Syfy + TCM + Telecine Action + Telecine Cult + Telecine Fun + Telecine Pipoca + Telecine Premium + Telecine Touch + Terra Viva + TLC + TNT + TNT Novelas + TNT Séries + Tooncast + Travel Box Brasil + truTV + TV Aparecida + TV Brasil + TV Câmara + TV Cultura + Tv Gazeta + TV Rá Tim Bum + TV Senado + Universal TV + Viva + Warner + Woohoo + diff --git a/sites/guiadetv.com/guiadetv.com.config.js b/sites/guiadetv.com/guiadetv.com.config.js new file mode 100644 index 00000000..b63f49b2 --- /dev/null +++ b/sites/guiadetv.com/guiadetv.com.config.js @@ -0,0 +1,101 @@ +const cheerio = require('cheerio') +const axios = require('axios') +const dayjs = require('dayjs') +const customParseFormat = require('dayjs/plugin/customParseFormat') + +dayjs.extend(customParseFormat) + +require('dayjs/locale/pt') + +module.exports = { + site: 'guiadetv.com', + days: 2, + url({ channel }) { + return `https://www.guiadetv.com/canal/${channel.site_id}` + }, + parser({ content, date }) { + const programs = [] + const items = parseItems(content, date) + items.forEach(item => { + const prev = programs[programs.length - 1] + const $item = cheerio.load(item) + const title = parseTitle($item) + let start = parseStart($item) + if (!start || !title) return + if (prev) { + prev.stop = start + } + const stop = start.add(30, 'm') + + programs.push({ + title, + description: parseDescription($item), + category: parseCategory($item), + start, + stop + }) + }) + + return programs + }, + async channels() { + const categories = [ + 'variedades', + 'tv-aberta', + 'noticias', + 'infantil', + 'filmes-e-series', + 'esportes', + 'documentarios' + ] + const promises = categories.map(category => + axios.get(`https://www.guiadetv.com/categorias/${category}.html`) + ) + + const channels = [] + const results = await Promise.all(promises).catch(console.log) + results.forEach(r => { + const $ = cheerio.load(r.data) + $('.cardchannel').each((i, el) => { + const link = $(el).find('a') + const name = link.attr('title') + const url = link.attr('href') + const site_id = url.replace('https://www.guiadetv.com/canal/', '') + + channels.push({ + lang: 'pt', + name, + site_id + }) + }) + }) + + return channels + } +} + +function parseTitle($item) { + return $item('h3').text().trim() +} + +function parseDescription($item) { + return $item('p').clone().children().remove().end().text().trim() || null +} + +function parseCategory($item) { + return $item('p > i').text().trim() || null +} + +function parseStart($item) { + const dt = $item('b span:nth-child(1)').data('dt') || $item('b').data('dt') + if (!dt) return null + + return dayjs(dt, 'YYYY-MM-DD HH:mm:ssZ') +} + +function parseItems(content, date) { + const $ = cheerio.load(content) + const localDate = date.locale('pt').format('D MMMM YYYY') + + return $(`.row:contains(${localDate})`).nextUntil('.row:not(.mt-1)').toArray() +} diff --git a/sites/guiadetv.com/guiadetv.com.test.js b/sites/guiadetv.com/guiadetv.com.test.js new file mode 100644 index 00000000..d28bd6dd --- /dev/null +++ b/sites/guiadetv.com/guiadetv.com.test.js @@ -0,0 +1,80 @@ +const { parser, url } = require('./guiadetv.com.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('2025-01-18', 'YYYY-MM-DD').startOf('d') +const channel = { + site_id: 'canal-rural', + xmltv_id: 'CanalRural.br' +} + +it('can generate valid url', () => { + expect(url({ channel })).toBe('https://www.guiadetv.com/canal/canal-rural') +}) + +it('can parse response', () => { + const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html')) + const results = parser({ content, date }).map(p => { + p.start = p.start.toJSON() + p.stop = p.stop.toJSON() + return p + }) + + expect(results.length).toBe(16) + expect(results[0]).toMatchObject({ + start: '2025-01-18T03:00:00.000Z', + stop: '2025-01-18T04:00:00.000Z', + title: 'Leilão', + description: null, + category: null + }) + expect(results[2]).toMatchObject({ + start: '2025-01-18T06:00:00.000Z', + stop: '2025-01-18T09:00:00.000Z', + title: 'TV Verdade', + description: null, + category: 'Jornalismo' + }) + expect(results[15]).toMatchObject({ + start: '2025-01-19T00:00:00.000Z', + stop: '2025-01-19T00:30:00.000Z', + title: 'Leilão', + description: null, + category: null + }) +}) + +it('can parse response for current day', () => { + const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html')) + const results = parser({ content, date: dayjs.utc('2025-01-15', 'YYYY-MM-DD').startOf('d') }).map( + p => { + p.start = p.start.toJSON() + p.stop = p.stop.toJSON() + return p + } + ) + + expect(results.length).toBe(7) + expect(results[0]).toMatchObject({ + start: '2025-01-15T21:15:00.000Z', + stop: '2025-01-15T21:45:00.000Z', + title: 'Planeta Campo Talks', + description: + 'Grandes reportagens, notícias, entrevistas e debates com foco em ações de sustentabilidade e indicadores ESG. Informações para apoiar o produtor rural a plantar e criar com olhar para o futuro.', + category: null + }) +}) + +it('can handle empty guide', () => { + const results = parser({ + date, + content: fs.readFileSync(path.resolve(__dirname, '__data__/no_content.html')) + }) + + expect(results).toMatchObject([]) +}) diff --git a/sites/guiadetv.com/readme.md b/sites/guiadetv.com/readme.md new file mode 100644 index 00000000..0fafd64f --- /dev/null +++ b/sites/guiadetv.com/readme.md @@ -0,0 +1,21 @@ +# guiadetv.com + +https://www.guiadetv.com/programacao/ + +### Download the guide + +```sh +npm run grab --- --site=guiadetv.com +``` + +### Update channel list + +```sh +npm run channels:parse --- --config=./sites/guiadetv.com/guiadetv.com.config.js --output=./sites/guiadetv.com/guiadetv.com.channels.xml +``` + +### Test + +```sh +npm test --- guiadetv.com +```