mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 16:40:07 -04:00
Merge branch 'master' into pr/765
This commit is contained in:
commit
65cd9d150f
6 changed files with 5050 additions and 5752 deletions
1
.github/workflows/_check.yml
vendored
1
.github/workflows/_check.yml
vendored
|
@ -30,5 +30,4 @@ jobs:
|
|||
if: steps.files.outputs.any_changed == 'true'
|
||||
run: |
|
||||
npm install
|
||||
npm run channels:lint -- ${{ steps.files.outputs.all_changed_files }}
|
||||
npm run channels:validate -- ${{ steps.files.outputs.all_changed_files }}
|
||||
|
|
4697
package-lock.json
generated
4697
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -36,7 +36,7 @@
|
|||
"commander": "^8.2.0",
|
||||
"csv-parser": "^3.0.0",
|
||||
"dayjs": "^1.10.8",
|
||||
"epg-grabber": "^0.26.0",
|
||||
"epg-grabber": "^0.27.0",
|
||||
"epg-parser": "^0.1.6",
|
||||
"form-data": "^4.0.0",
|
||||
"fs-extra": "^10.0.1",
|
||||
|
@ -44,7 +44,7 @@
|
|||
"iconv-lite": "^0.4.24",
|
||||
"inquirer": "^8.2.0",
|
||||
"jest": "^27.3.1",
|
||||
"libxmljs": "^0.19.7",
|
||||
"libxmljs": "^0.19.9",
|
||||
"lodash": "^4.17.21",
|
||||
"markdown-include": "^0.4.3",
|
||||
"mockdate": "^3.0.5",
|
||||
|
|
|
@ -22,6 +22,7 @@ module.exports = {
|
|||
episode: item.content.episodeNumber || null,
|
||||
start: parseStart(item),
|
||||
stop: parseStop(item),
|
||||
url: parseURL(item),
|
||||
icon: parseIcon(item)
|
||||
})
|
||||
})
|
||||
|
@ -47,6 +48,10 @@ function parseStop(item) {
|
|||
return item.endtime ? dayjs(item.endtime) : null
|
||||
}
|
||||
|
||||
function parseURL(item) {
|
||||
return item.content.url ? `https://guidatv.sky.it${item.content.url}` : null
|
||||
}
|
||||
|
||||
function parseIcon(item) {
|
||||
const cover = item.content.imagesMap ? item.content.imagesMap.find(i => i.key === 'cover') : null
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ const customParseFormat = require('dayjs/plugin/customParseFormat')
|
|||
dayjs.extend(customParseFormat)
|
||||
dayjs.extend(utc)
|
||||
|
||||
const date = dayjs.utc('2022-04-01', 'YYYY-MM-DD').startOf('d')
|
||||
const date = dayjs.utc('2022-05-06', 'YYYY-MM-DD').startOf('d')
|
||||
const channel = {
|
||||
site_id: 'DTH#10458',
|
||||
xmltv_id: '20Mediaset.it'
|
||||
|
@ -15,12 +15,12 @@ const channel = {
|
|||
|
||||
it('can generate valid url', () => {
|
||||
expect(url({ channel, date })).toBe(
|
||||
'https://apid.sky.it/gtv/v1/events?from=2022-04-01T00:00:00Z&to=2022-04-02T00:00:00Z&pageSize=999&pageNum=0&env=DTH&channels=10458'
|
||||
'https://apid.sky.it/gtv/v1/events?from=2022-05-06T00:00:00Z&to=2022-05-07T00:00:00Z&pageSize=999&pageNum=0&env=DTH&channels=10458'
|
||||
)
|
||||
})
|
||||
|
||||
it('can parse response', () => {
|
||||
const content = `{"events":[{"channel":{"id":10458,"logo":"/logo/545820mediasethd_Light_Fit.png","logoPadding":"/logo/545820mediasethd_Light_Padding.png","logoDark":"/logo/545820mediasethd_Dark_Fit.png","logoDarkPadding":"/logo/545820mediasethd_Dark_Padding.png","logoLight":"/logo/545820mediasethd_Light_Padding.png","name":"20Mediaset HD","number":151,"category":{"id":3,"name":"Intrattenimento"}},"content":{"uuid":"1c35aa09-24e6-42e0-a2a0-2e58976ca793","contentTitle":"Shades of Blue","episodeNumber":2,"seasonNumber":3,"url":"/serie-tv/shades-of-blue/stagione-3/episodio-2/1c35aa09-24e6-42e0-a2a0-2e58976ca793","genre":{"id":1,"name":"Intrattenimento"},"subgenre":{"id":9,"name":"Fiction"},"imagesMap":[{"key":"background","img":{"url":"/uuid/1c35aa09-24e6-42e0-a2a0-2e58976ca793/background?md5ChecksumParam=311e053b4e6aacdd6cc25694c4d41a9a"}},{"key":"cover","img":{"url":"/uuid/1c35aa09-24e6-42e0-a2a0-2e58976ca793/cover?md5ChecksumParam=33cc326236e0894c5ba2a7a4795c3b5b"}},{"key":"scene","img":{"url":"/uuid/1c35aa09-24e6-42e0-a2a0-2e58976ca793/16-9?md5ChecksumParam=5756d4854b2f867b1764ee07fc2a18b8"}}]},"eventId":"138957327","starttime":"2022-04-01T00:24:28Z","endtime":"2022-04-01T01:04:28Z","eventTitle":"Shades of blue","eventSynopsis":"S3 Ep2 La vacuita' del potere - con J. Lopez - Harlee deve affrontare la perdita di Nava e non si da' per vinta nel credere che dietro al suo omicidio ci sia Ramsey.","epgEventTitle":"S3 Ep2 - Shades of blue","primeVision":false,"resolutions":[{"resolutionType":"resolution4k","value":false}]}]}`
|
||||
const content = `{"events": [ { "channel": { "id": 10458, "logo": "/logo/545820mediasethd_Light_Fit.png", "logoPadding": "/logo/545820mediasethd_Light_Padding.png", "logoDark": "/logo/545820mediasethd_Dark_Fit.png", "logoDarkPadding": "/logo/545820mediasethd_Dark_Padding.png", "logoLight": "/logo/545820mediasethd_Light_Padding.png", "name": "20Mediaset HD", "number": 151, "category": { "id": 3, "name": "Intrattenimento" } }, "content": { "uuid": "77c630aa-4744-44cb-a88e-3e871c6b73d9", "contentTitle": "Distretto di Polizia", "episodeNumber": 26, "seasonNumber": 6, "url": "/serie-tv/distretto-di-polizia/stagione-6/episodio-26/77c630aa-4744-44cb-a88e-3e871c6b73d9", "genre": { "id": 1, "name": "Intrattenimento" }, "subgenre": { "id": 9, "name": "Fiction" }, "imagesMap": [ { "key": "background", "img": { "url": "/uuid/77c630aa-4744-44cb-a88e-3e871c6b73d9/background?md5ChecksumParam=88d3f48ce855316f4be25ab9bb846d32" } }, { "key": "cover", "img": { "url": "/uuid/77c630aa-4744-44cb-a88e-3e871c6b73d9/cover?md5ChecksumParam=61135b999a63e3d3f4a933b9edeb0c1b" } }, { "key": "scene", "img": { "url": "/uuid/77c630aa-4744-44cb-a88e-3e871c6b73d9/16-9?md5ChecksumParam=f41bfe414bec32505abdab19d00b8b43" } } ] }, "eventId": "139585132", "starttime": "2022-05-06T00:35:40Z", "endtime": "2022-05-06T01:15:40Z", "eventTitle": "Distretto di Polizia", "eventSynopsis": "S6 Ep26 La resa dei conti - Fino all'ultimo la sfida tra Ardenzi e Carrano, nemici di vecchia data, riserva clamorosi colpi di scena. E si scopre che non e' tutto come sembrava.", "epgEventTitle": "S6 Ep26 - Distretto di Polizia", "primeVision": false, "resolutions": [ { "resolutionType": "resolution4k", "value": false } ] }]}`
|
||||
const result = parser({ content }).map(p => {
|
||||
p.start = p.start.toJSON()
|
||||
p.stop = p.stop.toJSON()
|
||||
|
@ -29,15 +29,16 @@ it('can parse response', () => {
|
|||
|
||||
expect(result).toMatchObject([
|
||||
{
|
||||
start: '2022-04-01T00:24:28.000Z',
|
||||
stop: '2022-04-01T01:04:28.000Z',
|
||||
title: 'Shades of blue',
|
||||
start: '2022-05-06T00:35:40.000Z',
|
||||
stop: '2022-05-06T01:15:40.000Z',
|
||||
title: 'Distretto di Polizia',
|
||||
description:
|
||||
"S3 Ep2 La vacuita' del potere - con J. Lopez - Harlee deve affrontare la perdita di Nava e non si da' per vinta nel credere che dietro al suo omicidio ci sia Ramsey.",
|
||||
season: 3,
|
||||
episode: 2,
|
||||
icon: 'https://guidatv.sky.it/uuid/1c35aa09-24e6-42e0-a2a0-2e58976ca793/cover?md5ChecksumParam=33cc326236e0894c5ba2a7a4795c3b5b',
|
||||
category: 'Intrattenimento/Fiction'
|
||||
"S6 Ep26 La resa dei conti - Fino all'ultimo la sfida tra Ardenzi e Carrano, nemici di vecchia data, riserva clamorosi colpi di scena. E si scopre che non e' tutto come sembrava.",
|
||||
season: 6,
|
||||
episode: 26,
|
||||
icon: 'https://guidatv.sky.it/uuid/77c630aa-4744-44cb-a88e-3e871c6b73d9/cover?md5ChecksumParam=61135b999a63e3d3f4a933b9edeb0c1b',
|
||||
category: 'Intrattenimento/Fiction',
|
||||
url: 'https://guidatv.sky.it/serie-tv/distretto-di-polizia/stagione-6/episodio-26/77c630aa-4744-44cb-a88e-3e871c6b73d9'
|
||||
}
|
||||
])
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue