Merge pull request #2402 from iptv-org/patch-2024.06.1

Patch 2024.06.1
This commit is contained in:
PopeyeTheSai10r 2024-06-29 20:04:03 -07:00 committed by GitHub
commit 85939cddfd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
173 changed files with 480 additions and 403 deletions

66
package-lock.json generated
View file

@ -31,7 +31,7 @@
"csv-parser": "^3.0.0", "csv-parser": "^3.0.0",
"cwait": "^1.1.2", "cwait": "^1.1.2",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"epg-grabber": "^0.36.1", "epg-grabber": "^0.37.1",
"epg-parser": "^0.2.0", "epg-parser": "^0.2.0",
"eslint": "^8.17.0", "eslint": "^8.17.0",
"eslint-config-prettier": "^9.0.0", "eslint-config-prettier": "^9.0.0",
@ -2980,11 +2980,11 @@
} }
}, },
"node_modules/braces": { "node_modules/braces": {
"version": "3.0.2", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"dependencies": { "dependencies": {
"fill-range": "^7.0.1" "fill-range": "^7.1.1"
}, },
"engines": { "engines": {
"node": ">=8" "node": ">=8"
@ -3936,9 +3936,9 @@
} }
}, },
"node_modules/epg-grabber": { "node_modules/epg-grabber": {
"version": "0.36.1", "version": "0.37.1",
"resolved": "https://registry.npmjs.org/epg-grabber/-/epg-grabber-0.36.1.tgz", "resolved": "https://registry.npmjs.org/epg-grabber/-/epg-grabber-0.37.1.tgz",
"integrity": "sha512-i11ZtCjUWg8lNEq6K2IesSIBDhjPpcT2Mkge7249jK95bOfslvTKM6w+nt2DNamtdMcu512dVpcU9SphyjR4OA==", "integrity": "sha512-Q5gFLhrQGe+ou97Rs/VBRLgtYxSsnwzUEXs/V0cVmJhwpQedwMlG4VyEcc1TUDm53A+61T5fTtpmCsNUVb9N3g==",
"dependencies": { "dependencies": {
"axios": "^1.6.1", "axios": "^1.6.1",
"axios-cache-interceptor": "^0.10.3", "axios-cache-interceptor": "^0.10.3",
@ -4456,9 +4456,9 @@
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="
}, },
"node_modules/fill-range": { "node_modules/fill-range": {
"version": "7.0.1", "version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"dependencies": { "dependencies": {
"to-regex-range": "^5.0.1" "to-regex-range": "^5.0.1"
}, },
@ -4501,9 +4501,9 @@
"integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw=="
}, },
"node_modules/follow-redirects": { "node_modules/follow-redirects": {
"version": "1.15.0", "version": "1.15.6",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.0.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
"integrity": "sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ==", "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
"funding": [ "funding": [
{ {
"type": "individual", "type": "individual",
@ -7840,9 +7840,9 @@
} }
}, },
"node_modules/tar": { "node_modules/tar": {
"version": "6.2.0", "version": "6.2.1",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz",
"integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==",
"dependencies": { "dependencies": {
"chownr": "^2.0.0", "chownr": "^2.0.0",
"fs-minipass": "^2.0.0", "fs-minipass": "^2.0.0",
@ -10642,11 +10642,11 @@
} }
}, },
"braces": { "braces": {
"version": "3.0.2", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"requires": { "requires": {
"fill-range": "^7.0.1" "fill-range": "^7.1.1"
} }
}, },
"browserslist": { "browserslist": {
@ -11321,9 +11321,9 @@
"integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==" "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA=="
}, },
"epg-grabber": { "epg-grabber": {
"version": "0.36.1", "version": "0.37.1",
"resolved": "https://registry.npmjs.org/epg-grabber/-/epg-grabber-0.36.1.tgz", "resolved": "https://registry.npmjs.org/epg-grabber/-/epg-grabber-0.37.1.tgz",
"integrity": "sha512-i11ZtCjUWg8lNEq6K2IesSIBDhjPpcT2Mkge7249jK95bOfslvTKM6w+nt2DNamtdMcu512dVpcU9SphyjR4OA==", "integrity": "sha512-Q5gFLhrQGe+ou97Rs/VBRLgtYxSsnwzUEXs/V0cVmJhwpQedwMlG4VyEcc1TUDm53A+61T5fTtpmCsNUVb9N3g==",
"requires": { "requires": {
"axios": "^1.6.1", "axios": "^1.6.1",
"axios-cache-interceptor": "^0.10.3", "axios-cache-interceptor": "^0.10.3",
@ -11718,9 +11718,9 @@
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="
}, },
"fill-range": { "fill-range": {
"version": "7.0.1", "version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"requires": { "requires": {
"to-regex-range": "^5.0.1" "to-regex-range": "^5.0.1"
} }
@ -11754,9 +11754,9 @@
"integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw=="
}, },
"follow-redirects": { "follow-redirects": {
"version": "1.15.0", "version": "1.15.6",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.0.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
"integrity": "sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ==" "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA=="
}, },
"foreground-child": { "foreground-child": {
"version": "3.1.1", "version": "3.1.1",
@ -14174,9 +14174,9 @@
} }
}, },
"tar": { "tar": {
"version": "6.2.0", "version": "6.2.1",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz",
"integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==",
"requires": { "requires": {
"chownr": "^2.0.0", "chownr": "^2.0.0",
"fs-minipass": "^2.0.0", "fs-minipass": "^2.0.0",

View file

@ -50,7 +50,7 @@
"csv-parser": "^3.0.0", "csv-parser": "^3.0.0",
"cwait": "^1.1.2", "cwait": "^1.1.2",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"epg-grabber": "^0.36.1", "epg-grabber": "^0.37.1",
"epg-parser": "^0.2.0", "epg-parser": "^0.2.0",
"eslint": "^8.17.0", "eslint": "^8.17.0",
"eslint-config-prettier": "^9.0.0", "eslint-config-prettier": "^9.0.0",

View file

@ -27,7 +27,7 @@ module.exports = {
const stop = start.add(1, 'h') const stop = start.add(1, 'h')
programs.push({ programs.push({
title: parseTitle($item), title: parseTitle($item),
icon: parseIcon($item), image: parseImage($item),
description: parseDescription($item), description: parseDescription($item),
start, start,
stop stop
@ -44,7 +44,7 @@ function parseStart($item, date) {
return dayjs.tz(`${date.format('YYYY-MM-DD')} ${time}`, 'YYYY-MM-DD HH:mm', 'Asia/Jerusalem') return dayjs.tz(`${date.format('YYYY-MM-DD')} ${time}`, 'YYYY-MM-DD HH:mm', 'Asia/Jerusalem')
} }
function parseIcon($item) { function parseImage($item) {
const backgroundImage = $item('a > div.guide_info_group > div.guide_info_pict').css( const backgroundImage = $item('a > div.guide_info_group > div.guide_info_pict').css(
'background-image' 'background-image'
) )

View file

@ -31,14 +31,14 @@ it('can parse response', () => {
start: '2022-03-06T04:30:00.000Z', start: '2022-03-06T04:30:00.000Z',
stop: '2022-03-06T07:10:00.000Z', stop: '2022-03-06T07:10:00.000Z',
title: 'Слепая', title: 'Слепая',
icon: 'https://www.9tv.co.il/download/pictures/img_id=8484.jpg', image: 'https://www.9tv.co.il/download/pictures/img_id=8484.jpg',
description: description:
'Она не очень любит говорить о себе или о том, кто и зачем к ней обращается. Живет уединенно, в глуши. Но тех, кто приходит -принимает. Она видит судьбы.' 'Она не очень любит говорить о себе или о том, кто и зачем к ней обращается. Живет уединенно, в глуши. Но тех, кто приходит -принимает. Она видит судьбы.'
}, },
{ {
start: '2022-03-06T07:10:00.000Z', start: '2022-03-06T07:10:00.000Z',
stop: '2022-03-06T08:10:00.000Z', stop: '2022-03-06T08:10:00.000Z',
icon: 'https://www.9tv.co.il/download/pictures/img_id=23694.jpg', image: 'https://www.9tv.co.il/download/pictures/img_id=23694.jpg',
title: 'Орел и решка. Морской сезон', title: 'Орел и решка. Морской сезон',
description: 'Орел и решка. Морской сезон. Ведущие -Алина Астровская и Коля Серга.' description: 'Орел и решка. Морской сезон. Ведущие -Алина Астровская и Коля Серга.'
} }

View file

@ -33,7 +33,7 @@ module.exports = {
season: parseSeason(item), season: parseSeason(item),
episode: parseEpisode(item), episode: parseEpisode(item),
rating: parseRating(item), rating: parseRating(item),
icon: parseIcon(item), image: parseImage(item),
start: parseTime(item.start_time), start: parseTime(item.start_time),
stop: parseTime(item.end_time) stop: parseTime(item.end_time)
}) })
@ -106,7 +106,7 @@ function parseEpisode(item) {
function parseTime(time) { function parseTime(time) {
return dayjs.tz(time, 'YYYY-MM-DD HH:mm', 'Australia/Sydney') return dayjs.tz(time, 'YYYY-MM-DD HH:mm', 'Australia/Sydney')
} }
function parseIcon(item) { function parseImage(item) {
return item.image_file return item.image_file
? `https://www.abc.net.au/tv/common/images/publicity/${item.image_file}` ? `https://www.abc.net.au/tv/common/images/publicity/${item.image_file}`
: null : null

View file

@ -35,7 +35,7 @@ it('can parse response', () => {
}, },
season: 22, season: 22,
episode: 4, episode: 4,
icon: 'https://www.abc.net.au/tv/common/images/publicity/ZW2178A004S00_460.jpg', image: 'https://www.abc.net.au/tv/common/images/publicity/ZW2178A004S00_460.jpg',
start: '2022-12-21T13:46:00.000Z', start: '2022-12-21T13:46:00.000Z',
stop: '2022-12-21T14:44:00.000Z' stop: '2022-12-21T14:44:00.000Z'
} }

View file

@ -22,7 +22,7 @@ module.exports = {
title: item.title, title: item.title,
category: item.details.categories, category: item.details.categories,
description: item.details.description, description: item.details.description,
icon: item.details.image, image: item.details.image,
season: parseSeason(item), season: parseSeason(item),
episode: parseEpisode(item), episode: parseEpisode(item),
start, start,

View file

@ -32,7 +32,8 @@ it('can parse response', () => {
category: ['other'], category: ['other'],
description: description:
'Svenskt träningsprogram från 2021. Styrka. Sofia Åhman leder SVT:s hemmagympapass. Denna gång fokuserar vi på styrka.', 'Svenskt träningsprogram från 2021. Styrka. Sofia Åhman leder SVT:s hemmagympapass. Denna gång fokuserar vi på styrka.',
icon: 'https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/21/2022-08-22/se.cs.svt1.event.A_41214031600.jpg?size=2560x1440', image:
'https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/21/2022-08-22/se.cs.svt1.event.A_41214031600.jpg?size=2560x1440',
season: 4, season: 4,
episode: 1 episode: 1
} }

View file

@ -22,7 +22,7 @@ module.exports = {
title: item.title, title: item.title,
category: item.details.categories, category: item.details.categories,
description: item.details.description, description: item.details.description,
icon: item.details.image, image: item.details.image,
season: parseSeason(item), season: parseSeason(item),
episode: parseEpisode(item), episode: parseEpisode(item),
start, start,

View file

@ -32,7 +32,8 @@ it('can parse response', () => {
category: ['other'], category: ['other'],
description: description:
'Svenskt träningsprogram från 2021. Styrka. Sofia Åhman leder SVT:s hemmagympapass. Denna gång fokuserar vi på styrka.', 'Svenskt träningsprogram från 2021. Styrka. Sofia Åhman leder SVT:s hemmagympapass. Denna gång fokuserar vi på styrka.',
icon: 'https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/21/2022-08-22/se.cs.svt1.event.A_41214031600.jpg?size=2560x1440', image:
'https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/21/2022-08-22/se.cs.svt1.event.A_41214031600.jpg?size=2560x1440',
season: 4, season: 4,
episode: 1 episode: 1
} }

View file

@ -22,7 +22,7 @@ module.exports = {
title: item.title, title: item.title,
category: item.details.categories, category: item.details.categories,
description: item.details.description, description: item.details.description,
icon: item.details.image, image: item.details.image,
season: parseSeason(item), season: parseSeason(item),
episode: parseEpisode(item), episode: parseEpisode(item),
start, start,

View file

@ -32,7 +32,8 @@ it('can parse response', () => {
category: ['other'], category: ['other'],
description: description:
'Svenskt träningsprogram från 2021. Styrka. Sofia Åhman leder SVT:s hemmagympapass. Denna gång fokuserar vi på styrka.', 'Svenskt träningsprogram från 2021. Styrka. Sofia Åhman leder SVT:s hemmagympapass. Denna gång fokuserar vi på styrka.',
icon: 'https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/21/2022-08-22/se.cs.svt1.event.A_41214031600.jpg?size=2560x1440', image:
'https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/21/2022-08-22/se.cs.svt1.event.A_41214031600.jpg?size=2560x1440',
season: 4, season: 4,
episode: 1 episode: 1
} }

View file

@ -22,7 +22,7 @@ module.exports = {
title: item.title, title: item.title,
category: item.details.categories, category: item.details.categories,
description: item.details.description, description: item.details.description,
icon: item.details.image, image: item.details.image,
season: parseSeason(item), season: parseSeason(item),
episode: parseEpisode(item), episode: parseEpisode(item),
start, start,

View file

@ -32,7 +32,8 @@ it('can parse response', () => {
category: ['other'], category: ['other'],
description: description:
'Svenskt träningsprogram från 2021. Styrka. Sofia Åhman leder SVT:s hemmagympapass. Denna gång fokuserar vi på styrka.', 'Svenskt träningsprogram från 2021. Styrka. Sofia Åhman leder SVT:s hemmagympapass. Denna gång fokuserar vi på styrka.',
icon: 'https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/21/2022-08-22/se.cs.svt1.event.A_41214031600.jpg?size=2560x1440', image:
'https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/21/2022-08-22/se.cs.svt1.event.A_41214031600.jpg?size=2560x1440',
season: 4, season: 4,
episode: 1 episode: 1
} }

View file

@ -62,7 +62,7 @@ module.exports = {
title: item.displayNm, title: item.displayNm,
start: parseStart(item), start: parseStart(item),
stop: parseStop(item), stop: parseStop(item),
icon: parseIcon(programDetail), image: parseImage(programDetail),
category: parseCategory(programDetail), category: parseCategory(programDetail),
description: parseDescription(programDetail) description: parseDescription(programDetail)
}) })
@ -121,7 +121,7 @@ async function parseProgramDetail(item) {
}) })
} }
function parseIcon(programDetail) { function parseImage(programDetail) {
if (programDetail && programDetail.image && programDetail.image[0].url) { if (programDetail && programDetail.image && programDetail.image[0].url) {
return programDetail.image[0].url return programDetail.image[0].url
} else { } else {

View file

@ -64,7 +64,8 @@ it('can parse response', async () => {
title: 'WITHIN THE FRAME [R]', title: 'WITHIN THE FRAME [R]',
start: dayjs.tz(date, 'Asia/Seoul'), start: dayjs.tz(date, 'Asia/Seoul'),
stop: dayjs.tz(date, 'Asia/Seoul').add(30, 'minute'), stop: dayjs.tz(date, 'Asia/Seoul').add(30, 'minute'),
icon: 'https://img.arirang.com/v1/AUTH_d52449c16d3b4bbca17d4fffd9fc44af/public/images/202308/2080840096998752900.png', image:
'https://img.arirang.com/v1/AUTH_d52449c16d3b4bbca17d4fffd9fc44af/public/images/202308/2080840096998752900.png',
description: 'NEWS', description: 'NEWS',
category: 'Current Affairs' category: 'Current Affairs'
}) })

View file

@ -33,14 +33,14 @@ module.exports = {
if (!content) return programs if (!content) return programs
const items = JSON.parse(content) const items = JSON.parse(content)
items.forEach(item => { items.forEach(item => {
const icon = parseIcon(item) const image = parseImage(item)
const start = parseStart(item) const start = parseStart(item)
const duration = parseDuration(item) const duration = parseDuration(item)
const stop = start.add(duration, 's') const stop = start.add(duration, 's')
programs.push({ programs.push({
title: item.title, title: item.title,
description: item.description, description: item.description,
icon, image,
start, start,
stop stop
}) })
@ -63,6 +63,6 @@ function parseDuration(item) {
return parseInt(HH) * 3600 + parseInt(mm) * 60 + parseInt(ss) return parseInt(HH) * 3600 + parseInt(mm) * 60 + parseInt(ss)
} }
function parseIcon(item) { function parseImage(item) {
return item.thumbnail ? `https://www.artonline.tv${item.thumbnail}` : null return item.thumbnail ? `https://www.artonline.tv${item.thumbnail}` : null
} }

View file

@ -52,7 +52,7 @@ it('can parse response', () => {
title: 'الراقصه و السياسي', title: 'الراقصه و السياسي',
description: description:
'تقرر الراقصه سونيا انشاء دار حضانه للأطفال اليتامى و عندما تتقدم بمشورعها للمسئول يرفض فتتحداه ، تلجأ للوزير عبد الحميد رأفت تربطه بها علاقة قديمة ، يخشى على مركزه و يرفض مساعدتها فتقرر كتابة مذكراتها بمساعدة أحد الصحفيين ، يتخوف عبد الحميد و المسئولين ثم يفاجأ عبد الحميد بحصول سونيا على الموافقه للمشورع و البدء في تنفيذه و ذلك لعلاقتها بأحد كبار المسئولين .', 'تقرر الراقصه سونيا انشاء دار حضانه للأطفال اليتامى و عندما تتقدم بمشورعها للمسئول يرفض فتتحداه ، تلجأ للوزير عبد الحميد رأفت تربطه بها علاقة قديمة ، يخشى على مركزه و يرفض مساعدتها فتقرر كتابة مذكراتها بمساعدة أحد الصحفيين ، يتخوف عبد الحميد و المسئولين ثم يفاجأ عبد الحميد بحصول سونيا على الموافقه للمشورع و البدء في تنفيذه و ذلك لعلاقتها بأحد كبار المسئولين .',
icon: 'https://www.artonline.tv/UploadImages/Channel/ARTAFLAM1/03/AlRaqesaWaAlSeyasi.jpg' image: 'https://www.artonline.tv/UploadImages/Channel/ARTAFLAM1/03/AlRaqesaWaAlSeyasi.jpg'
} }
]) ])
}) })

View file

@ -48,7 +48,7 @@ module.exports = {
programs.push({ programs.push({
title: parseTitle($item), title: parseTitle($item),
categories: parseCategories($item), categories: parseCategories($item),
icon: parseIcon($item), image: parseImage($item),
start, start,
stop stop
}) })
@ -84,7 +84,7 @@ function parseTitle($item) {
.trim() .trim()
} }
function parseIcon($item) { function parseImage($item) {
return $item('img').data('src') || $item('img').attr('src') || null return $item('img').data('src') || $item('img').attr('src') || null
} }

View file

@ -51,7 +51,7 @@ it('can parse response', () => {
start: '2023-02-12T09:30:00.000Z', start: '2023-02-12T09:30:00.000Z',
stop: '2023-02-12T10:30:00.000Z', stop: '2023-02-12T10:30:00.000Z',
title: 'Revista agropecuaria', title: 'Revista agropecuaria',
icon: 'https://www.reportv.com.ar/buscador/img/Programas/2797844.jpg', image: 'https://www.reportv.com.ar/buscador/img/Programas/2797844.jpg',
categories: [] categories: []
}) })
@ -59,7 +59,7 @@ it('can parse response', () => {
start: '2023-02-12T12:30:00.000Z', start: '2023-02-12T12:30:00.000Z',
stop: '2023-02-12T13:30:00.000Z', stop: '2023-02-12T13:30:00.000Z',
title: 'De pago en pago', title: 'De pago en pago',
icon: 'https://www.reportv.com.ar/buscador/img/Programas/3772835.jpg', image: 'https://www.reportv.com.ar/buscador/img/Programas/3772835.jpg',
categories: ['Cultural'] categories: ['Cultural']
}) })
}) })

View file

@ -23,7 +23,7 @@ module.exports = {
title: item.title, title: item.title,
description: parseDescription(detail), description: parseDescription(detail),
category: parseCategory(detail), category: parseCategory(detail),
icon: parseIcon(item), image: parseImage(item),
start: parseStart(item), start: parseStart(item),
stop: parseStop(item) stop: parseStop(item)
}) })
@ -70,7 +70,7 @@ function parseDescription(detail) {
function parseCategory(detail) { function parseCategory(detail) {
return detail.detail.informations.subGenre || null return detail.detail.informations.subGenre || null
} }
function parseIcon(item) { function parseImage(item) {
return item.URLImage || item.URLImageDefault return item.URLImage || item.URLImageDefault
} }

View file

@ -149,7 +149,8 @@ it('can parse response', done => {
start: '2022-08-17T23:55:00.000Z', start: '2022-08-17T23:55:00.000Z',
stop: '2022-08-18T00:40:00.000Z', stop: '2022-08-18T00:40:00.000Z',
title: 'New Amsterdam - S3 - Ep7', title: 'New Amsterdam - S3 - Ep7',
icon: 'https://service.canal-overseas.com/image-api/v1/image/52a18a209e28380b199201961c27097e', image:
'https://service.canal-overseas.com/image-api/v1/image/52a18a209e28380b199201961c27097e',
category: 'Série Hôpital', category: 'Série Hôpital',
description: description:
"C'est la journée nationale de dépistage du VIH et Max offre des soins gratuits à tous les malades séropositifs qui se présentent à New Amsterdam." "C'est la journée nationale de dépistage du VIH et Max offre des soins gratuits à tous les malades séropositifs qui se présentent à New Amsterdam."

View file

@ -32,7 +32,7 @@ module.exports = {
programs.push({ programs.push({
title: item.title, title: item.title,
description: parseDescription(info), description: parseDescription(info),
icon: parseIcon(info), image: parseImage(info),
actors: parseCast(info, 'Avec :'), actors: parseCast(info, 'Avec :'),
director: parseCast(info, 'De :'), director: parseCast(info, 'De :'),
writer: parseCast(info, 'Scénario :'), writer: parseCast(info, 'Scénario :'),
@ -123,7 +123,7 @@ function parseStart(item) {
return item && item.startTime ? dayjs(item.startTime) : null return item && item.startTime ? dayjs(item.startTime) : null
} }
function parseIcon(info) { function parseImage(info) {
return info ? info.URLImage : null return info ? info.URLImage : null
} }

View file

@ -96,7 +96,8 @@ it('can parse response', done => {
title: 'Le cercle', title: 'Le cercle',
description: description:
"Tant qu'il y aura du cinéma, LE CERCLE sera là. C'est la seule émission télévisée de débats critiques 100% consacrée au cinéma et elle rentre dans sa 18e saison. Chaque semaine, elle offre des joutes enflammées, joyeuses et sans condescendance, sur les films à l'affiche ; et invite avec \"Le questionnaire du CERCLE\" les réalisatrices et réalisateurs à venir partager leur passion cinéphile.", "Tant qu'il y aura du cinéma, LE CERCLE sera là. C'est la seule émission télévisée de débats critiques 100% consacrée au cinéma et elle rentre dans sa 18e saison. Chaque semaine, elle offre des joutes enflammées, joyeuses et sans condescendance, sur les films à l'affiche ; et invite avec \"Le questionnaire du CERCLE\" les réalisatrices et réalisateurs à venir partager leur passion cinéphile.",
icon: 'https://thumb.canalplus.pro/http/unsafe/{resolutionXY}/filters:quality({imageQualityPercentage})/img-hapi.canalplus.pro:80/ServiceImage/ImageID/107297573', image:
'https://thumb.canalplus.pro/http/unsafe/{resolutionXY}/filters:quality({imageQualityPercentage})/img-hapi.canalplus.pro:80/ServiceImage/ImageID/107297573',
presenter: ['Lily Bloom'], presenter: ['Lily Bloom'],
rating: { rating: {
system: 'CSA', system: 'CSA',
@ -109,7 +110,8 @@ it('can parse response', done => {
title: 'Illusions perdues', title: 'Illusions perdues',
description: description:
"Pendant la Restauration, Lucien de Rubempré, jeune provincial d'Angoulême, se rêve poète. Il débarque à Paris en quête de gloire. Il a le soutien de Louise de Bargeton, une aristocrate qui croit en son talent. Pour gagner sa vie, Lucien trouve un emploi dans le journal dirigé par le peu scrupuleux Etienne Lousteau...", "Pendant la Restauration, Lucien de Rubempré, jeune provincial d'Angoulême, se rêve poète. Il débarque à Paris en quête de gloire. Il a le soutien de Louise de Bargeton, une aristocrate qui croit en son talent. Pour gagner sa vie, Lucien trouve un emploi dans le journal dirigé par le peu scrupuleux Etienne Lousteau...",
icon: 'https://thumb.canalplus.pro/http/unsafe/{resolutionXY}/filters:quality({imageQualityPercentage})/img-hapi.canalplus.pro:80/ServiceImage/ImageID/107356485', image:
'https://thumb.canalplus.pro/http/unsafe/{resolutionXY}/filters:quality({imageQualityPercentage})/img-hapi.canalplus.pro:80/ServiceImage/ImageID/107356485',
director: ['Xavier Giannoli'], director: ['Xavier Giannoli'],
actors: [ actors: [
'Benjamin Voisin', 'Benjamin Voisin',

View file

@ -19,7 +19,7 @@ module.exports = {
title: item.season?.serie?.title ? item.season.serie.title : item.title, title: item.season?.serie?.title ? item.season.serie.title : item.title,
category: item.genreDetailed, category: item.genreDetailed,
description: item.synopsis, description: item.synopsis,
icon: parseIcon(item), image: parseImage(item),
start: start.toJSON(), start: start.toJSON(),
stop: stop.toJSON() stop: stop.toJSON()
}) })
@ -49,7 +49,7 @@ module.exports = {
} }
} }
function parseIcon(item) { function parseImage(item) {
return item.covers && item.covers.length ? item.covers[0].url : null return item.covers && item.covers.length ? item.covers[0].url : null
} }

View file

@ -30,7 +30,7 @@ it('can parse response', () => {
description: description:
"Un tueur en série prend un plaisir pervers à prévenir les autorités de Tallahassee avant chaque nouveau meurtre. Rossi apprend le décès d'un de ses vieux amis.", "Un tueur en série prend un plaisir pervers à prévenir les autorités de Tallahassee avant chaque nouveau meurtre. Rossi apprend le décès d'un de ses vieux amis.",
category: 'Série Suspense', category: 'Série Suspense',
icon: 'https://proxymedia.woopic.com/340/p/169_EMI_9697669.jpg' image: 'https://proxymedia.woopic.com/340/p/169_EMI_9697669.jpg'
} }
]) ])
}) })

View file

@ -26,7 +26,7 @@ module.exports = {
description: details.longSynopsis || details.shortSynopsis, description: details.longSynopsis || details.shortSynopsis,
actors: parseList(details.cast), actors: parseList(details.cast),
directors: parseList(details.director), directors: parseList(details.director),
icon: details.imageUrl, image: details.imageUrl,
rating: parseRating(details), rating: parseRating(details),
categories: parseCategories(details), categories: parseCategories(details),
episode: parseEpisode(item), episode: parseEpisode(item),

View file

@ -52,7 +52,7 @@ it('can parse response', async () => {
'This classic drama depicts the many aspects of two complicated relationships set against an airline company. Will those involved ever find true love?', 'This classic drama depicts the many aspects of two complicated relationships set against an airline company. Will those involved ever find true love?',
actors: ['Francis Ng Chun Yu', 'Joe Ma Tak Chung', 'Flora Chan Wai San'], actors: ['Francis Ng Chun Yu', 'Joe Ma Tak Chung', 'Flora Chan Wai San'],
directors: ['Joe Ma Tak Chung'], directors: ['Joe Ma Tak Chung'],
icon: 'https://s3-ap-southeast-1.amazonaws.com/ams-astro/production/images/1035X328883.jpg', image: 'https://s3-ap-southeast-1.amazonaws.com/ams-astro/production/images/1035X328883.jpg',
rating: { rating: {
system: 'LPF', system: 'LPF',
value: 'U' value: 'U'

View file

@ -38,7 +38,7 @@ module.exports = {
category: item.subcategoryList, category: item.subcategoryList,
season: item.seasonNumber, season: item.seasonNumber,
episode: item.episodeNumber, episode: item.episodeNumber,
icon: parseIcon(item), image: parseImage(item),
start, start,
stop stop
}) })
@ -92,7 +92,7 @@ function parseRating(item) {
} }
: null : null
} }
function parseIcon(item) { function parseImage(item) {
return item.primaryImageUrl ? `https://www.directv.com${item.primaryImageUrl}` : null return item.primaryImageUrl ? `https://www.directv.com${item.primaryImageUrl}` : null
} }
function loadProgramDetail(programID) { function loadProgramDetail(programID) {

View file

@ -56,7 +56,7 @@ it('can parse response', done => {
description: description:
'Kay (Tommy Lee Jones) and Jay (Will Smith) reunite to provide our best line of defense against a seductress who levels the toughest challenge yet to the MIBs mission statement: protecting the earth from the scum of the universe. While investigating a routine crime, Jay uncovers a plot masterminded by Serleena (Boyle), a Kylothian monster who disguises herself as a lingerie model. When Serleena takes the MIB building hostage, there is only one person Jay can turn to -- his former MIB partner.', 'Kay (Tommy Lee Jones) and Jay (Will Smith) reunite to provide our best line of defense against a seductress who levels the toughest challenge yet to the MIBs mission statement: protecting the earth from the scum of the universe. While investigating a routine crime, Jay uncovers a plot masterminded by Serleena (Boyle), a Kylothian monster who disguises herself as a lingerie model. When Serleena takes the MIB building hostage, there is only one person Jay can turn to -- his former MIB partner.',
date: '2002', date: '2002',
icon: 'https://www.directv.com/db_photos/movies/AllPhotosAPGI/29160/29160_aa.jpg', image: 'https://www.directv.com/db_photos/movies/AllPhotosAPGI/29160/29160_aa.jpg',
category: ['Comedy', 'Movies Anywhere', 'Action/Adventure', 'Science Fiction'], category: ['Comedy', 'Movies Anywhere', 'Action/Adventure', 'Science Fiction'],
rating: { rating: {
system: 'MPA', system: 'MPA',
@ -69,7 +69,8 @@ it('can parse response', done => {
title: 'South Park', title: 'South Park',
sub_title: 'Goth Kids 3: Dawn of the Posers', sub_title: 'Goth Kids 3: Dawn of the Posers',
description: 'The goth kids are sent to a camp for troubled children.', description: 'The goth kids are sent to a camp for troubled children.',
icon: 'https://www.directv.com/db_photos/showcards/v5/AllPhotos/184338/p184338_b_v5_aa.jpg', image:
'https://www.directv.com/db_photos/showcards/v5/AllPhotos/184338/p184338_b_v5_aa.jpg',
category: ['Series', 'Animation', 'Comedy'], category: ['Series', 'Animation', 'Comedy'],
season: 17, season: 17,
episode: 4, episode: 4,

View file

@ -34,7 +34,7 @@ module.exports = {
programs.push({ programs.push({
title: item.title, title: item.title,
description: item.desc, description: item.desc,
icon: item.programmeurl, image: item.programmeurl,
category: item.subgenre, category: item.subgenre,
start: parseStart(item), start: parseStart(item),
stop: parseStop(item) stop: parseStop(item)

View file

@ -49,7 +49,8 @@ it('can parse response', () => {
title: 'Imlie', title: 'Imlie',
description: description:
'Imlie finds herself in deep trouble when she gets tied up before the wedding. Meanwhile, Aryan assumes that he is getting married to Imlie and performs the wedding rituals.', 'Imlie finds herself in deep trouble when she gets tied up before the wedding. Meanwhile, Aryan assumes that he is getting married to Imlie and performs the wedding rituals.',
icon: 'http://imagesstartv.whatsonindia.com/dasimages/landscape/360x270/59A9215E5DE13ABF4B05C59A6C87768AD61CA608M.jpg', image:
'http://imagesstartv.whatsonindia.com/dasimages/landscape/360x270/59A9215E5DE13ABF4B05C59A6C87768AD61CA608M.jpg',
category: 'Drama' category: 'Drama'
} }
]) ])

View file

@ -35,7 +35,7 @@ module.exports = {
programs.push({ programs.push({
title: item.Title, title: item.Title,
description: parseDescription(details), description: parseDescription(details),
icon: parseIcon(details), image: parseImage(details),
category: parseCategory(details), category: parseCategory(details),
start: parseTime(item.StartTime, channel), start: parseTime(item.StartTime, channel),
stop: parseTime(item.EndTime, channel) stop: parseTime(item.EndTime, channel)
@ -178,7 +178,7 @@ function parseDescription(details) {
return details ? details.Synopsis : null return details ? details.Synopsis : null
} }
function parseIcon(details) { function parseImage(details) {
return details ? details.ThumbnailUri : null return details ? details.ThumbnailUri : null
} }

View file

@ -60,7 +60,8 @@ it('can parse response for ZA', async () => {
title: 'UFC FN HL: Nzechukwu v Cutelaba', title: 'UFC FN HL: Nzechukwu v Cutelaba',
description: description:
"'UFC Fight Night Highlights - Heavyweight Bout: Kennedy Nzechukwu vs Ion Cutelaba'. From The UFC APEX Center - Las Vegas, USA.", "'UFC Fight Night Highlights - Heavyweight Bout: Kennedy Nzechukwu vs Ion Cutelaba'. From The UFC APEX Center - Las Vegas, USA.",
icon: 'https://03mcdecdnimagerepository.blob.core.windows.net/epguideimage/img/271546_UFC Fight Night.png', image:
'https://03mcdecdnimagerepository.blob.core.windows.net/epguideimage/img/271546_UFC Fight Night.png',
category: ['All Sport', 'Mixed Martial Arts'] category: ['All Sport', 'Mixed Martial Arts']
}) })
}) })
@ -91,7 +92,8 @@ it('can parse response for NG', async () => {
title: 'UFC FN HL: Nzechukwu v Cutelaba', title: 'UFC FN HL: Nzechukwu v Cutelaba',
description: description:
"'UFC Fight Night Highlights - Heavyweight Bout: Kennedy Nzechukwu vs Ion Cutelaba'. From The UFC APEX Center - Las Vegas, USA.", "'UFC Fight Night Highlights - Heavyweight Bout: Kennedy Nzechukwu vs Ion Cutelaba'. From The UFC APEX Center - Las Vegas, USA.",
icon: 'https://03mcdecdnimagerepository.blob.core.windows.net/epguideimage/img/271546_UFC Fight Night.png', image:
'https://03mcdecdnimagerepository.blob.core.windows.net/epguideimage/img/271546_UFC Fight Night.png',
category: ['All Sport', 'Mixed Martial Arts'] category: ['All Sport', 'Mixed Martial Arts']
}) })
}) })

View file

@ -28,7 +28,7 @@ module.exports = {
title: parseTitle(item), title: parseTitle(item),
description: parseDescription(item), description: parseDescription(item),
category: parseCategory(item), category: parseCategory(item),
icon: parseIcon(item), image: parseImage(item),
start, start,
stop stop
}) })
@ -62,7 +62,7 @@ module.exports = {
} }
} }
function parseIcon(item) { function parseImage(item) {
const $ = cheerio.load(item) const $ = cheerio.load(item)
const imgSrc = const imgSrc =
$('.row > div.columns.small-3.large-1 > a > img').data('src') || $('.row > div.columns.small-3.large-1 > a > img').data('src') ||

View file

@ -35,7 +35,8 @@ it('can parse response (en)', () => {
start: '2022-08-27T14:25:00.000Z', start: '2022-08-27T14:25:00.000Z',
stop: '2022-08-27T15:15:00.000Z', stop: '2022-08-27T15:15:00.000Z',
title: 'Station 19 S5', title: 'Station 19 S5',
icon: 'https://media.elcinema.com/uploads/_150x200_ec30d1a2251c8edf83334be4860184c74d2534d7ba508a334ad66fa59acc4926.jpg', image:
'https://media.elcinema.com/uploads/_150x200_ec30d1a2251c8edf83334be4860184c74d2534d7ba508a334ad66fa59acc4926.jpg',
category: 'Series' category: 'Series'
}) })
}) })
@ -52,7 +53,8 @@ it('can parse response (ar)', () => {
start: '2022-08-27T14:25:00.000Z', start: '2022-08-27T14:25:00.000Z',
stop: '2022-08-27T15:15:00.000Z', stop: '2022-08-27T15:15:00.000Z',
title: 'Station 19 S5', title: 'Station 19 S5',
icon: 'https://media.elcinema.com/uploads/_150x200_ec30d1a2251c8edf83334be4860184c74d2534d7ba508a334ad66fa59acc4926.jpg', image:
'https://media.elcinema.com/uploads/_150x200_ec30d1a2251c8edf83334be4860184c74d2534d7ba508a334ad66fa59acc4926.jpg',
category: 'مسلسل' category: 'مسلسل'
}) })
}) })

View file

@ -27,7 +27,7 @@ module.exports = {
title: parseTitle($item), title: parseTitle($item),
description: parseDescription($item), description: parseDescription($item),
categories: parseCategories($item), categories: parseCategories($item),
icon: parseIcon($item), image: parseImage($item),
start, start,
stop stop
}) })
@ -54,7 +54,7 @@ module.exports = {
} }
} }
function parseIcon($item) { function parseImage($item) {
return $item('.text-holder > .btn-hold > .btn-wrap > a.btn-share').data('img') return $item('.text-holder > .btn-hold > .btn-wrap > a.btn-share').data('img')
} }

View file

@ -31,7 +31,8 @@ it('can parse response', () => {
stop: '2023-06-29T08:00:00.000Z', stop: '2023-06-29T08:00:00.000Z',
title: 'EuroNews', title: 'EuroNews',
description: 'European and international headlines live via satellite', description: 'European and international headlines live via satellite',
icon: 'https://img.resized.co/entertainment/eyJkYXRhIjoie1widXJsXCI6XCJodHRwczpcXFwvXFxcL3R2LmFzc2V0cy5wcmVzc2Fzc29jaWF0aW9uLmlvXFxcLzcxZDdkYWY2LWQxMjItNTliYy1iMGRjLTFkMjc2ODg1MzhkNC5qcGdcIixcIndpZHRoXCI6NDgwLFwiaGVpZ2h0XCI6Mjg4LFwiZGVmYXVsdFwiOlwiaHR0cHM6XFxcL1xcXC9lbnRlcnRhaW5tZW50LmllXFxcL2ltYWdlc1xcXC9uby1pbWFnZS5wbmdcIn0iLCJoYXNoIjoiZDhjYzA0NzFhMGZhOTI1Yjc5ODI0M2E3OWZjMGI2ZGJmMDIxMjllNyJ9/71d7daf6-d122-59bc-b0dc-1d27688538d4.jpg', image:
'https://img.resized.co/entertainment/eyJkYXRhIjoie1widXJsXCI6XCJodHRwczpcXFwvXFxcL3R2LmFzc2V0cy5wcmVzc2Fzc29jaWF0aW9uLmlvXFxcLzcxZDdkYWY2LWQxMjItNTliYy1iMGRjLTFkMjc2ODg1MzhkNC5qcGdcIixcIndpZHRoXCI6NDgwLFwiaGVpZ2h0XCI6Mjg4LFwiZGVmYXVsdFwiOlwiaHR0cHM6XFxcL1xcXC9lbnRlcnRhaW5tZW50LmllXFxcL2ltYWdlc1xcXC9uby1pbWFnZS5wbmdcIn0iLCJoYXNoIjoiZDhjYzA0NzFhMGZhOTI1Yjc5ODI0M2E3OWZjMGI2ZGJmMDIxMjllNyJ9/71d7daf6-d122-59bc-b0dc-1d27688538d4.jpg',
categories: ['Factual'] categories: ['Factual']
}) })
@ -40,7 +41,8 @@ it('can parse response', () => {
stop: '2023-06-30T06:00:00.000Z', stop: '2023-06-30T06:00:00.000Z',
title: 'EuroNews', title: 'EuroNews',
description: 'European and international headlines live via satellite', description: 'European and international headlines live via satellite',
icon: 'https://img.resized.co/entertainment/eyJkYXRhIjoie1widXJsXCI6XCJodHRwczpcXFwvXFxcL3R2LmFzc2V0cy5wcmVzc2Fzc29jaWF0aW9uLmlvXFxcLzcxZDdkYWY2LWQxMjItNTliYy1iMGRjLTFkMjc2ODg1MzhkNC5qcGdcIixcIndpZHRoXCI6NDgwLFwiaGVpZ2h0XCI6Mjg4LFwiZGVmYXVsdFwiOlwiaHR0cHM6XFxcL1xcXC9lbnRlcnRhaW5tZW50LmllXFxcL2ltYWdlc1xcXC9uby1pbWFnZS5wbmdcIn0iLCJoYXNoIjoiZDhjYzA0NzFhMGZhOTI1Yjc5ODI0M2E3OWZjMGI2ZGJmMDIxMjllNyJ9/71d7daf6-d122-59bc-b0dc-1d27688538d4.jpg', image:
'https://img.resized.co/entertainment/eyJkYXRhIjoie1widXJsXCI6XCJodHRwczpcXFwvXFxcL3R2LmFzc2V0cy5wcmVzc2Fzc29jaWF0aW9uLmlvXFxcLzcxZDdkYWY2LWQxMjItNTliYy1iMGRjLTFkMjc2ODg1MzhkNC5qcGdcIixcIndpZHRoXCI6NDgwLFwiaGVpZ2h0XCI6Mjg4LFwiZGVmYXVsdFwiOlwiaHR0cHM6XFxcL1xcXC9lbnRlcnRhaW5tZW50LmllXFxcL2ltYWdlc1xcXC9uby1pbWFnZS5wbmdcIn0iLCJoYXNoIjoiZDhjYzA0NzFhMGZhOTI1Yjc5ODI0M2E3OWZjMGI2ZGJmMDIxMjllNyJ9/71d7daf6-d122-59bc-b0dc-1d27688538d4.jpg',
categories: ['Factual'] categories: ['Factual']
}) })
}) })

View file

@ -16,7 +16,7 @@ module.exports = {
title: item.program.title, title: item.program.title,
description: item.program.longDescription, description: item.program.longDescription,
category: item.program.subType, category: item.program.subType,
icon: parseIcon(item), image: parseImage(item),
start: parseStart(item), start: parseStart(item),
stop: parseStop(item) stop: parseStop(item)
}) })
@ -26,7 +26,7 @@ module.exports = {
} }
} }
function parseIcon(item) { function parseImage(item) {
const uri = item.program.preferredImage.uri const uri = item.program.preferredImage.uri
return uri ? `https://adma.tmsimg.com/assets/${uri}` : null return uri ? `https://adma.tmsimg.com/assets/${uri}` : null

View file

@ -33,7 +33,7 @@ it('can parse response', () => {
stop: '2023-01-19T06:00:00.000Z', stop: '2023-01-19T06:00:00.000Z',
title: 'The Greg Peterson Experience', title: 'The Greg Peterson Experience',
category: 'Sports non-event', category: 'Sports non-event',
icon: 'https://adma.tmsimg.com/assets/assets/p20628892_b_v13_aa.jpg?w=270&h=360', image: 'https://adma.tmsimg.com/assets/assets/p20628892_b_v13_aa.jpg?w=270&h=360',
description: 'A different kind of sports betting.' description: 'A different kind of sports betting.'
}) })
}) })

View file

@ -34,7 +34,7 @@ module.exports = {
programs.push({ programs.push({
title: parseTitle($item), title: parseTitle($item),
sub_title: parseSubTitle($item), sub_title: parseSubTitle($item),
icon: parseIcon($item), image: parseImage($item),
rating: parseRating($item), rating: parseRating($item),
season: parseSeason($item), season: parseSeason($item),
episode: parseEpisode($item), episode: parseEpisode($item),
@ -87,7 +87,7 @@ function parseEpisode($item) {
return episode ? parseInt(episode) : null return episode ? parseInt(episode) : null
} }
function parseIcon($item) { function parseImage($item) {
return $item('.epg-event-thumbnail > img').attr('src') return $item('.epg-event-thumbnail > img').attr('src')
} }

View file

@ -41,7 +41,8 @@ it('can parse response', () => {
stop: '2022-11-07T13:30:00.000Z', stop: '2022-11-07T13:30:00.000Z',
title: 'The Equalizer', title: 'The Equalizer',
sub_title: 'Glory', sub_title: 'Glory',
icon: 'https://images1.resources.foxtel.com.au/store2/mount1/16/3/69e0v.jpg?maxheight=90&limit=91aa1c7a2c485aeeba0706941f79f111adb35830', image:
'https://images1.resources.foxtel.com.au/store2/mount1/16/3/69e0v.jpg?maxheight=90&limit=91aa1c7a2c485aeeba0706941f79f111adb35830',
rating: { rating: {
system: 'ACB', system: 'ACB',
value: 'M' value: 'M'

View file

@ -30,7 +30,7 @@ module.exports = {
programs.push({ programs.push({
title: parseTitle($item), title: parseTitle($item),
description: parseDescription($item), description: parseDescription($item),
icon: parseIcon($item), image: parseImage($item),
start, start,
stop stop
}) })
@ -62,14 +62,16 @@ module.exports = {
} }
function parseTitle($item) { function parseTitle($item) {
return $item('td:nth-child(4) > div > div > a > span,td:nth-child(3) > div > div > span,td:nth-child(3) > div > div > a > span').text() return $item(
'td:nth-child(4) > div > div > a > span,td:nth-child(3) > div > div > span,td:nth-child(3) > div > div > a > span'
).text()
} }
function parseDescription($item) { function parseDescription($item) {
return $item('td:nth-child(4) > div').clone().children().remove().end().text().trim() return $item('td:nth-child(4) > div').clone().children().remove().end().text().trim()
} }
function parseIcon($item) { function parseImage($item) {
return $item('td:nth-child(3) > a > img').attr('src') return $item('td:nth-child(3) > a > img').attr('src')
} }

View file

@ -24,7 +24,7 @@ module.exports = {
start: parseStart(item), start: parseStart(item),
stop: parseStop(item), stop: parseStop(item),
url: parseURL(item), url: parseURL(item),
icon: parseIcon(item) image: parseImage(item)
}) })
}) })
@ -79,7 +79,7 @@ function parseURL(item) {
return item.content.url ? `https://guidatv.sky.it${item.content.url}` : null return item.content.url ? `https://guidatv.sky.it${item.content.url}` : null
} }
function parseIcon(item) { function parseImage(item) {
const cover = item.content.imagesMap ? item.content.imagesMap.find(i => i.key === 'cover') : null const cover = item.content.imagesMap ? item.content.imagesMap.find(i => i.key === 'cover') : null
return cover && cover.img && cover.img.url ? `https://guidatv.sky.it${cover.img.url}` : null return cover && cover.img && cover.img.url ? `https://guidatv.sky.it${cover.img.url}` : null

View file

@ -35,7 +35,8 @@ it('can parse response', () => {
"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.", "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, season: 6,
episode: 26, episode: 26,
icon: 'https://guidatv.sky.it/uuid/77c630aa-4744-44cb-a88e-3e871c6b73d9/cover?md5ChecksumParam=61135b999a63e3d3f4a933b9edeb0c1b', image:
'https://guidatv.sky.it/uuid/77c630aa-4744-44cb-a88e-3e871c6b73d9/cover?md5ChecksumParam=61135b999a63e3d3f4a933b9edeb0c1b',
category: 'Intrattenimento/Fiction', category: 'Intrattenimento/Fiction',
url: 'https://guidatv.sky.it/serie-tv/distretto-di-polizia/stagione-6/episodio-26/77c630aa-4744-44cb-a88e-3e871c6b73d9' url: 'https://guidatv.sky.it/serie-tv/distretto-di-polizia/stagione-6/episodio-26/77c630aa-4744-44cb-a88e-3e871c6b73d9'
} }

View file

@ -23,7 +23,7 @@ module.exports = {
programs.push({ programs.push({
title: item.show.title, title: item.show.title,
description: item.show.body, description: item.show.body,
icon: parseIcon(item), image: parseImage(item),
start: parseStart(item, date), start: parseStart(item, date),
stop: parseStop(item, date) stop: parseStop(item, date)
}) })
@ -33,7 +33,7 @@ module.exports = {
} }
} }
function parseIcon(item) { function parseImage(item) {
return item.show.image ? item.show.image.href : null return item.show.image ? item.show.image.href : null
} }

View file

@ -30,7 +30,8 @@ it('can parse response', () => {
stop: '2022-03-06T13:28:00.000Z', stop: '2022-03-06T13:28:00.000Z',
title: 'تغطية خاصة', title: 'تغطية خاصة',
description: 'Special Edition', description: 'Special Edition',
icon: 'https://cdn.i24news.tv/uploads/a1/be/85/20/69/6f/32/1c/ed/b0/f8/5c/f6/1c/40/f9/a1be8520696f321cedb0f85cf61c40f9.png' image:
'https://cdn.i24news.tv/uploads/a1/be/85/20/69/6f/32/1c/ed/b0/f8/5c/f6/1c/40/f9/a1be8520696f321cedb0f85cf61c40f9.png'
} }
]) ])
}) })

View file

@ -23,7 +23,7 @@ module.exports = {
programs.push({ programs.push({
title: item.title, title: item.title,
description: item.description, description: item.description,
icon: getIcon(item), image: getImage(item),
start: getStart(item), start: getStart(item),
stop: getStop(item) stop: getStop(item)
}) })
@ -52,7 +52,7 @@ module.exports = {
} }
} }
function getIcon(item) { function getImage(item) {
const image = item.images.find(i => i.type === 'default' && i.sizeTag === '1200x630') const image = item.images.find(i => i.type === 'default' && i.sizeTag === '1200x630')
return image ? image.url : null return image ? image.url : null

View file

@ -33,7 +33,8 @@ it('can parse response', () => {
title: 'Puoli seitsemän', title: 'Puoli seitsemän',
description: description:
'Vieraana näyttelijä Elias Salonen. Puoli seiskassa vietetään sekä halloweeniä että joulua, kun Olli-Pekka tapaa todellisen jouluttajan. Juontajina Anniina Valtonen, Tuulianna Tola ja Olli-Pekka Kursi.', 'Vieraana näyttelijä Elias Salonen. Puoli seiskassa vietetään sekä halloweeniä että joulua, kun Olli-Pekka tapaa todellisen jouluttajan. Juontajina Anniina Valtonen, Tuulianna Tola ja Olli-Pekka Kursi.',
icon: 'https://thumbor.prod.telkku.com/YTglotoUl7aJtzPtYnvM9tH03sY=/1200x630/smart/filters:quality(86):format(jpeg)/img.prod.telkku.com/program-images/0f885238ac16ce167a9d80eace450254.jpg' image:
'https://thumbor.prod.telkku.com/YTglotoUl7aJtzPtYnvM9tH03sY=/1200x630/smart/filters:quality(86):format(jpeg)/img.prod.telkku.com/program-images/0f885238ac16ce167a9d80eace450254.jpg'
}) })
}) })

View file

@ -35,7 +35,7 @@ module.exports = {
title: parseTitle($item), title: parseTitle($item),
sub_title: parseSubTitle($item), sub_title: parseSubTitle($item),
description: parseDescription($item), description: parseDescription($item),
icon: parseIcon($item), image: parseImage($item),
rating: parseRating($item), rating: parseRating($item),
start, start,
stop stop
@ -50,7 +50,7 @@ function parseDescription($item) {
return $item('.panel-body > div > div > div > p:nth-child(2)').text().trim() return $item('.panel-body > div > div > div > p:nth-child(2)').text().trim()
} }
function parseIcon($item) { function parseImage($item) {
return $item('.video-thumbnail img').attr('src') return $item('.video-thumbnail img').attr('src')
} }

View file

@ -29,7 +29,8 @@ it('can parse response', () => {
stop: '2022-11-08T11:00:00.000Z', stop: '2022-11-08T11:00:00.000Z',
title: 'All For Nothing?', title: 'All For Nothing?',
sub_title: '226 : Randy & Sarita Vs. Jean-marcel & Melodie', sub_title: '226 : Randy & Sarita Vs. Jean-marcel & Melodie',
icon: 'https://ionplustv.com/static/programs/shows/all-for-nothing/show-banner-all-for-nothing-5ab162f2d8ee6-897aca6d7d9a7d4e2026ca3b592d8b2a047238fa.png', image:
'https://ionplustv.com/static/programs/shows/all-for-nothing/show-banner-all-for-nothing-5ab162f2d8ee6-897aca6d7d9a7d4e2026ca3b592d8b2a047238fa.png',
rating: { rating: {
system: 'MPA', system: 'MPA',
value: 'TV-PG+L' value: 'TV-PG+L'

View file

@ -22,7 +22,7 @@ module.exports = {
programs.push({ programs.push({
title: item.title, title: item.title,
description: item.live_desc, description: item.live_desc,
icon: item.picture_code, image: item.picture_code,
start: parseStart(item), start: parseStart(item),
stop: parseStop(item) stop: parseStop(item)
}) })

View file

@ -33,7 +33,7 @@ it('can parse response', () => {
title: 'ארץ מולדת - בין תורכיה לבריטניה', title: 'ארץ מולדת - בין תורכיה לבריטניה',
description: description:
"קבוצת תלמידים מתארגנת בפרוץ מלחמת העולם הראשונה להגיש עזרה לישוב. באמצעות התלמידים לומד הצופה על בעיותיו של הישוב בתקופת המלחמה, והתלבטותו בין נאמנות לשלטון העות'מאני לבין תקוותיו מהבריטים הכובשים.", "קבוצת תלמידים מתארגנת בפרוץ מלחמת העולם הראשונה להגיש עזרה לישוב. באמצעות התלמידים לומד הצופה על בעיותיו של הישוב בתקופת המלחמה, והתלבטותו בין נאמנות לשלטון העות'מאני לבין תקוותיו מהבריטים הכובשים.",
icon: 'https://kanweb.blob.core.windows.net/download/pictures/2021/1/20/imgid=45847_Z.jpeg' image: 'https://kanweb.blob.core.windows.net/download/pictures/2021/1/20/imgid=45847_Z.jpeg'
} }
]) ])
}) })

View file

@ -35,7 +35,7 @@ module.exports = {
if (prev) prev.stop = start if (prev) prev.stop = start
programs.push({ programs.push({
title: item.Program.Name, title: item.Program.Name,
icon: item.Program.Images, image: item.Program.Images,
category: item.Program.Genres, category: item.Program.Genres,
start, start,
stop stop

View file

@ -42,14 +42,15 @@ it('can parse response', () => {
start: '2022-03-14T23:15:00.000Z', start: '2022-03-14T23:15:00.000Z',
stop: '2022-03-15T00:00:00.000Z', stop: '2022-03-15T00:00:00.000Z',
title: 'WEEKLY FILMS AND STARS, EP740', title: 'WEEKLY FILMS AND STARS, EP740',
icon: 'https://img.kplus.vn/images?filename=Media/HDVN/2022_02/ENT_DOC_LNO_21_2649421_2652183_2652183.jpg', image:
'https://img.kplus.vn/images?filename=Media/HDVN/2022_02/ENT_DOC_LNO_21_2649421_2652183_2652183.jpg',
category: 'Documentary' category: 'Documentary'
}, },
{ {
start: '2022-03-15T00:00:00.000Z', start: '2022-03-15T00:00:00.000Z',
stop: '2022-03-15T01:00:00.000Z', stop: '2022-03-15T01:00:00.000Z',
title: 'ST. VINCENT', title: 'ST. VINCENT',
icon: 'https://img.kplus.vn/images?filename=Media/HDVN/2020_05/MOV_COM__2632318_2632318.jpg', image: 'https://img.kplus.vn/images?filename=Media/HDVN/2020_05/MOV_COM__2632318_2632318.jpg',
category: 'Comedy' category: 'Comedy'
} }
]) ])

View file

@ -30,7 +30,7 @@ module.exports = {
actors: item.program.actor, actors: item.program.actor,
start: parseStart(item), start: parseStart(item),
stop: parseStop(item), stop: parseStop(item),
icon: parseIcon(item) image: parseImage(item)
}) })
}) })
@ -63,7 +63,7 @@ module.exports = {
} }
} }
function parseIcon(item) { function parseImage(item) {
return item.program.image.length ? `https://image.tving.com${item.program.image[0].url}` : null return item.program.image.length ? `https://image.tving.com${item.program.image[0].url}` : null
} }

View file

@ -30,7 +30,7 @@ it('can parse response', () => {
expect(results[0]).toMatchObject({ expect(results[0]).toMatchObject({
title: '외계+인 1부', title: '외계+인 1부',
description: '외계+인 1부', description: '외계+인 1부',
icon: 'https://image.tving.com/upload/cms/caip/CAIP0200/P001661154.jpg', image: 'https://image.tving.com/upload/cms/caip/CAIP0200/P001661154.jpg',
date: 2022, date: 2022,
categories: [], categories: [],
directors: ['최동훈'], directors: ['최동훈'],

View file

@ -20,7 +20,7 @@ module.exports = {
programs.push({ programs.push({
title: item.ProgramName, title: item.ProgramName,
description: item.EventDescription, description: item.EventDescription,
icon: item.Picture, image: item.Picture,
start, start,
stop stop
}) })

View file

@ -26,7 +26,7 @@ it('can parse response', () => {
stop: '2022-03-07T00:39:00.000Z', stop: '2022-03-07T00:39:00.000Z',
title: 'רוקדים עם כוכבים - בר זומר', title: 'רוקדים עם כוכבים - בר זומר',
description: 'מהדורת החדשות המרכזית של הבוקר, האנשים הפרשנויות והכותרות שיעשו את היום.', description: 'מהדורת החדשות המרכזית של הבוקר, האנשים הפרשנויות והכותרות שיעשו את היום.',
icon: 'https://img.mako.co.il/2022/02/13/DancingWithStars2022_EPG.jpg' image: 'https://img.mako.co.il/2022/02/13/DancingWithStars2022_EPG.jpg'
} }
]) ])
}) })

View file

@ -22,7 +22,7 @@ module.exports = {
title: item.title, title: item.title,
category: item.category, category: item.category,
description: parseDescription(item), description: parseDescription(item),
icon: parseIcon(item), image: parseImage(item),
start: parseStart(item), start: parseStart(item),
stop: parseStop(item) stop: parseStop(item)
}) })
@ -60,7 +60,7 @@ function parseDescription(item) {
return typeof item.desc === 'string' ? item.desc : null return typeof item.desc === 'string' ? item.desc : null
} }
function parseIcon(item) { function parseImage(item) {
return item.icon['@attributes'].src return item.icon['@attributes'].src
} }

View file

@ -34,7 +34,8 @@ it('can parse response', () => {
category: 'Останато', category: 'Останато',
description: description:
'Екстремниот рибар, Џереми Вејд, е во потрага по слатководни риби кои јадат човечко месо. Со форензички методи, Џереми им илустрира на гледачите како овие нови чудовишта се создадени да убиваат.', 'Екстремниот рибар, Џереми Вејд, е во потрага по слатководни риби кои јадат човечко месо. Со форензички методи, Џереми им илустрира на гледачите како овие нови чудовишта се создадени да убиваат.',
icon: 'https://prd-static-mkt.spectar.tv/rev-1636968170/image_transform.php/transform/1/epg_program_id/21949063/instance_id/1' image:
'https://prd-static-mkt.spectar.tv/rev-1636968170/image_transform.php/transform/1/epg_program_id/21949063/instance_id/1'
} }
]) ])
}) })
@ -55,7 +56,8 @@ it('can parse response with no description', () => {
title: 'Палмето - игран филм', title: 'Палмето - игран филм',
category: 'Останато', category: 'Останато',
description: null, description: null,
icon: 'https://prd-static-mkt.spectar.tv/rev-1636968170/image_transform.php/transform/1/epg_program_id/21949063/instance_id/1' image:
'https://prd-static-mkt.spectar.tv/rev-1636968170/image_transform.php/transform/1/epg_program_id/21949063/instance_id/1'
} }
]) ])
}) })

View file

@ -34,7 +34,7 @@ module.exports = {
programs.push({ programs.push({
title: parseTitle($item), title: parseTitle($item),
description: parseDescription($item), description: parseDescription($item),
icon: parseIcon($item), image: parseImage($item),
start, start,
stop stop
}) })
@ -69,13 +69,13 @@ function parseDescription($item) {
return $item('.program_about > .program_description > p').text().trim() return $item('.program_about > .program_description > p').text().trim()
} }
function parseIcon($item) { function parseImage($item) {
const backgroundImage = $item('.program_about > .program_photo').css('background-image') const backgroundImage = $item('.program_about > .program_photo').css('background-image')
if (!backgroundImage) return null if (!backgroundImage) return null
const [, icon] = backgroundImage.match(/url\('(.*)'\)/) || [null, null] const [, imageUrl] = backgroundImage.match(/url\('(.*)'\)/) || [null, null]
if (!icon) return null if (!imageUrl) return null
return `https:${icon}` return `https:${imageUrl}`
} }
function parseItems(content) { function parseItems(content) {

View file

@ -49,7 +49,8 @@ it('can parse response', () => {
title: 'A hegyi doktor - I. évad', title: 'A hegyi doktor - I. évad',
description: description:
'Maxl iskolatársának, Vroninak az anyja egy autóbalesetben meghal. A 20 éves testvér, Vinzenz magához szeretné venni a lányt, ám a gyámüggyel problémái akadnak, ezért megpróbálja elszöktetni.(Eredeti hang digitálisan.)', 'Maxl iskolatársának, Vroninak az anyja egy autóbalesetben meghal. A 20 éves testvér, Vinzenz magához szeretné venni a lányt, ám a gyámüggyel problémái akadnak, ezért megpróbálja elszöktetni.(Eredeti hang digitálisan.)',
icon: 'https://mediaklikk.hu/wp-content/uploads/sites/4/2019/10/A-hegyi-doktor-I-évad-e1571318391226-150x150.jpg' image:
'https://mediaklikk.hu/wp-content/uploads/sites/4/2019/10/A-hegyi-doktor-I-évad-e1571318391226-150x150.jpg'
}) })
expect(results[56]).toMatchObject({ expect(results[56]).toMatchObject({

View file

@ -18,7 +18,7 @@ module.exports = {
programs.push({ programs.push({
title: item.title, title: item.title,
description: item.shortSynopsis, description: item.shortSynopsis,
icon: parseIcon(item), image: parseImage(item),
category: item.tags, category: item.tags,
season: item.season, season: item.season,
episode: item.episode, episode: item.episode,
@ -59,7 +59,7 @@ function parseStop(item) {
return dayjs(item.published.end) return dayjs(item.published.end)
} }
function parseIcon(item) { function parseImage(item) {
return item.posterImage ? item.posterImage + '?form=epg-card-6' : null return item.posterImage ? item.posterImage + '?form=epg-card-6' : null
} }

View file

@ -35,7 +35,8 @@ it('can parse response', () => {
'Symphony of Illumination - Robin gets some bad news and decides to keep it to herself. Marshall decorates the house.', 'Symphony of Illumination - Robin gets some bad news and decides to keep it to herself. Marshall decorates the house.',
season: 7, season: 7,
episode: 12, episode: 12,
icon: 'https://androme.melitacable.com/media/images/epg/bc/07/p8953134_e_h10_ad.jpg?form=epg-card-6', image:
'https://androme.melitacable.com/media/images/epg/bc/07/p8953134_e_h10_ad.jpg?form=epg-card-6',
category: ['comedy'] category: ['comedy']
} }
]) ])

View file

@ -16,7 +16,7 @@ module.exports = {
programs.push({ programs.push({
title: info.title, title: info.title,
description: info.description, description: info.description,
icon: info.images.tile, image: info.images.tile,
episode: info.episodeNumber, episode: info.episodeNumber,
season: info.seasonNumber, season: info.seasonNumber,
start: parseStart(item), start: parseStart(item),

View file

@ -33,7 +33,8 @@ it('can parse response', () => {
title: 'Open Homes S3 - EP 2', title: 'Open Homes S3 - EP 2',
description: description:
'Mike heads down to the Sydney beaches to visit a beachside renovation with all the bells and whistles, we see a kitchen tip and recipe anyone can do at home. We finish up in the prestigious Byron bay to visit a multi million dollar award winning home.', 'Mike heads down to the Sydney beaches to visit a beachside renovation with all the bells and whistles, we see a kitchen tip and recipe anyone can do at home. We finish up in the prestigious Byron bay to visit a multi million dollar award winning home.',
icon: "https://production.togglestatic.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=85&ImageId='4853697'&EntityType='LinearSchedule'&EntityId='788a7dd9-9b12-446f-91b4-c8ac9fec95e5'&Width=1280&Height=720&device=web_browser&subscriptions=Anonymous&segmentationTags=all", image:
"https://production.togglestatic.com/shain/v1/dataservice/ResizeImage/$value?Format='jpg'&Quality=85&ImageId='4853697'&EntityType='LinearSchedule'&EntityId='788a7dd9-9b12-446f-91b4-c8ac9fec95e5'&Width=1280&Height=720&device=web_browser&subscriptions=Anonymous&segmentationTags=all",
episode: 2, episode: 2,
season: 3, season: 3,
rating: { rating: {

View file

@ -34,7 +34,7 @@ module.exports = {
title: parseTitle($item), title: parseTitle($item),
category: parseCategory($item), category: parseCategory($item),
description: parseDescription($item), description: parseDescription($item),
icon: parseIcon($item), image: parseImage($item),
start, start,
stop stop
}) })
@ -93,11 +93,11 @@ function parseDescription($item) {
return $item('a > div.content > p.synopsis').text().trim() return $item('a > div.content > p.synopsis').text().trim()
} }
function parseIcon($item) { function parseImage($item) {
const backgroundImage = $item('a > div.image-parent > div.image').css('background-image') const backgroundImage = $item('a > div.image-parent > div.image').css('background-image')
const [, icon] = backgroundImage.match(/url\('(.*)'\)/) || [null, null] const [, image] = backgroundImage.match(/url\('(.*)'\)/) || [null, null]
return icon return image
} }
function parseItems(content) { function parseItems(content) {

View file

@ -33,7 +33,7 @@ it('can parse response', () => {
title: 'Trasnoche de 24/7', title: 'Trasnoche de 24/7',
category: 'Interés general', category: 'Interés general',
description: 'Lo más visto de la semana en nuestra pantalla.', description: 'Lo más visto de la semana en nuestra pantalla.',
icon: 'https://cdn.mitvstatic.com/programs/fallback_other_l_m.jpg' image: 'https://cdn.mitvstatic.com/programs/fallback_other_l_m.jpg'
}, },
{ {
start: '2021-11-24T23:00:00.000Z', start: '2021-11-24T23:00:00.000Z',
@ -42,7 +42,7 @@ it('can parse response', () => {
category: 'Noticiero', category: 'Noticiero',
description: description:
'Cerramos el día con un completo resumen de los temas más relevantes con columnistas y análisis especiales para terminar el día.', 'Cerramos el día con un completo resumen de los temas más relevantes con columnistas y análisis especiales para terminar el día.',
icon: 'https://cdn.mitvstatic.com/programs/fallback_other_l_m.jpg' image: 'https://cdn.mitvstatic.com/programs/fallback_other_l_m.jpg'
}, },
{ {
start: '2021-11-25T01:00:00.000Z', start: '2021-11-25T01:00:00.000Z',
@ -51,7 +51,7 @@ it('can parse response', () => {
category: 'Cultural', category: 'Cultural',
description: description:
'La energía tiene mucho para mostrar. Este programa reúne a las principales empresas y protagonistas de la actividad que esta revolucionando la región.', 'La energía tiene mucho para mostrar. Este programa reúne a las principales empresas y protagonistas de la actividad que esta revolucionando la región.',
icon: 'https://cdn.mitvstatic.com/programs/fallback_other_l_m.jpg' image: 'https://cdn.mitvstatic.com/programs/fallback_other_l_m.jpg'
} }
]) ])
}) })

View file

@ -34,7 +34,7 @@ module.exports = {
title: parseTitle($item), title: parseTitle($item),
description: parseDescription($item), description: parseDescription($item),
category: parseCategory($item), category: parseCategory($item),
icon: parseIcon($item), image: parseImage($item),
start, start,
stop stop
}) })
@ -85,7 +85,7 @@ function parseCategory($item) {
return $item('.type').text().trim() return $item('.type').text().trim()
} }
function parseIcon($item) { function parseImage($item) {
return $item('.image img').data('src') return $item('.image img').data('src')
} }

View file

@ -32,7 +32,7 @@ it('can parse response', () => {
stop: '2023-01-19T05:55:00.000Z', stop: '2023-01-19T05:55:00.000Z',
title: 'LN Matin', title: 'LN Matin',
category: 'Magazine Actualité', category: 'Magazine Actualité',
icon: 'https://dnsmptv-img.pragma-consult.be/imgs/picto/132/Reportage_1.jpg' image: 'https://dnsmptv-img.pragma-consult.be/imgs/picto/132/Reportage_1.jpg'
}) })
expect(results[1]).toMatchObject({ expect(results[1]).toMatchObject({
@ -40,7 +40,7 @@ it('can parse response', () => {
stop: '2023-01-19T06:00:00.000Z', stop: '2023-01-19T06:00:00.000Z',
title: 'Météo', title: 'Météo',
category: 'Météo', category: 'Météo',
icon: 'https://dnsmptv-img.pragma-consult.be/imgs/picto/132/Meteo.jpg' image: 'https://dnsmptv-img.pragma-consult.be/imgs/picto/132/Meteo.jpg'
}) })
expect(results[8]).toMatchObject({ expect(results[8]).toMatchObject({
@ -49,7 +49,7 @@ it('can parse response', () => {
title: 'Le journal', title: 'Le journal',
description: "L'information de la mi-journée avec des JT...", description: "L'information de la mi-journée avec des JT...",
category: 'Journal', category: 'Journal',
icon: 'https://dnsmptv-img.pragma-consult.be/imgs/picto/132/journal.jpg' image: 'https://dnsmptv-img.pragma-consult.be/imgs/picto/132/journal.jpg'
}) })
}) })

View file

@ -26,7 +26,7 @@ module.exports = {
title: item.title, title: item.title,
description: item.description, description: item.description,
category: item.category, category: item.category,
icon: item.image, image: item.image,
start: parseStart(item).toJSON(), start: parseStart(item).toJSON(),
stop: parseStop(item).toJSON() stop: parseStop(item).toJSON()
}) })

View file

@ -32,7 +32,7 @@ it('can parse response', () => {
start: '2021-11-09T22:29:00.000Z', start: '2021-11-09T22:29:00.000Z',
stop: '2021-11-09T23:46:00.000Z', stop: '2021-11-09T23:46:00.000Z',
title: 'Šuma', title: 'Šuma',
icon: 'https://mtel.ba/oec/images/epg/60881491.jpg', image: 'https://mtel.ba/oec/images/epg/60881491.jpg',
description: description:
'Krajem decembra 1947. godine jugoslovenski predsjednik Josip Broz Tito prvi put je posjetio Rumuniju. Da bi učvrstili novo socijalističko prijateljstvo, rumunski zvaničnici su poklonili Titu sliku velikog rumunskog umjetnika Jona Andreskua pod nazivom Šuma. Mnogo godina kasnije ta slika je umješana u napetu špijunsku priču i otkriva tajnu koja će uzdrmati temelje i Jugoslavije i Rumunije. Film je svjedok kompleksnosti i raznovrsnosti glasova koji čine ono što zovemo stvarnošću.', 'Krajem decembra 1947. godine jugoslovenski predsjednik Josip Broz Tito prvi put je posjetio Rumuniju. Da bi učvrstili novo socijalističko prijateljstvo, rumunski zvaničnici su poklonili Titu sliku velikog rumunskog umjetnika Jona Andreskua pod nazivom Šuma. Mnogo godina kasnije ta slika je umješana u napetu špijunsku priču i otkriva tajnu koja će uzdrmati temelje i Jugoslavije i Rumunije. Film je svjedok kompleksnosti i raznovrsnosti glasova koji čine ono što zovemo stvarnošću.',
category: 'Televizijski film' category: 'Televizijski film'

View file

@ -28,7 +28,7 @@ module.exports = {
title: item.title, title: item.title,
category: item.category, category: item.category,
description: item.description, description: item.description,
icon: item.image, image: item.image,
start: parseStart(item), start: parseStart(item),
stop: parseStop(item) stop: parseStop(item)
}) })

View file

@ -36,7 +36,8 @@ it('can parse response', () => {
stop: '2021-11-07T00:43:00.000Z', stop: '2021-11-07T00:43:00.000Z',
title: 'Zaboravljeni zlo\u010din', title: 'Zaboravljeni zlo\u010din',
category: 'Bioskopski film', category: 'Bioskopski film',
icon: 'https://mts.rs/oec/images/epg/2_abb81cc24d8ce957eece50f991a31e59780e4e53_E7D8ECDE568E84E3C86CCDBDB647355E.jpg', image:
'https://mts.rs/oec/images/epg/2_abb81cc24d8ce957eece50f991a31e59780e4e53_E7D8ECDE568E84E3C86CCDBDB647355E.jpg',
description: description:
'Novinarka-fotoreporter, D\u017ein, istra\u017euje okrutno i senzacionalno, nere\u0161eno ubistvo sekirom iz davne 1873. godine. Ubistvo koje koincidira sa nedavnim identi\u010dnim brutalnim dvostrukim ubistvom. Zaplet se odvija izme\u0111u pri\u010de o\u010devica iz toga doba - pri\u010de iz novinske arhive i D\u017einine privatne borbe sa ljubomorom i sumnjom koje prate njen brak.' 'Novinarka-fotoreporter, D\u017ein, istra\u017euje okrutno i senzacionalno, nere\u0161eno ubistvo sekirom iz davne 1873. godine. Ubistvo koje koincidira sa nedavnim identi\u010dnim brutalnim dvostrukim ubistvom. Zaplet se odvija izme\u0111u pri\u010de o\u010devica iz toga doba - pri\u010de iz novinske arhive i D\u017einine privatne borbe sa ljubomorom i sumnjom koje prate njen brak.'
} }

View file

@ -27,7 +27,7 @@ module.exports = {
programs.push({ programs.push({
title: parseTitle($item), title: parseTitle($item),
description: parseDescription($item), description: parseDescription($item),
icon: parseIcon($item), image: parseImage($item),
start, start,
stop stop
}) })
@ -59,7 +59,7 @@ module.exports = {
} }
} }
function parseIcon($item) { function parseImage($item) {
const imgSrc = $item('div.smartpe_screenshot > img').attr('src') const imgSrc = $item('div.smartpe_screenshot > img').attr('src')
return imgSrc ? `https:${imgSrc}` : null return imgSrc ? `https:${imgSrc}` : null

View file

@ -10,15 +10,20 @@ const headers = {
'X-Core-Contentratinglimit': '0', 'X-Core-Contentratinglimit': '0',
'X-Core-Deviceid': '', 'X-Core-Deviceid': '',
'X-Core-Devicetype': 'web', 'X-Core-Devicetype': 'web',
'Origin': 'https://nostv.pt', Origin: 'https://nostv.pt',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36' 'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
} }
module.exports = { module.exports = {
site: 'nostv.pt', site: 'nostv.pt',
days: 2, days: 2,
url({ channel, date }) { url({ channel, date }) {
return `https://tyr-prod.apigee.net/nostv/ott/schedule/range/contents/guest?channels=${channel.site_id}&minDate=${date.format('YYYY-MM-DD')}T00:00:00Z&maxDate=${date.format('YYYY-MM-DD')}T23:59:59Z&isDateInclusive=true&client_id=${headers['X-Apikey']}` return `https://tyr-prod.apigee.net/nostv/ott/schedule/range/contents/guest?channels=${
channel.site_id
}&minDate=${date.format('YYYY-MM-DD')}T00:00:00Z&maxDate=${date.format(
'YYYY-MM-DD'
)}T23:59:59Z&isDateInclusive=true&client_id=${headers['X-Apikey']}`
}, },
request: { headers }, request: { headers },
parser({ content }) { parser({ content }) {
@ -32,9 +37,9 @@ module.exports = {
description: item.Metadata?.Description, description: item.Metadata?.Description,
season: item.Metadata?.Season, season: item.Metadata?.Season,
episode: item.Metadata?.Episode, episode: item.Metadata?.Episode,
icon: item.Images ? image: item.Images
`https://mage.stream.nos.pt/v1/nostv_mage/Images?sourceUri=${item.Images[0].Url}&profile=ott_1_452x340&client_id=${headers['X-Apikey']}` : ? `https://mage.stream.nos.pt/v1/nostv_mage/Images?sourceUri=${item.Images[0].Url}&profile=ott_1_452x340&client_id=${headers['X-Apikey']}`
null, : null,
start: dayjs.utc(item.UtcDateTimeStart), start: dayjs.utc(item.UtcDateTimeStart),
stop: dayjs.utc(item.UtcDateTimeEnd) stop: dayjs.utc(item.UtcDateTimeEnd)
}) })
@ -45,7 +50,10 @@ module.exports = {
}, },
async channels() { async channels() {
const result = await axios const result = await axios
.get(`https://tyr-prod.apigee.net/nostv/ott/channels/guest?client_id=${headers['X-Apikey']}`, { headers }) .get(
`https://tyr-prod.apigee.net/nostv/ott/channels/guest?client_id=${headers['X-Apikey']}`,
{ headers }
)
.then(r => r.data) .then(r => r.data)
.catch(console.error) .catch(console.error)

View file

@ -22,12 +22,11 @@ it('can generate valid url', () => {
it('can parse response', () => { it('can parse response', () => {
const content = fs.readFileSync(path.resolve(__dirname, '__data__/data.json')) const content = fs.readFileSync(path.resolve(__dirname, '__data__/data.json'))
const results = parser({ content }) const results = parser({ content }).map(p => {
.map(p => { p.start = p.start.toJSON()
p.start = p.start.toJSON() p.stop = p.stop.toJSON()
p.stop = p.stop.toJSON() return p
return p })
})
expect(results[0]).toMatchObject({ expect(results[0]).toMatchObject({
start: '2023-12-11T16:30:00.000Z', start: '2023-12-11T16:30:00.000Z',
@ -37,7 +36,8 @@ it('can parse response', () => {
'A história de dois melhores amigos veterinários e o seu extraordinário trabalho na Austrália.', 'A história de dois melhores amigos veterinários e o seu extraordinário trabalho na Austrália.',
season: 1, season: 1,
episode: 12, episode: 12,
icon: 'https://mage.stream.nos.pt/v1/nostv_mage/Images?sourceUri=http://vip.pam.local.internal/PAM.Images/Store/8329ed1aec5d4c0faa2056972256ff9f&profile=ott_1_452x340&client_id=xe1dgrShwdR1DVOKGmsj8Ut4QLlGyOFI' image:
'https://mage.stream.nos.pt/v1/nostv_mage/Images?sourceUri=http://vip.pam.local.internal/PAM.Images/Store/8329ed1aec5d4c0faa2056972256ff9f&profile=ott_1_452x340&client_id=xe1dgrShwdR1DVOKGmsj8Ut4QLlGyOFI'
}) })
}) })

View file

@ -27,7 +27,7 @@ module.exports = {
programs.push({ programs.push({
title: item.title, title: item.title,
description: item.description, description: item.description,
icon: parseIcon(item), image: parseImage(item),
start, start,
stop stop
}) })
@ -55,7 +55,7 @@ function parseStart(item) {
return dayjs.tz(item.datetime, 'YYYY-MM-DD HH:mm:ss', 'Asia/Nicosia') return dayjs.tz(item.datetime, 'YYYY-MM-DD HH:mm:ss', 'Asia/Nicosia')
} }
function parseIcon(item) { function parseImage(item) {
return item.mediaItems.length ? item.mediaItems[0].CdnUrl : null return item.mediaItems.length ? item.mediaItems[0].CdnUrl : null
} }

View file

@ -32,7 +32,8 @@ it('can parse response', () => {
stop: '2021-11-17T06:10:00.000Z', stop: '2021-11-17T06:10:00.000Z',
title: 'Δεσμοί Αίματος', title: 'Δεσμοί Αίματος',
description: 'Θρίλερ Μυστηρίου', description: 'Θρίλερ Μυστηρίου',
icon: 'http://cache-forthnet.secure.footprint.net/linear/3/0/305608_COMMOBLOOX_GUIDE_STILL.jpg' image:
'http://cache-forthnet.secure.footprint.net/linear/3/0/305608_COMMOBLOOX_GUIDE_STILL.jpg'
} }
]) ])
}) })

View file

@ -33,7 +33,7 @@ module.exports = {
programs.push({ programs.push({
title: details.main_title, title: details.main_title,
description: details.short_argument, description: details.short_argument,
icon: parseIcon(details), image: parseImage(details),
actors: parseActors(details), actors: parseActors(details),
rating: parseRating(details), rating: parseRating(details),
date: details.year, date: details.year,
@ -87,7 +87,7 @@ function parseActors(details) {
return details.actors.split(', ') return details.actors.split(', ')
} }
function parseIcon(details) { function parseImage(details) {
return details.image ? `https://img-ns.s3.amazonaws.com/grid_data/${details.image}` : null return details.image ? `https://img-ns.s3.amazonaws.com/grid_data/${details.image}` : null
} }

View file

@ -51,7 +51,7 @@ it('can parse response', async () => {
title: 'Jurassic World: Dominion', title: 'Jurassic World: Dominion',
description: 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.', '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', image: 'https://img-ns.s3.amazonaws.com/grid_data/23354476.jpg',
date: '2022', date: '2022',
rating: { rating: {
system: 'MPAA', system: 'MPAA',
@ -66,7 +66,7 @@ it('can parse response', async () => {
title: 'Black Adam', title: 'Black Adam',
description: 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.', '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', image: 'https://img-ns.s3.amazonaws.com/grid_data/24638423.jpg',
date: '2022', date: '2022',
rating: { rating: {
system: 'MPAA', system: 'MPAA',

View file

@ -2,33 +2,34 @@ const axios = require('axios')
const dayjs = require('dayjs') const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc') const utc = require('dayjs/plugin/utc')
let apiVersion; let apiVersion
let isApiVersionFetched = false; let isApiVersionFetched = false
(async () => { ;(async () => {
try { try {
await fetchApiVersion(); await fetchApiVersion()
isApiVersionFetched = true; isApiVersionFetched = true
} catch (error) { } catch (error) {
console.error('Error during script initialization:', error); console.error('Error during script initialization:', error)
} }
})(); })()
dayjs.extend(utc) dayjs.extend(utc)
module.exports = { module.exports = {
site: 'pickx.be', site: 'pickx.be',
days: 2, days: 2,
apiVersion: function () { apiVersion: function () {
return apiVersion; return apiVersion
}, },
fetchApiVersion: fetchApiVersion, // Export fetchApiVersion fetchApiVersion: fetchApiVersion, // Export fetchApiVersion
url: async function ({ channel, date }) { url: async function ({ channel, date }) {
while (!isApiVersionFetched) { while (!isApiVersionFetched) {
await new Promise(resolve => setTimeout(resolve, 100)); // Wait for 100 milliseconds await new Promise(resolve => setTimeout(resolve, 100)) // Wait for 100 milliseconds
} }
return `https://px-epg.azureedge.net/airings/${apiVersion}/${date.format('YYYY-MM-DD')}/channel/${channel.site_id}?timezone=Europe%2FBrussels`; return `https://px-epg.azureedge.net/airings/${apiVersion}/${date.format(
'YYYY-MM-DD'
)}/channel/${channel.site_id}?timezone=Europe%2FBrussels`
}, },
request: { request: {
headers: { headers: {
@ -45,10 +46,12 @@ module.exports = {
title: item.program.title, title: item.program.title,
sub_title: item.program.episodeTitle, sub_title: item.program.episodeTitle,
description: item.program.description, description: item.program.description,
category: item.program.translatedCategory?.[channel.lang] ? category: item.program.translatedCategory?.[channel.lang]
item.program.translatedCategory[channel.lang] : item.program.category.split('.')[1], ? item.program.translatedCategory[channel.lang]
icon: item.program.posterFileName ? : item.program.category.split('.')[1],
`https://experience-cache.proximustv.be/posterserver/poster/EPG/w-166_h-110/${item.program.posterFileName}` : null, image: item.program.posterFileName
? `https://experience-cache.proximustv.be/posterserver/poster/EPG/w-166_h-110/${item.program.posterFileName}`
: null,
season: item.program.seasonNumber, season: item.program.seasonNumber,
episode: item.program.episodeNumber, episode: item.program.episodeNumber,
actors: item.program.actors, actors: item.program.actors,
@ -61,19 +64,18 @@ module.exports = {
return programs return programs
}, },
async channels({ lang = ''}) { async channels({ lang = '' }) {
const query = { const query = {
operationName: 'getChannels', operationName: 'getChannels',
variables: { variables: {
language: lang, language: lang,
queryParams: {}, queryParams: {},
'id': '0', id: '0',
params: { params: {
shouldReadFromCache: true shouldReadFromCache: true
} }
}, },
query: query: `query getChannels($language: String!, $queryParams: ChannelQueryParams, $id: String, $params: ChannelParams) {
`query getChannels($language: String!, $queryParams: ChannelQueryParams, $id: String, $params: ChannelParams) {
channels(language: $language, queryParams: $queryParams, id: $id, params: $params) { channels(language: $language, queryParams: $queryParams, id: $id, params: $params) {
id id
channelReferenceNumber channelReferenceNumber
@ -118,21 +120,25 @@ module.exports = {
.then(r => r.data) .then(r => r.data)
.catch(console.error) .catch(console.error)
return result?.data?.channels return (
.filter(channel => !channel.radio && (!lang || channel.language === (lang === 'de' ? 'ger' : lang))) result?.data?.channels
.map(channel => { .filter(
return { channel =>
lang: channel.language === 'ger' ? 'de' : channel.language, !channel.radio && (!lang || channel.language === (lang === 'de' ? 'ger' : lang))
site_id: channel.id, )
name: channel.name .map(channel => {
} return {
}) || [] lang: channel.language === 'ger' ? 'de' : channel.language,
site_id: channel.id,
name: channel.name
}
}) || []
)
} }
} }
function fetchApiVersion() { function fetchApiVersion() {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
try { try {
// https://px-epg.azureedge.net/version is deprecated // https://px-epg.azureedge.net/version is deprecated
// probably the version url will be changed around over time // probably the version url will be changed around over time
@ -145,25 +151,26 @@ function fetchApiVersion() {
//const versionUrl = 'https://www.pickx.be/api/s-626d8fdabfb1d44e5a614cd69f4b45d6843fdb63566fc80ea4f97f40e4ea3152'; //const versionUrl = 'https://www.pickx.be/api/s-626d8fdabfb1d44e5a614cd69f4b45d6843fdb63566fc80ea4f97f40e4ea3152';
//the new strategy to break the provider is to leave old version url's available and to return invalid results on those endpoints //the new strategy to break the provider is to leave old version url's available and to return invalid results on those endpoints
const versionUrl = 'https://www.pickx.be//api/s-cefaf96e249e53648c4895c279e7a621233c50b4357d62b0bdf6bff45f31b5c0'; const versionUrl =
'https://www.pickx.be//api/s-cefaf96e249e53648c4895c279e7a621233c50b4357d62b0bdf6bff45f31b5c0'
const response = await axios.get(versionUrl, { const response = await axios.get(versionUrl, {
headers: { headers: {
'Origin': 'https://www.pickx.be', Origin: 'https://www.pickx.be',
'Referer': 'https://www.pickx.be/' Referer: 'https://www.pickx.be/'
} }
}); })
if (response.status === 200) { if (response.status === 200) {
apiVersion = response.data.version; apiVersion = response.data.version
resolve(); resolve()
} else { } else {
console.error(`Failed to fetch API version. Status: ${response.status}`); console.error(`Failed to fetch API version. Status: ${response.status}`)
reject(`Failed to fetch API version. Status: ${response.status}`); reject(`Failed to fetch API version. Status: ${response.status}`)
} }
} catch (error) { } catch (error) {
console.error('Error fetching API version:', error.message); console.error('Error fetching API version:', error.message)
reject(error); reject(error)
} }
}); })
} }

View file

@ -4,10 +4,8 @@ const path = require('path')
const dayjs = require('dayjs') const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc') const utc = require('dayjs/plugin/utc')
dayjs.extend(utc) dayjs.extend(utc)
const date = dayjs.utc('2023-12-13').startOf('d') const date = dayjs.utc('2023-12-13').startOf('d')
const channel = { const channel = {
lang: 'fr', lang: 'fr',
@ -16,11 +14,13 @@ const channel = {
} }
it('can generate valid url', async () => { it('can generate valid url', async () => {
await fetchApiVersion(); await fetchApiVersion()
const generatedUrl = await url({ channel, date }); const generatedUrl = await url({ channel, date })
const resolvedApiVersion = apiVersion(); const resolvedApiVersion = apiVersion()
expect(generatedUrl).toBe(`https://px-epg.azureedge.net/airings/${resolvedApiVersion}/2023-12-13/channel/UID0118?timezone=Europe%2FBrussels`); expect(generatedUrl).toBe(
}); `https://px-epg.azureedge.net/airings/${resolvedApiVersion}/2023-12-13/channel/UID0118?timezone=Europe%2FBrussels`
)
})
it('can generate valid request headers', () => { it('can generate valid request headers', () => {
expect(request.headers).toMatchObject({ expect(request.headers).toMatchObject({
@ -41,10 +41,10 @@ it('can parse response', () => {
start: '2023-12-12T23:55:00.000Z', start: '2023-12-12T23:55:00.000Z',
stop: '2023-12-13T00:15:00.000Z', stop: '2023-12-13T00:15:00.000Z',
title: 'Le 22h30', title: 'Le 22h30',
description: description: 'Le journal de vivre ici.',
'Le journal de vivre ici.',
category: 'Info', category: 'Info',
icon: 'https://experience-cache.proximustv.be/posterserver/poster/EPG/w-166_h-110/250_250_4B990CC58066A7B2A660AFA0BDDE5C41.jpg' image:
'https://experience-cache.proximustv.be/posterserver/poster/EPG/w-166_h-110/250_250_4B990CC58066A7B2A660AFA0BDDE5C41.jpg'
}) })
}) })

View file

@ -24,7 +24,7 @@ module.exports = {
title: item.title, title: item.title,
description: item.summary, description: item.summary,
categories: parseCategories(item), categories: parseCategories(item),
icon: item.art, image: item.art,
start: parseStart(item), start: parseStart(item),
stop: parseStop(item) stop: parseStop(item)
}) })

View file

@ -43,7 +43,7 @@ it('can parse response', () => {
title: 'Violet & Daisy', title: 'Violet & Daisy',
description: description:
'Two teenage assassins accept what they think will be a quick-and-easy job, until an unexpected target throws them off their plan.', 'Two teenage assassins accept what they think will be a quick-and-easy job, until an unexpected target throws them off their plan.',
icon: 'https://provider-static.plex.tv/epg/images/ott_channels/arts/darkmatter-tv-about.jpg', image: 'https://provider-static.plex.tv/epg/images/ott_channels/arts/darkmatter-tv-about.jpg',
categories: ['Movies'] categories: ['Movies']
}) })
}) })

View file

@ -31,7 +31,7 @@ module.exports = {
sub_title: details.episode_title, sub_title: details.episode_title,
description: details.episode_description || item.description, description: details.episode_description || item.description,
category: parseCategory(details), category: parseCategory(details),
icon: parseIcon(details), image: parseImage(details),
director: parseList(details.director), director: parseList(details.director),
actors: parseList(details.actors), actors: parseList(details.actors),
writer: parseList(details.script), writer: parseList(details.script),
@ -70,7 +70,7 @@ function parseList(str) {
return typeof str === 'string' ? str.split(', ') : [] return typeof str === 'string' ? str.split(', ') : []
} }
function parseIcon(details) { function parseImage(details) {
const url = new URL(details.image, 'https://programacion-tv.elpais.com/') const url = new URL(details.image, 'https://programacion-tv.elpais.com/')
return url.href return url.href

View file

@ -57,7 +57,7 @@ it('can parse response', async () => {
category: 'Ocio-Cultura/Cocina', category: 'Ocio-Cultura/Cocina',
season: 1, season: 1,
episode: 23, episode: 23,
icon: 'https://programacion-tv.elpais.com/imagenes/programas/2099957.jpg' image: 'https://programacion-tv.elpais.com/imagenes/programas/2099957.jpg'
} }
]) ])
}) })

View file

@ -28,7 +28,7 @@ module.exports = {
date: item.year, date: item.year,
season: item.season_number, season: item.season_number,
episode: item.episode_number, episode: item.episode_number,
icon: parseIcon(item), image: parseImage(item),
start: parseStart(item), start: parseStart(item),
stop: parseStop(item) stop: parseStop(item)
}) })
@ -78,7 +78,7 @@ function parseCategories(item) {
.filter(Boolean) .filter(Boolean)
} }
function parseIcon(item) { function parseImage(item) {
const uri = item.images[0] ? item.images[0].image_media.file : null const uri = item.images[0] ? item.images[0].image_media.file : null
return uri ? `https:${uri}` : null return uri ? `https:${uri}` : null

View file

@ -36,7 +36,7 @@ it('can parse response', () => {
season: 3, season: 3,
episode: 3, episode: 3,
categories: [], categories: [],
icon: 'https://zpapi.zetatv.com.uy/media/images/2b45d2675389f2e4f7f6fe0655ccc968.jpg', image: 'https://zpapi.zetatv.com.uy/media/images/2b45d2675389f2e4f7f6fe0655ccc968.jpg',
description: description:
'Cada episodio relata un lugar y una historia diferente pero siguiendo la línea de una investigación basada en una leyenda la cual es guiada por una pareja. Estos dos personajes no son necesariamente ambos policías, pero se ven obligados a colaborar a pesar de los primeros informes difíciles.' 'Cada episodio relata un lugar y una historia diferente pero siguiendo la línea de una investigación basada en una leyenda la cual es guiada por una pareja. Estos dos personajes no son necesariamente ambos policías, pero se ven obligados a colaborar a pesar de los primeros informes difíciles.'
}) })
@ -48,7 +48,7 @@ it('can parse response', () => {
season: null, season: null,
episode: null, episode: null,
categories: ['Drama'], categories: ['Drama'],
icon: 'https://zpapi.zetatv.com.uy/media/images/8cab42d88691edaa8a4001b91f809d91.jpg', image: 'https://zpapi.zetatv.com.uy/media/images/8cab42d88691edaa8a4001b91f809d91.jpg',
description: description:
'Basada en la novela de Charles Dickens, cuenta la historia del pintor Finn que persigue obsesionado a su amor de la niñez, la bella y rica Estella. Gracias a un misterioso benefactor, Finn es enviado a Nueva York, donde se reúne con la hermosa y fría joven.' 'Basada en la novela de Charles Dickens, cuenta la historia del pintor Finn que persigue obsesionado a su amor de la niñez, la bella y rica Estella. Gracias a un misterioso benefactor, Finn es enviado a Nueva York, donde se reúne con la hermosa y fría joven.'
}) })
@ -60,7 +60,7 @@ it('can parse response', () => {
season: null, season: null,
episode: null, episode: null,
categories: ['Comedia', 'Drama'], categories: ['Comedia', 'Drama'],
icon: 'https://zpapi.zetatv.com.uy/media/images/51684d91ed33cb9b0c1863b7a9b097e9.jpg', image: 'https://zpapi.zetatv.com.uy/media/images/51684d91ed33cb9b0c1863b7a9b097e9.jpg',
description: description:
'Una pareja de lesbianas conciben a un niño y una niña por inseminacion artificial. Al paso del tiempo, los chicos deciden conocer a su verdadero padre a espaldas de sus madres. Tras localizarlo intentan integrar toda una familia. Podran lograrlo?.' 'Una pareja de lesbianas conciben a un niño y una niña por inseminacion artificial. Al paso del tiempo, los chicos deciden conocer a su verdadero padre a espaldas de sus madres. Tras localizarlo intentan integrar toda una familia. Podran lograrlo?.'
}) })

View file

@ -29,13 +29,13 @@ module.exports = {
items.forEach(item => { items.forEach(item => {
const $item = cheerio.load(item) const $item = cheerio.load(item)
const title = parseTitle($item) const title = parseTitle($item)
const icon = parseIcon($item) const image = parseImage($item)
const category = parseCategory($item) const category = parseCategory($item)
const start = parseStart($item, date) const start = parseStart($item, date)
const duration = parseDuration($item) const duration = parseDuration($item)
const stop = start.add(duration, 'ms') const stop = start.add(duration, 'ms')
programs.push({ title, icon, category, start, stop }) programs.push({ title, image, category, start, stop })
}) })
return programs return programs
@ -88,13 +88,13 @@ function parseDuration($item) {
return durationParser(duration) return durationParser(duration)
} }
function parseIcon($item) { function parseImage($item) {
const img = $item('.mainBroadcastCard-imageContent').first().find('img') const img = $item('.mainBroadcastCard-imageContent').first().find('img')
const value = img.attr('srcset') || img.data('srcset') const value = img.attr('srcset') || img.data('srcset')
const obj = value ? srcset.parse(value).find(i => i.width === 128) : {} const obj = value ? srcset.parse(value).find(i => i.width === 128) : {}
if (obj.url) { if (obj.url) {
obj.url = obj.url.replace('128x180', '960x540'); obj.url = obj.url.replace('128x180', '960x540')
} }
return obj.url return obj.url

View file

@ -39,7 +39,8 @@ it('can parse response', () => {
stop: '2023-11-27T05:30:00.000Z', stop: '2023-11-27T05:30:00.000Z',
title: 'Programmes de la nuit', title: 'Programmes de la nuit',
category: 'Autre', category: 'Autre',
icon: 'https://www.programme-tv.net/imgre/fit/~2~program~978eb86d5b99cee0.jpg/960x540/quality/80/programmes-de-la-nuit.jpg' image:
'https://www.programme-tv.net/imgre/fit/~2~program~978eb86d5b99cee0.jpg/960x540/quality/80/programmes-de-la-nuit.jpg'
}) })
expect(results[27]).toMatchObject({ expect(results[27]).toMatchObject({
@ -47,7 +48,8 @@ it('can parse response', () => {
stop: '2023-11-27T23:45:00.000Z', stop: '2023-11-27T23:45:00.000Z',
title: 'Coup de foudre chez le Père Noël', title: 'Coup de foudre chez le Père Noël',
category: 'Téléfilm', category: 'Téléfilm',
icon: 'https://www.programme-tv.net/imgre/fit/~2~program~5a4e78779c4a3fac.jpg/960x540/quality/80/coup-de-foudre-chez-le-pere-noel.jpg' image:
'https://www.programme-tv.net/imgre/fit/~2~program~5a4e78779c4a3fac.jpg/960x540/quality/80/coup-de-foudre-chez-le-pere-noel.jpg'
}) })
}) })

View file

@ -35,7 +35,7 @@ module.exports = {
title: item.titreP, title: item.titreP,
description: item.desc, description: item.desc,
category: item.categorieP, category: item.categorieP,
icon: item.srcP, image: item.srcP,
start: dayjs.unix(item.timestampDeb), start: dayjs.unix(item.timestampDeb),
stop: dayjs.unix(item.timestampFin) stop: dayjs.unix(item.timestampFin)
}) })

View file

@ -62,7 +62,8 @@ it('can parse response', done => {
category: 'Magazine', category: 'Magazine',
description: description:
"Pour faire face à la crise du logement, aux loyers toujours plus élevés, à la solitude ou pour les gardes d'enfants, les colocations ont le vent en poupe, Pour mieux comprendre ce nouveau phénomène, une équipe a partagé le quotidien de quatre foyers : une retraitée qui héberge des étudiants, des mamans solos, enceintes, qui partagent un appartement associatif, trois générations de la même famille sur un domaine viticole et une étudiante qui intègre une colocation XXL.", "Pour faire face à la crise du logement, aux loyers toujours plus élevés, à la solitude ou pour les gardes d'enfants, les colocations ont le vent en poupe, Pour mieux comprendre ce nouveau phénomène, une équipe a partagé le quotidien de quatre foyers : une retraitée qui héberge des étudiants, des mamans solos, enceintes, qui partagent un appartement associatif, trois générations de la même famille sur un domaine viticole et une étudiante qui intègre une colocation XXL.",
icon: 'https://programme-tv.vini.pf/sites/default/files/img-icones/52ada51ed86b7e7bc11eaee83ff2192785989d77.jpg' image:
'https://programme-tv.vini.pf/sites/default/files/img-icones/52ada51ed86b7e7bc11eaee83ff2192785989d77.jpg'
}, },
{ {
start: '2021-11-21T01:10:00.000Z', start: '2021-11-21T01:10:00.000Z',
@ -71,7 +72,8 @@ it('can parse response', done => {
category: 'Magazine', category: 'Magazine',
description: description:
'Un documentaire français réalisé en 2019, Cindy Sander, Myriam Abel, Mario, Michal ou encore Magali Vaé ont fait les grandes heures des premières émissions de télécrochet modernes, dans les années 2000, Des années après leur passage, que reste-t-il de leur notoriété ? Comment ces candidats ont-ils vécu leur soudaine médiatisation ? Quels rapports entretenaient-ils avec les autres participants et les membres du jury, souvent intransigeants ?', 'Un documentaire français réalisé en 2019, Cindy Sander, Myriam Abel, Mario, Michal ou encore Magali Vaé ont fait les grandes heures des premières émissions de télécrochet modernes, dans les années 2000, Des années après leur passage, que reste-t-il de leur notoriété ? Comment ces candidats ont-ils vécu leur soudaine médiatisation ? Quels rapports entretenaient-ils avec les autres participants et les membres du jury, souvent intransigeants ?',
icon: 'https://programme-tv.vini.pf/sites/default/files/img-icones/6e64cfbc55c1f4cbd11e3011401403d4dc08c6d2.jpg' image:
'https://programme-tv.vini.pf/sites/default/files/img-icones/6e64cfbc55c1f4cbd11e3011401403d4dc08c6d2.jpg'
}, },
{ {
start: '2021-11-21T02:30:00.000Z', start: '2021-11-21T02:30:00.000Z',
@ -80,7 +82,8 @@ it('can parse response', done => {
category: 'Magazine', category: 'Magazine',
description: description:
"50'INSIDE, c'est toute l'actualité des stars résumée, chaque samedi, Le rendez-vous glamour pour retrouver toujours,,", "50'INSIDE, c'est toute l'actualité des stars résumée, chaque samedi, Le rendez-vous glamour pour retrouver toujours,,",
icon: 'https://programme-tv.vini.pf/sites/default/files/img-icones/3d7e252312dacb5fb7a1a786fa0022ca1be15499.jpg' image:
'https://programme-tv.vini.pf/sites/default/files/img-icones/3d7e252312dacb5fb7a1a786fa0022ca1be15499.jpg'
} }
]) ])
done() done()

View file

@ -35,7 +35,7 @@ module.exports = {
url: parseURL(item), url: parseURL(item),
start, start,
stop, stop,
icon: parseIcon(item) image: parseImage(item)
}) })
}) })
@ -47,7 +47,7 @@ function parseStart(item, date) {
return dayjs.tz(`${date.format('YYYY-MM-DD')} ${item.hour}`, 'YYYY-MM-DD HH:mm', 'Europe/Rome') return dayjs.tz(`${date.format('YYYY-MM-DD')} ${item.hour}`, 'YYYY-MM-DD HH:mm', 'Europe/Rome')
} }
function parseIcon(item) { function parseImage(item) {
let cover = null let cover = null
if (item.image) { if (item.image) {
cover = `https://www.raiplay.it${item.image}` cover = `https://www.raiplay.it${item.image}`

View file

@ -37,7 +37,7 @@ it('can parse response', () => {
season: '3', season: '3',
episode: '5', episode: '5',
sub_title: 'La prima volta', sub_title: 'La prima volta',
icon: 'https://www.raiplay.it/dl/img/2020/03/09/1583748471860_dddddd.jpg', image: 'https://www.raiplay.it/dl/img/2020/03/09/1583748471860_dddddd.jpg',
url: 'https://www.raiplay.it/dirette/rai2/The-Good-Doctor-S3E5---La-prima-volta-2f81030d-803b-456a-9ea5-40233234fd9d.html' url: 'https://www.raiplay.it/dirette/rai2/The-Good-Doctor-S3E5---La-prima-volta-2f81030d-803b-456a-9ea5-40233234fd9d.html'
} }
]) ])

View file

@ -45,7 +45,7 @@ module.exports = {
programs.push({ programs.push({
title: parseTitle($item), title: parseTitle($item),
category: parseCategory($item), category: parseCategory($item),
icon: details.icon, image: details.image,
description: details.description, description: details.description,
directors: details.directors, directors: details.directors,
actors: details.actors, actors: details.actors,
@ -95,7 +95,7 @@ async function loadProgramDetails($item) {
const $ = cheerio.load(content) const $ = cheerio.load(content)
return Promise.resolve({ return Promise.resolve({
icon: parseIcon($), image: parseImage($),
actors: parseActors($), actors: parseActors($),
directors: parseDirectors($), directors: parseDirectors($),
description: parseDescription($) description: parseDescription($)
@ -132,7 +132,7 @@ function parseDescription($) {
return $('#Sinopsis > div').text().trim() return $('#Sinopsis > div').text().trim()
} }
function parseIcon($) { function parseImage($) {
const src = $('#ImgProg').attr('src') const src = $('#ImgProg').attr('src')
const url = new URL(src, 'https://www.reportv.com.ar/buscador/') const url = new URL(src, 'https://www.reportv.com.ar/buscador/')

View file

@ -74,7 +74,7 @@ it('can parse response', async () => {
stop: '2022-10-03T05:00:00.000Z', stop: '2022-10-03T05:00:00.000Z',
title: '¿Quién tiene la razón?', title: '¿Quién tiene la razón?',
category: 'Talk Show', category: 'Talk Show',
icon: 'https://www.reportv.com.ar/buscador/img/Programas/4401882.jpg', image: 'https://www.reportv.com.ar/buscador/img/Programas/4401882.jpg',
actors: ['Nancy Álvarez'], actors: ['Nancy Álvarez'],
description: description:
'Espacio que dará de qué hablar cuando la doctora Nancy Álvarez y Carmen Jara, acompañadas de un jurado implacable, lleguen a escuchar y a resolver los problemas de las partes en conflicto para luego decidir quién tiene la razón.' 'Espacio que dará de qué hablar cuando la doctora Nancy Álvarez y Carmen Jara, acompañadas de un jurado implacable, lleguen a escuchar y a resolver los problemas de las partes en conflicto para luego decidir quién tiene la razón.'
@ -85,7 +85,7 @@ it('can parse response', async () => {
stop: '2022-10-04T04:00:00.000Z', stop: '2022-10-04T04:00:00.000Z',
title: 'Valeria', title: 'Valeria',
category: 'Comedia', category: 'Comedia',
icon: 'https://www.reportv.com.ar/buscador/img/Programas/18788047.jpg', image: 'https://www.reportv.com.ar/buscador/img/Programas/18788047.jpg',
directors: ['Inma Torrente'], directors: ['Inma Torrente'],
actors: [ actors: [
'Diana Gómez', 'Diana Gómez',

View file

@ -11,7 +11,8 @@ dayjs.extend(utc)
dayjs.extend(customParseFormat) dayjs.extend(customParseFormat)
const headers = { const headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 OPR/104.0.0.0' 'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36 OPR/104.0.0.0'
} }
const cookies = {} const cookies = {}
@ -64,10 +65,10 @@ async function parseProgram(item, channel, options = {}) {
const top = item.find('.iq-accordion-block') const top = item.find('.iq-accordion-block')
const info = top.find('.iq-accordion-title .big-title span') const info = top.find('.iq-accordion-title .big-title span')
if (info.length) { if (info.length) {
const [ time, title ] = info.text().split('\n') const [time, title] = info.text().split('\n')
const [ d, m, y ] = item._date.split('-') const [d, m, y] = item._date.split('-')
const start = dayjs.tz(`${y}-${m}-${d} ${time.trim()}`, 'YYYY-MM-DD HH:mm', 'Asia/Riyadh') const start = dayjs.tz(`${y}-${m}-${d} ${time.trim()}`, 'YYYY-MM-DD HH:mm', 'Asia/Riyadh')
let description, icon, stop let description, image, stop
if (deep) { if (deep) {
const pid = top.attr('id').split('-')[1] const pid = top.attr('id').split('-')[1]
if (pid) { if (pid) {
@ -89,7 +90,7 @@ async function parseProgram(item, channel, options = {}) {
} }
const img = $('.row > div > img') const img = $('.row > div > img')
if (img.length) { if (img.length) {
icon = img.attr('src') image = img.attr('src')
} }
} }
if (item._next) { if (item._next) {
@ -102,7 +103,7 @@ async function parseProgram(item, channel, options = {}) {
return { return {
title: title?.trim(), title: title?.trim(),
description: description?.trim(), description: description?.trim(),
icon: icon, image,
start: raw ? start : start?.toISOString(), start: raw ? start : start?.toISOString(),
stop: raw ? stop : stop?.toISOString() stop: raw ? stop : stop?.toISOString()
} }
@ -125,7 +126,7 @@ function parseItems(content, date) {
if (lastId === expectedId) { if (lastId === expectedId) {
// set next item // set next item
if (result.length) { if (result.length) {
result[result.length - 1]._next = $item; result[result.length - 1]._next = $item
} }
result.push($item) result.push($item)
} else if (result.length && !result[result.length - 1]._next) { } else if (result.length && !result[result.length - 1]._next) {
@ -146,4 +147,4 @@ function parseCookies(headers) {
}) })
} }
return cookies.length ? cookies.join('; ') : null return cookies.length ? cookies.join('; ') : null
} }

View file

@ -63,7 +63,7 @@ it('can parse english response', async () => {
title: 'Katkout', title: 'Katkout',
description: description:
'In a comic framework, the events of the film revolve around (Katkoot) Al-Saedi, whose aunt, the eldest of the Al-Saedi family, tries to force him to kill himself in order to ransom his family. A time...', 'In a comic framework, the events of the film revolve around (Katkoot) Al-Saedi, whose aunt, the eldest of the Al-Saedi family, tries to force him to kill himself in order to ransom his family. A time...',
icon: 'https://imgsrv.rotana.net/spider_storage/1398X1000/1690882129.webp?w=450&fit=max' image: 'https://imgsrv.rotana.net/spider_storage/1398X1000/1690882129.webp?w=450&fit=max'
}) })
}) })
@ -79,7 +79,7 @@ it('can parse arabic response', async () => {
title: 'كتكوت', title: 'كتكوت',
description: description:
'في إطار كوميدي تدور أحداث الفيلم، حول (كتكوت) الصعيدي الذي تحاول عمته كبيرة العائلة الصعيدية إجباره على تقديم نفسه للقتل ليفدي عائلته، ولكنه يهرب وتخطفه جهة أمنية لاكتشاف شبه كبير بينه وبين (يوسف خوري...', 'في إطار كوميدي تدور أحداث الفيلم، حول (كتكوت) الصعيدي الذي تحاول عمته كبيرة العائلة الصعيدية إجباره على تقديم نفسه للقتل ليفدي عائلته، ولكنه يهرب وتخطفه جهة أمنية لاكتشاف شبه كبير بينه وبين (يوسف خوري...',
icon: 'https://imgsrv.rotana.net/spider_storage/1398X1000/1690882129.webp?w=450&fit=max' image: 'https://imgsrv.rotana.net/spider_storage/1398X1000/1690882129.webp?w=450&fit=max'
}) })
}) })

Some files were not shown because too many files have changed in this diff Show more