Fix gatotv.com

This commit is contained in:
Aleksandr Statciuk 2022-05-10 20:11:19 +03:00
parent ec19910902
commit 42720ad62c
2 changed files with 12 additions and 12 deletions

View file

@ -82,14 +82,14 @@ function parseStart($item, date) {
let time = $item('td:nth-child(1) > div > time').attr('datetime') let time = $item('td:nth-child(1) > div > time').attr('datetime')
time = `${date.format('YYYY-MM-DD')} ${time}` time = `${date.format('YYYY-MM-DD')} ${time}`
return dayjs.tz(time, 'YYYY-MM-DD HH:mm', dayjs.tz.guess()) return dayjs.tz(time, 'YYYY-MM-DD HH:mm', 'America/New_York')
} }
function parseStop($item, date) { function parseStop($item, date) {
let time = $item('td:nth-child(2) > div > time').attr('datetime') let time = $item('td:nth-child(2) > div > time').attr('datetime')
time = `${date.format('YYYY-MM-DD')} ${time}` time = `${date.format('YYYY-MM-DD')} ${time}`
return dayjs.tz(time, 'YYYY-MM-DD HH:mm', dayjs.tz.guess()) return dayjs.tz(time, 'YYYY-MM-DD HH:mm', 'America/New_York')
} }
function parseItems(content) { function parseItems(content) {

View file

@ -29,34 +29,34 @@ it('can parse response', () => {
expect(result).toMatchObject([ expect(result).toMatchObject([
{ {
start: '2021-11-12T23:00:00.000Z', start: '2021-11-13T04:00:00.000Z',
stop: '2021-11-13T00:30:00.000Z', stop: '2021-11-13T05:30:00.000Z',
title: 'Bienvenidos a bordo' title: 'Bienvenidos a bordo'
}, },
{ {
start: '2021-11-13T00:30:00.000Z', start: '2021-11-13T05:30:00.000Z',
stop: '2021-11-13T01:45:00.000Z', stop: '2021-11-13T06:45:00.000Z',
title: 'Ciudad de sombras' title: 'Ciudad de sombras'
}, },
{ {
start: '2021-11-13T01:45:00.000Z', start: '2021-11-13T06:45:00.000Z',
stop: '2021-11-13T03:30:00.000Z', stop: '2021-11-13T08:30:00.000Z',
title: 'Rascacielos: Rescate en las Alturas', title: 'Rascacielos: Rescate en las Alturas',
icon: 'https://imagenes.gatotv.com/categorias/peliculas/miniatura/rascacielos.jpg', icon: 'https://imagenes.gatotv.com/categorias/peliculas/miniatura/rascacielos.jpg',
description: description:
'Cuando un ex rescatista de rehenes del FBI evalúa la seguridad de un rascacielos en China, un incendio repentino hace que sea acusado injustamente.' 'Cuando un ex rescatista de rehenes del FBI evalúa la seguridad de un rascacielos en China, un incendio repentino hace que sea acusado injustamente.'
}, },
{ {
start: '2021-11-13T13:30:00.000Z', start: '2021-11-13T18:30:00.000Z',
stop: '2021-11-13T13:41:00.000Z', stop: '2021-11-13T18:41:00.000Z',
title: 'Los Jóvenes Titanes En Acción', title: 'Los Jóvenes Titanes En Acción',
icon: 'https://imagenes.gatotv.com/categorias/caricaturas/miniatura/los_jovenes_titanes_en_accion.jpg', icon: 'https://imagenes.gatotv.com/categorias/caricaturas/miniatura/los_jovenes_titanes_en_accion.jpg',
description: description:
'Robin, Starfire, Raven, Chico Bestia y Cyborg se preparan para nuevas aventuras cómicas después de hacer un sándwich, jugar algún videojuego o lavar la ropa.' 'Robin, Starfire, Raven, Chico Bestia y Cyborg se preparan para nuevas aventuras cómicas después de hacer un sándwich, jugar algún videojuego o lavar la ropa.'
}, },
{ {
start: '2021-11-13T23:55:00.000Z', start: '2021-11-14T04:55:00.000Z',
stop: '2021-11-14T04:00:00.000Z', stop: '2021-11-14T09:00:00.000Z',
title: 'Decisión 2021' title: 'Decisión 2021'
} }
]) ])