fix programetv.ro checking, continue uniformizing

This commit is contained in:
theofficialomega
2025-07-27 18:10:22 +02:00
parent 5be8899520
commit f3a3a8c404
44 changed files with 193 additions and 154 deletions

View File

@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WPX9FM9');
var cfg = {"homeUrl":"https://www.programetv.ro/","loginUrl":"https://www.programetv.ro/auth/login","logoutUrl":"https://www.programetv.ro/auth/logout","nowOnTvUrl":"https://www.programetv.ro/acum-la-tv/","favoriteStationsUrl":"https://www.programetv.ro/posturi-tv/favorite/","saveFavoritesUrl":"https://www.programetv.ro/save-favorites/","popularStationsUrl":"https://www.programetv.ro/posturi-tv/populare/","stationListUrl":"https://www.programetv.ro/posturi-tv/","privacyPolicyUrl":"https://www.programetv.ro/privacy-policy/","user":false,"showMovieDetails":true,"banners":{"inlist":{"enabled":true,"code":"9647692440"},"footer":{"enabled":true,"code":"9608163999"},"modal":{"enabled":true,"code":"3427954368"}}};
var __stations = [];
var pageData = {"station":{"id":"1","displayName":"PRO TV","domain":"Românești","icon":"https://static.cinemagia.ro/img/tv_station/pro-tv.jpg","tvProvider":[{"tvPId":"2","tvPPos":["113"]},{"tvPId":"3","tvPPos":["113"]},{"tvPId":"4","tvPPos":["113"]},{"tvPId":"5","tvPPos":["3"]},{"tvPId":"6","tvPPos":["3"]},{"tvPId":"8","tvPPos":["4"]},{"tvPId":"11","tvPPos":["111"]}]},"shows":[{"id":"690127679","start":"2021-11-07T07:00:00+02:00","stop":"2021-11-07T09:59:59+02:00","stationId":"1","replay":false,"live":true,"online":true,"OTTRights":true,"categories":["Ştiri"],"title":"Ştirile Pro Tv","tvShowId":"5","desc":"În fiecare zi, cele mai importante evenimente, transmisiuni LIVE, analize, anchete şi reportaje sunt la Ştirile ProTV.","obs":"În fiecare zi, cele mai importante evenimente, transmisiuni LIVE, analize, anchete şi reportaje sunt la Ştirile ProTV.","icon":"https://www.programetv.ro/img/shows/84/54/stirile-pro-tv.png?key=Z2lfZnVial90cmFyZXZwLzAwLzAwLzA1LzE4MzgxMnktMTIwazE3MC1hLW40NTk4MW9zLmNhdA==","templating":[]}],"date":"2021-11-07","controls ":[{"date":"2021-11-03","slug":"ieri","label":"Ieri","name":"Ieri","url":"https://www.programetv.ro/program-tv/pro-tv/ieri/"},{"date":"2021-11-04","slug":"azi","label":"Azi","name":"Azi","url":"https://www.programetv.ro/program-tv/pro-tv/"},{"date":"2021-11-05","slug":"vineri","label":"Vi","name":"Vineri","url":"https://www.programetv.ro/program-tv/pro-tv/vineri/"},{"date":"2021-11-06","slug":"sambata","label":"Sb","name":"Sâmbătă","url":"https://www.programetv.ro/program-tv/pro-tv/sambata/"},{"date":"2021-11-07","slug":"duminica","label":"Du","name":"Duminică","url":"https://www.programetv.ro/program-tv/pro-tv/duminica/"},{"date":"2021-11-08","slug":"luni","label":"Lu","name":"Luni","url":"https://www.programetv.ro/program-tv/pro-tv/luni/"},{"date":"2021-11-09","slug":"marti","label":"Ma","name":"Marți","url":"https://www.programetv.ro/program-tv/pro-tv/marti/"}],"todayDate":"2021-11-04","adsenabled":true};
var __controls = [{"date":"2021-11-03","slug":"ieri","label":"Ieri","name":"Ieri","url":"https://www.programetv.ro/program-tv/pro-tv/ieri/"},{"date":"2021-11-04","slug":"azi","label":"Azi","name":"Azi","url":"https://www.programetv.ro/program-tv/pro-tv/"},{"date":"2021-11-05","slug":"vineri","label":"Vi","name":"Vineri","url":"https://www.programetv.ro/program-tv/pro-tv/vineri/"},{"date":"2021-11-06","slug":"sambata","label":"Sb","name":"Sâmbătă","url":"https://www.programetv.ro/program-tv/pro-tv/sambata/"},{"date":"2021-11-07","slug":"duminica","label":"Du","name":"Duminică","url":"https://www.programetv.ro/program-tv/pro-tv/duminica/"},{"date":"2021-11-08","slug":"luni","label":"Lu","name":"Luni","url":"https://www.programetv.ro/program-tv/pro-tv/luni/"},{"date":"2021-11-09","slug":"marti","label":"Ma","name":"Marți","url":"https://www.programetv.ro/program-tv/pro-tv/marti/"}];</script></head>
<body></body>
</html>

View File

@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WPX9FM9');
var cfg = {"homeUrl":"https://www.programetv.ro/","loginUrl":"https://www.programetv.ro/auth/login","logoutUrl":"https://www.programetv.ro/auth/logout","nowOnTvUrl":"https://www.programetv.ro/acum-la-tv/","favoriteStationsUrl":"https://www.programetv.ro/posturi-tv/favorite/","saveFavoritesUrl":"https://www.programetv.ro/save-favorites/","popularStationsUrl":"https://www.programetv.ro/posturi-tv/populare/","stationListUrl":"https://www.programetv.ro/posturi-tv/","privacyPolicyUrl":"https://www.programetv.ro/privacy-policy/","user":false,"showMovieDetails":true,"banners":{"inlist":{"enabled":true,"code":"9647692440"},"footer":{"enabled":true,"code":"9608163999"},"modal":{"enabled":true,"code":"3427954368"}}};
var __stations = [];</script></head>
<body></body>
</html>

View File

@@ -72,8 +72,8 @@ function parseStop(item) {
}
function parseContent(content) {
const [, data] = content.match(/var pageData = ({.+});\n/) || [null, null]
const [, data] = content.match(/var pageData = ({.+?});/) || [null, null]
return data ? JSON.parse(data) : {}
}

View File

@@ -1,4 +1,6 @@
const { parser, url } = require('./programetv.ro.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
@@ -7,22 +9,6 @@ dayjs.extend(utc)
const date = dayjs.utc('2021-10-24', 'YYYY-MM-DD').startOf('d')
const channel = { site_id: 'pro-tv', xmltv_id: 'ProTV.ro' }
const content = `
<!DOCTYPE html>
<html lang="en-US">
<head>
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WPX9FM9');
var cfg = {"homeUrl":"https://www.programetv.ro/","loginUrl":"https://www.programetv.ro/auth/login","logoutUrl":"https://www.programetv.ro/auth/logout","nowOnTvUrl":"https://www.programetv.ro/acum-la-tv/","favoriteStationsUrl":"https://www.programetv.ro/posturi-tv/favorite/","saveFavoritesUrl":"https://www.programetv.ro/save-favorites/","popularStationsUrl":"https://www.programetv.ro/posturi-tv/populare/","stationListUrl":"https://www.programetv.ro/posturi-tv/","privacyPolicyUrl":"https://www.programetv.ro/privacy-policy/","user":false,"showMovieDetails":true,"banners":{"inlist":{"enabled":true,"code":"9647692440"},"footer":{"enabled":true,"code":"9608163999"},"modal":{"enabled":true,"code":"3427954368"}}};
var __stations = [];
var pageData = {"station":{"id":"1","displayName":"PRO TV","domain":"Românești","icon":"https://static.cinemagia.ro/img/tv_station/pro-tv.jpg","tvProvider":[{"tvPId":"2","tvPPos":["113"]},{"tvPId":"3","tvPPos":["113"]},{"tvPId":"4","tvPPos":["113"]},{"tvPId":"5","tvPPos":["3"]},{"tvPId":"6","tvPPos":["3"]},{"tvPId":"8","tvPPos":["4"]},{"tvPId":"11","tvPPos":["111"]}]},"shows":[{"id":"690127679","start":"2021-11-07T07:00:00+02:00","stop":"2021-11-07T09:59:59+02:00","stationId":"1","replay":false,"live":true,"online":true,"OTTRights":true,"categories":["Ştiri"],"title":"Ştirile Pro Tv","tvShowId":"5","desc":"În fiecare zi, cele mai importante evenimente, transmisiuni LIVE, analize, anchete şi reportaje sunt la Ştirile ProTV.","obs":"În fiecare zi, cele mai importante evenimente, transmisiuni LIVE, analize, anchete şi reportaje sunt la Ştirile ProTV.","icon":"https://www.programetv.ro/img/shows/84/54/stirile-pro-tv.png?key=Z2lfZnVial90cmFyZXZwLzAwLzAwLzA1LzE4MzgxMnktMTIwazE3MC1hLW40NTk4MW9zLmNhdA==","templating":[]}],"date":"2021-11-07","controls ":[{"date":"2021-11-03","slug":"ieri","label":"Ieri","name":"Ieri","url":"https://www.programetv.ro/program-tv/pro-tv/ieri/"},{"date":"2021-11-04","slug":"azi","label":"Azi","name":"Azi","url":"https://www.programetv.ro/program-tv/pro-tv/"},{"date":"2021-11-05","slug":"vineri","label":"Vi","name":"Vineri","url":"https://www.programetv.ro/program-tv/pro-tv/vineri/"},{"date":"2021-11-06","slug":"sambata","label":"Sb","name":"Sâmbătă","url":"https://www.programetv.ro/program-tv/pro-tv/sambata/"},{"date":"2021-11-07","slug":"duminica","label":"Du","name":"Duminică","url":"https://www.programetv.ro/program-tv/pro-tv/duminica/"},{"date":"2021-11-08","slug":"luni","label":"Lu","name":"Luni","url":"https://www.programetv.ro/program-tv/pro-tv/luni/"},{"date":"2021-11-09","slug":"marti","label":"Ma","name":"Marți","url":"https://www.programetv.ro/program-tv/pro-tv/marti/"}],"todayDate":"2021-11-04","adsenabled":true};
var __controls = [{"date":"2021-11-03","slug":"ieri","label":"Ieri","name":"Ieri","url":"https://www.programetv.ro/program-tv/pro-tv/ieri/"},{"date":"2021-11-04","slug":"azi","label":"Azi","name":"Azi","url":"https://www.programetv.ro/program-tv/pro-tv/"},{"date":"2021-11-05","slug":"vineri","label":"Vi","name":"Vineri","url":"https://www.programetv.ro/program-tv/pro-tv/vineri/"},{"date":"2021-11-06","slug":"sambata","label":"Sb","name":"Sâmbătă","url":"https://www.programetv.ro/program-tv/pro-tv/sambata/"},{"date":"2021-11-07","slug":"duminica","label":"Du","name":"Duminică","url":"https://www.programetv.ro/program-tv/pro-tv/duminica/"},{"date":"2021-11-08","slug":"luni","label":"Lu","name":"Luni","url":"https://www.programetv.ro/program-tv/pro-tv/luni/"},{"date":"2021-11-09","slug":"marti","label":"Ma","name":"Marți","url":"https://www.programetv.ro/program-tv/pro-tv/marti/"}];</script></head>
<body></body>
</html>`
it('can generate valid url', () => {
const result = url({ date, channel })
@@ -30,6 +16,7 @@ it('can generate valid url', () => {
})
it('can parse response', () => {
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html'), 'utf8')
const result = parser({ date, channel, content })
expect(result).toMatchObject([
{
@@ -48,21 +35,8 @@ it('can handle empty guide', () => {
const result = parser({
date,
channel,
content: `
<!DOCTYPE html>
<html lang="en-US">
<head>
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WPX9FM9');
var cfg = {"homeUrl":"https://www.programetv.ro/","loginUrl":"https://www.programetv.ro/auth/login","logoutUrl":"https://www.programetv.ro/auth/logout","nowOnTvUrl":"https://www.programetv.ro/acum-la-tv/","favoriteStationsUrl":"https://www.programetv.ro/posturi-tv/favorite/","saveFavoritesUrl":"https://www.programetv.ro/save-favorites/","popularStationsUrl":"https://www.programetv.ro/posturi-tv/populare/","stationListUrl":"https://www.programetv.ro/posturi-tv/","privacyPolicyUrl":"https://www.programetv.ro/privacy-policy/","user":false,"showMovieDetails":true,"banners":{"inlist":{"enabled":true,"code":"9647692440"},"footer":{"enabled":true,"code":"9608163999"},"modal":{"enabled":true,"code":"3427954368"}}};
var __stations = [];</script></head>
<body></body>
</html>
`
content: fs.readFileSync(path.resolve(__dirname, '__data__/no_content.html'), 'utf8')
})
expect(result).toMatchObject([])
})

View File

@@ -0,0 +1 @@
{"programmes":[{"nid":"8857261","src":"https://programme-tv.vini.pf/sites/default/files/img-icones/192.png","alt":"","title":"","url":"/tf1","programmes":[{"nidP":"24162436","categorieP":"Magazine","categorieTIDP":"1033","episodeP":"-1","titreP":"Reportages découverte","heureP":"13:50","timestampDeb":1637452200,"timestampFin":1637457000,"altP":"","titleP":"","legendeP":"La coloc ne connaît pas la crise","desc":"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.","srcP":"https://programme-tv.vini.pf/sites/default/files/img-icones/52ada51ed86b7e7bc11eaee83ff2192785989d77.jpg","urlP":"/reportages-decouverte-20112021-1350","width":58.333333333333,"active":false,"progression":0,"test":0,"nowphp":1637509179},{"nidP":"24162437","categorieP":"Magazine","categorieTIDP":"1033","episodeP":"-1","titreP":"Les docs du week-end","heureP":"15:10","timestampDeb":1637457000,"timestampFin":1637461800,"altP":"","titleP":"","legendeP":"Que sont-ils devenus ? L'incroyable destin des stars des émissions de télécrochet","desc":"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 ?","srcP":"https://programme-tv.vini.pf/sites/default/files/img-icones/6e64cfbc55c1f4cbd11e3011401403d4dc08c6d2.jpg","urlP":"/les-docs-du-week-end-20112021-1510","width":41.666666666667,"active":false,"progression":0,"test":0,"nowphp":1637509179}]}]}

View File

@@ -0,0 +1 @@
{"programmes":[{"nid":"8857261","src":"https://programme-tv.vini.pf/sites/default/files/img-icones/192.png","alt":"","title":"","url":"/tf1","programmes":[{"nidP":"24162437","categorieP":"Magazine","categorieTIDP":"1033","episodeP":"-1","titreP":"Les docs du week-end","heureP":"15:10","timestampDeb":1637457000,"timestampFin":1637461800,"altP":"","titleP":"","legendeP":"Que sont-ils devenus ? L'incroyable destin des stars des émissions de télécrochet","desc":"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 ?","srcP":"https://programme-tv.vini.pf/sites/default/files/img-icones/6e64cfbc55c1f4cbd11e3011401403d4dc08c6d2.jpg","urlP":"/les-docs-du-week-end-20112021-1510","width":25,"active":false,"progression":0,"test":0,"nowphp":1637509998},{"nidP":"24162438","categorieP":"Magazine","categorieTIDP":"1033","episodeP":"-1","titreP":"50mn Inside","heureP":"16:30","timestampDeb":1637461800,"timestampFin":1637466300,"altP":"","titleP":"","legendeP":"L'actu","desc":"50'INSIDE, c'est toute l'actualité des stars résumée, chaque samedi, Le rendez-vous glamour pour retrouver toujours,,","srcP":"https://programme-tv.vini.pf/sites/default/files/img-icones/3d7e252312dacb5fb7a1a786fa0022ca1be15499.jpg","urlP":"/50mn-inside-20112021-1630","width":62.5,"active":false,"progression":0,"test":0,"nowphp":1637509998}]}]}

View File

@@ -0,0 +1 @@
{"programmes":[{"nid":"8857261","src":"https://programme-tv.vini.pf/sites/default/files/img-icones/192.png","alt":"","title":"","url":"/tf1","programmes":[]}]}

View File

@@ -0,0 +1 @@
{"programmes":[{"nid":"8857261","src":"https://programme-tv.vini.pf/sites/default/files/img-icones/192.png","alt":"","title":"","url":"/tf1","programmes":[]}]}

View File

@@ -1,4 +1,6 @@
const { parser, url, request } = require('./programme-tv.vini.pf.config.js')
const fs = require('fs')
const path = require('path')
const axios = require('axios')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
@@ -31,21 +33,16 @@ it('can parse response', done => {
axios.post.mockImplementation((url, data) => {
if (data.dateDebut === '2021-11-20T16:00:00-10:00') {
return Promise.resolve({
data: Buffer.from(
'{"programmes":[{"nid":"8857261","src":"https://programme-tv.vini.pf/sites/default/files/img-icones/192.png","alt":"","title":"","url":"/tf1","programmes":[{"nidP":"24162437","categorieP":"Magazine","categorieTIDP":"1033","episodeP":"-1","titreP":"Les docs du week-end","heureP":"15:10","timestampDeb":1637457000,"timestampFin":1637461800,"altP":"","titleP":"","legendeP":"Que sont-ils devenus ? L\'incroyable destin des stars des émissions de télécrochet","desc":"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 ?","srcP":"https://programme-tv.vini.pf/sites/default/files/img-icones/6e64cfbc55c1f4cbd11e3011401403d4dc08c6d2.jpg","urlP":"/les-docs-du-week-end-20112021-1510","width":25,"active":false,"progression":0,"test":0,"nowphp":1637509998},{"nidP":"24162438","categorieP":"Magazine","categorieTIDP":"1033","episodeP":"-1","titreP":"50mn Inside","heureP":"16:30","timestampDeb":1637461800,"timestampFin":1637466300,"altP":"","titleP":"","legendeP":"L\'actu","desc":"50\'INSIDE, c\'est toute l\'actualité des stars résumée, chaque samedi, Le rendez-vous glamour pour retrouver toujours,,","srcP":"https://programme-tv.vini.pf/sites/default/files/img-icones/3d7e252312dacb5fb7a1a786fa0022ca1be15499.jpg","urlP":"/50mn-inside-20112021-1630","width":62.5,"active":false,"progression":0,"test":0,"nowphp":1637509998}]}]}'
)
data: Buffer.from(fs.readFileSync(path.resolve(__dirname, '__data__/content_1.json')))
})
} else {
return Promise.resolve({
data: Buffer.from(
'{"programmes":[{"nid":"8857261","src":"https://programme-tv.vini.pf/sites/default/files/img-icones/192.png","alt":"","title":"","url":"/tf1","programmes":[]}]}'
)
})
}
})
data: Buffer.from(fs.readFileSync(path.resolve(__dirname, '__data__/content_2.json')))
})
}
})
const content =
'{"programmes":[{"nid":"8857261","src":"https://programme-tv.vini.pf/sites/default/files/img-icones/192.png","alt":"","title":"","url":"/tf1","programmes":[{"nidP":"24162436","categorieP":"Magazine","categorieTIDP":"1033","episodeP":"-1","titreP":"Reportages découverte","heureP":"13:50","timestampDeb":1637452200,"timestampFin":1637457000,"altP":"","titleP":"","legendeP":"La coloc ne connaît pas la crise","desc":"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.","srcP":"https://programme-tv.vini.pf/sites/default/files/img-icones/52ada51ed86b7e7bc11eaee83ff2192785989d77.jpg","urlP":"/reportages-decouverte-20112021-1350","width":58.333333333333,"active":false,"progression":0,"test":0,"nowphp":1637509179},{"nidP":"24162437","categorieP":"Magazine","categorieTIDP":"1033","episodeP":"-1","titreP":"Les docs du week-end","heureP":"15:10","timestampDeb":1637457000,"timestampFin":1637461800,"altP":"","titleP":"","legendeP":"Que sont-ils devenus ? L\'incroyable destin des stars des émissions de télécrochet","desc":"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 ?","srcP":"https://programme-tv.vini.pf/sites/default/files/img-icones/6e64cfbc55c1f4cbd11e3011401403d4dc08c6d2.jpg","urlP":"/les-docs-du-week-end-20112021-1510","width":41.666666666667,"active":false,"progression":0,"test":0,"nowphp":1637509179}]}]}'
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
parser({ content, channel, date })
.then(result => {
@@ -98,7 +95,7 @@ it('can handle empty guide', done => {
date,
channel,
content:
'{"programmes":[{"nid":"8857261","src":"https://programme-tv.vini.pf/sites/default/files/img-icones/192.png","alt":"","title":"","url":"/tf1","programmes":[]}]}'
''
})
.then(result => {
expect(result).toMatchObject([])

View File

@@ -0,0 +1 @@
<!DOCTYPE html><html lang="pl"> <head></head> <body class="withFilters pageChannel"> <div id="channelPage"> <div id="channelTV" class="nextToMenu"> <section class="channelEmissions"> <header> <span class="logoTV"> <img src="//ocdn.eu/ptv2-images-transforms/1/zB4kr1sb2dvLW1pZ3JhdGVkLzEzdGgtc3RyZWV0LnBuZ5KVAmQAwsOVAgAowsM" alt="13th Street"/> </span> </header> <div class="emissions"> <ul> <li class="hh03 hh04 fltrSerie"> <div class="hours"> <span class="hour">03:20</span> </div><div class="titles"> <a href="/tv/law-and-order-odcinek-15/rlmzu?entry=21970867" >Law &amp; Order, odc. 15: Letzte Worte</a > <span class="type">Krimiserie</span> <p> Bei einer Reality-TV-Show stirbt einer der Teilnehmer. Zunächst tappen Briscoe (Jerry Orbach) und Green (Jesse L.... </p></div></li><li class="hh23 hh00 fltrSerie"> <div class="hours"> <span class="hour">23:30</span> </div><div class="titles"> <a href="/tv/navy-cis-odcinek-1/73vbw?entry=22035734" >Navy CIS, odc. 1: New Orleans</a > <span class="type">Krimiserie</span> <p> Der Abgeordnete Dan McLane, ein ehemaliger Vorgesetzter von Gibbs, wird in New Orleans ermordet. In den 90er Jahren... </p></div></li><li class="hh01 fltrSerie"> <div class="hours"> <span class="hour">01:00</span> </div><div class="titles"> <a href="/tv/navy-cis-la-odcinek-13/tuc34?entry=22035821" >Navy CIS: L.A, odc. 13: High Society</a > <span class="type">Krimiserie</span> <p> Die Zahl der Drogentoten ist gestiegen. Das Team des NCIS glaubt, dass sich Terroristen durch den zunehmenden... </p></div></li></ul> </div></section> </div></div></body></html>

View File

@@ -0,0 +1 @@
<!DOCTYPE html><html><head></head><body></body></html>

View File

@@ -1,5 +1,7 @@
const MockDate = require('mockdate')
const { parser, url } = require('./programtv.onet.pl.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
@@ -11,8 +13,6 @@ const channel = {
site_id: '13th-street-250',
xmltv_id: '13thStreet.de'
}
const content =
'<!DOCTYPE html><html lang="pl"> <head></head> <body class="withFilters pageChannel"> <div id="channelPage"> <div id="channelTV" class="nextToMenu"> <section class="channelEmissions"> <header> <span class="logoTV"> <img src="//ocdn.eu/ptv2-images-transforms/1/zB4kr1sb2dvLW1pZ3JhdGVkLzEzdGgtc3RyZWV0LnBuZ5KVAmQAwsOVAgAowsM" alt="13th Street"/> </span> </header> <div class="emissions"> <ul> <li class="hh03 hh04 fltrSerie"> <div class="hours"> <span class="hour">03:20</span> </div><div class="titles"> <a href="/tv/law-and-order-odcinek-15/rlmzu?entry=21970867" >Law &amp; Order, odc. 15: Letzte Worte</a > <span class="type">Krimiserie</span> <p> Bei einer Reality-TV-Show stirbt einer der Teilnehmer. Zunächst tappen Briscoe (Jerry Orbach) und Green (Jesse L.... </p></div></li><li class="hh23 hh00 fltrSerie"> <div class="hours"> <span class="hour">23:30</span> </div><div class="titles"> <a href="/tv/navy-cis-odcinek-1/73vbw?entry=22035734" >Navy CIS, odc. 1: New Orleans</a > <span class="type">Krimiserie</span> <p> Der Abgeordnete Dan McLane, ein ehemaliger Vorgesetzter von Gibbs, wird in New Orleans ermordet. In den 90er Jahren... </p></div></li><li class="hh01 fltrSerie"> <div class="hours"> <span class="hour">01:00</span> </div><div class="titles"> <a href="/tv/navy-cis-la-odcinek-13/tuc34?entry=22035821" >Navy CIS: L.A, odc. 13: High Society</a > <span class="type">Krimiserie</span> <p> Die Zahl der Drogentoten ist gestiegen. Das Team des NCIS glaubt, dass sich Terroristen durch den zunehmenden... </p></div></li></ul> </div></section> </div></div></body></html>'
it('can generate valid url', () => {
MockDate.set(dayjs.utc('2021-11-24', 'YYYY-MM-DD').startOf('d'))
@@ -31,6 +31,7 @@ it('can generate valid url for next day', () => {
})
it('can parse response', () => {
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.html'))
const result = parser({ content, date }).map(p => {
p.start = p.start.toJSON()
p.stop = p.stop.toJSON()
@@ -69,7 +70,7 @@ it('can handle empty guide', () => {
const result = parser({
date,
channel,
content: '<!DOCTYPE html><html><head></head><body></body></html>'
content: fs.readFileSync(path.resolve(__dirname, '__data__/no_content.html'))
})
expect(result).toMatchObject([])
})

View File

@@ -0,0 +1 @@
{ "id": "Page-e120a813-1b92-4057-a214-15943d95aa68", "title": "Pagina Palinsesto", "channel": "Rai 2", "date": "03-05-2022", "events": [ { "id": "ContentItem-2f81030d-803b-456a-9ea5-40233234fd9d", "name": "The Good Doctor S3E5 - La prima volta", "episode_title": "La prima volta", "episode": "5", "season": "3", "description": "Shaun affronta il suo primo intervento. Il caso si rivela complicato e, nonostante Shaun abbia un'idea geniale, sarà Andrews a portare a termine l'operazione.", "channel": "Rai 2", "date": "03/05/2022", "hour": "19:40", "duration": "00:50:00", "duration_in_minutes": "50 min", "path_id": "", "weblink": "", "event_weblink": "/dirette/rai2/The-Good-Doctor-S3E5---La-prima-volta-2f81030d-803b-456a-9ea5-40233234fd9d.html", "has_video": false, "image": "/dl/img/2020/03/09/1583748471860_dddddd.jpg", "playlist_id": "11430689", "program": { "name": "The Good Doctor", "path_id": "/programmi/thegooddoctor.json", "info_url": "/programmi/info/757edeac-6fff-4dea-afcd-0bcb39f9ea83.json", "weblink": "/programmi/thegooddoctor" } } ], "track_info": { "id": "", "domain": "raiplay", "platform": "[platform]", "media_type": "", "page_type": "", "editor": "raiplay", "year": "2019", "edit_year": "", "section": "guida tv", "sub_section": "rai 2", "content": "guida tv", "title": "", "channel": "", "date": "2019-09-08", "typology": "", "genres": [], "sub_genres": [], "program_title": "", "program_typology": "", "program_genres": [], "program_sub_genres": [], "edition": "", "season": "", "episode_number": "", "episode_title": "", "form": "", "listaDateMo": [], "dfp": {} }}

View File

@@ -0,0 +1 @@
{"events":[],"total":0}

View File

@@ -1,6 +1,6 @@
// npm run grab --- --site=raiplay.it
const { parser, url } = require('./raiplay.it.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
@@ -18,8 +18,7 @@ it('can generate valid url', () => {
})
it('can parse response', () => {
const content =
'{ "id": "Page-e120a813-1b92-4057-a214-15943d95aa68", "title": "Pagina Palinsesto", "channel": "Rai 2", "date": "03-05-2022", "events": [ { "id": "ContentItem-2f81030d-803b-456a-9ea5-40233234fd9d", "name": "The Good Doctor S3E5 - La prima volta", "episode_title": "La prima volta", "episode": "5", "season": "3", "description": "Shaun affronta il suo primo intervento. Il caso si rivela complicato e, nonostante Shaun abbia un\'idea geniale, sarà Andrews a portare a termine l\'operazione.", "channel": "Rai 2", "date": "03/05/2022", "hour": "19:40", "duration": "00:50:00", "duration_in_minutes": "50 min", "path_id": "", "weblink": "", "event_weblink": "/dirette/rai2/The-Good-Doctor-S3E5---La-prima-volta-2f81030d-803b-456a-9ea5-40233234fd9d.html", "has_video": false, "image": "/dl/img/2020/03/09/1583748471860_dddddd.jpg", "playlist_id": "11430689", "program": { "name": "The Good Doctor", "path_id": "/programmi/thegooddoctor.json", "info_url": "/programmi/info/757edeac-6fff-4dea-afcd-0bcb39f9ea83.json", "weblink": "/programmi/thegooddoctor" } } ], "track_info": { "id": "", "domain": "raiplay", "platform": "[platform]", "media_type": "", "page_type": "", "editor": "raiplay", "year": "2019", "edit_year": "", "section": "guida tv", "sub_section": "rai 2", "content": "guida tv", "title": "", "channel": "", "date": "2019-09-08", "typology": "", "genres": [], "sub_genres": [], "program_title": "", "program_typology": "", "program_genres": [], "program_sub_genres": [], "edition": "", "season": "", "episode_number": "", "episode_title": "", "form": "", "listaDateMo": [], "dfp": {} }}'
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
const result = parser({ content, date }).map(p => {
p.start = p.start.toJSON()
p.stop = p.stop.toJSON()
@@ -45,7 +44,7 @@ it('can parse response', () => {
it('can handle empty guide', () => {
const result = parser({
content: '{"events":[],"total":0}'
content: fs.readFileSync(path.resolve(__dirname, '__data__/no_content.json'))
})
expect(result).toMatchObject([])
})

View File

@@ -0,0 +1,21 @@
[
{
"seriesName": "Vakre og ville Oman",
"name": "Vakre og ville Oman",
"description": "Oman er eit arabisk skattkammer av unike habitat og variert dyreliv. Rev, kvalhai, reptil og skjelpadder er blant skapningane du finn her.",
"season": 1,
"episode": 1,
"genres": [
"Dokumentar",
"Fakta",
"Natur"
],
"actors": [
"Gergana Muskalla"
],
"director": "Stefania Muller",
"imagePackUri": "https://imageservice.rikstv.no/hash/EC206C374F42287C0BDF850A7D3CB4D3.jpg",
"broadcastedTime": "2025-01-13T23:00:00Z",
"broadcastedTimeEnd": "2025-01-13T23:55:00Z"
}
]

View File

@@ -1,4 +1,6 @@
const { parser, url } = require('./rikstv.no.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
@@ -22,23 +24,7 @@ describe('rikstv.no Module Tests', () => {
})
it('can parse response', () => {
const content = JSON.stringify([
{
seriesName: 'Vakre og ville Oman',
name: 'Vakre og ville Oman',
description:
'Oman er eit arabisk skattkammer av unike habitat og variert dyreliv. Rev, kvalhai, reptil og skjelpadder er blant skapningane du finn her.',
season: 1,
episode: 1,
genres: ['Dokumentar', 'Fakta', 'Natur'],
actors: ['Gergana Muskalla'],
director: 'Stefania Muller',
imagePackUri: 'https://imageservice.rikstv.no/hash/EC206C374F42287C0BDF850A7D3CB4D3.jpg',
broadcastedTime: '2025-01-13T23:00:00Z',
broadcastedTimeEnd: '2025-01-13T23:55:00Z'
}
])
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
const result = parser({ content }).map(p => {
p.start = dayjs(p.start).toISOString()
p.stop = dayjs(p.stop).toISOString()

View File

@@ -0,0 +1 @@
{"id":2,"channel":"TV2","channelId":"2","image":"/live_channel/tv2_Trans.png","idAuthor":9,"type":"TV","timezone":8,"dateCreated":"2022-07-08T01:22:33.233","dateModified":"2022-07-21T21:58:39.77","itemCount":30,"prev":"https://rtm-admin.glueapi.io/v3/epg/2/ChannelSchedule?dateStart=2022-09-03&dateEnd=2022-09-03","next":"https://rtm-admin.glueapi.io/v3/epg/2/ChannelSchedule?dateStart=2022-09-05&dateEnd=2022-09-05","schedule":[{"idEPGProgramSchedule":109303,"dateTimeStart":"2022-09-04T19:00:00","dateTimeEnd":"2022-09-04T20:00:00","scheduleProgramTitle":"Hope Of Life","scheduleProgramDescription":"Kisah kehidupan 3 pakar bedah yang berbeza status dan latar belakang, namun mereka komited dengan kerjaya mereka sebagai doktor. Lakonan : Johnson Low, Elvis Chin, Mayjune Tan, Kelvin Liew, Jacky Kam dan Katrina Ho.","scheduleEpisodeNumber":0,"scheduleSeries":0,"duration":3600,"idEPGProgram":3603,"programTitle":"Hope Of Life","description":"Kisah kehidupan 3 pakar bedah yang berbeza status dan latar belakang, namun mereka komited dengan kerjaya mereka sebagai doktor. Lakonan : Johnson Low, Elvis Chin, Mayjune Tan, Kelvin Liew, Jacky Kam dan Katrina Ho.","episodeNumber":0,"series":0,"repeat":"Never","dateModified":"2022-08-29T02:14:56.647","dateCreated":"0001-01-01T00:00:00"}]}

View File

@@ -0,0 +1 @@
{"id":2,"channel":"TV2","channelId":"2","schedule":[]}

View File

@@ -1,4 +1,6 @@
const { parser, url } = require('./rtmklik.rtm.gov.my.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
@@ -18,9 +20,7 @@ it('can generate valid url', () => {
})
it('can parse response', () => {
const content =
'{"id":2,"channel":"TV2","channelId":"2","image":"/live_channel/tv2_Trans.png","idAuthor":9,"type":"TV","timezone":8,"dateCreated":"2022-07-08T01:22:33.233","dateModified":"2022-07-21T21:58:39.77","itemCount":30,"prev":"https://rtm-admin.glueapi.io/v3/epg/2/ChannelSchedule?dateStart=2022-09-03&dateEnd=2022-09-03","next":"https://rtm-admin.glueapi.io/v3/epg/2/ChannelSchedule?dateStart=2022-09-05&dateEnd=2022-09-05","schedule":[{"idEPGProgramSchedule":109303,"dateTimeStart":"2022-09-04T19:00:00","dateTimeEnd":"2022-09-04T20:00:00","scheduleProgramTitle":"Hope Of Life","scheduleProgramDescription":"Kisah kehidupan 3 pakar bedah yang berbeza status dan latar belakang, namun mereka komited dengan kerjaya mereka sebagai doktor. Lakonan : Johnson Low, Elvis Chin, Mayjune Tan, Kelvin Liew, Jacky Kam dan Katrina Ho.","scheduleEpisodeNumber":0,"scheduleSeries":0,"duration":3600,"idEPGProgram":3603,"programTitle":"Hope Of Life","description":"Kisah kehidupan 3 pakar bedah yang berbeza status dan latar belakang, namun mereka komited dengan kerjaya mereka sebagai doktor. Lakonan : Johnson Low, Elvis Chin, Mayjune Tan, Kelvin Liew, Jacky Kam dan Katrina Ho.","episodeNumber":0,"series":0,"repeat":"Never","dateModified":"2022-08-29T02:14:56.647","dateCreated":"0001-01-01T00:00:00"}]}'
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
const result = parser({ content, channel, date }).map(p => {
p.start = p.start.toJSON()
p.stop = p.stop.toJSON()
@@ -42,7 +42,7 @@ it('can handle empty guide', () => {
const result = parser({
date,
channel,
content: '{"id":2,"channel":"TV2","channelId":"2","schedule":[]}'
content: fs.readFileSync(path.resolve(__dirname, '__data__/no_content.json'))
})
expect(result).toMatchObject([])
})

View File

@@ -0,0 +1 @@
[{ "Event_id": "0x6a57", "Start_time": "2024年07月27日05時00分00秒", "Duration": "01:00:00", "Event_name": "ヒーリングタイム&ヘッドラインニュース", "Event_text": "ねこの足跡", "Component": "480i 16:9 パンベクトルなし", "Sound": "ステレオ", "Event_detail": ""}]

View File

@@ -1,4 +1,6 @@
const { parser, url } = require('./s.mxtv.jp.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
@@ -11,8 +13,6 @@ const channel = {
name: 'Tokyo MX2',
xmltv_id: 'TokyoMX2.jp'
}
const content =
'[{ "Event_id": "0x6a57", "Start_time": "2024年07月27日05時00分00秒", "Duration": "01:00:00", "Event_name": "ヒーリングタイム&ヘッドラインニュース", "Event_text": "ねこの足跡", "Component": "480i 16:9 パンベクトルなし", "Sound": "ステレオ", "Event_detail": ""}]'
it('can generate valid url', () => {
const result = url({ date, channel })
@@ -20,6 +20,7 @@ it('can generate valid url', () => {
})
it('can parse response', () => {
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
const result = parser({ date, channel, content }).map(p => {
p.start = p.start.toJSON()
p.stop = p.stop.toJSON()

View File

@@ -0,0 +1 @@
{"items":[{"channelId":"996520","items":[{"actualFrom":"2023-11-11T00:00:00.000+00:00","actualTo":"2023-11-11T00:30:00.000+00:00","description":"The presenter reviews the most prominent episodes of news programs produced by the channel's team on a weekly basis, which include the most important global updates and developments at all levels.","duration":null,"emptySlot":false,"episodeNumber":194,"from":"2023-11-11T00:00:00.000+00:00","genres":["TV Show"],"productId":null,"productionYear":null,"productPoster":"https://imagesmbc.whatsonindia.com/dasimages/landscape/1920x1080/F968D4A39DB25793E9EED1BDAFBAD2EA8A8F9B30Z.jpg","productSubType":null,"productType":null,"replay":false,"restritectContent":null,"seasonId":null,"seasonNumber":"1","showId":null,"streamInfo":null,"title":"Menassaatona Fi Osboo'","to":"2023-11-11T00:30:00.000+00:00"}]}]}

View File

@@ -1,4 +1,6 @@
const { url, parser } = require('./shahid.mbc.net.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
@@ -18,8 +20,7 @@ it('can generate valid url', () => {
})
it('can parse response', () => {
const content =
'{"items":[{"channelId":"996520","items":[{"actualFrom":"2023-11-11T00:00:00.000+00:00","actualTo":"2023-11-11T00:30:00.000+00:00","description":"The presenter reviews the most prominent episodes of news programs produced by the channel\'s team on a weekly basis, which include the most important global updates and developments at all levels.","duration":null,"emptySlot":false,"episodeNumber":194,"from":"2023-11-11T00:00:00.000+00:00","genres":["TV Show"],"productId":null,"productionYear":null,"productPoster":"https://imagesmbc.whatsonindia.com/dasimages/landscape/1920x1080/F968D4A39DB25793E9EED1BDAFBAD2EA8A8F9B30Z.jpg","productSubType":null,"productType":null,"replay":false,"restritectContent":null,"seasonId":null,"seasonNumber":"1","showId":null,"streamInfo":null,"title":"Menassaatona Fi Osboo\'","to":"2023-11-11T00:30:00.000+00:00"}]}]}'
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
const result = parser({ content, channel, date })
expect(result).toMatchObject([

View File

@@ -0,0 +1 @@
{"list":[{"id":"395","nom":"CANAL CLARO","num":"102","logo":"7c4b9e8566a6e867d1db4c7ce845f1f4.jpg","cat":"Exclusivos Claro","prog":[{"id":"665724465","nom":"Worst Cooks In America","ini":1636588800,"fin":1636592400}]}],"error":null}

View File

@@ -0,0 +1 @@
{"list":[],"error":null}

View File

@@ -1,4 +1,6 @@
const { parser, url, request } = require('./siba.com.co.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
@@ -10,8 +12,6 @@ const channel = {
site_id: '395',
xmltv_id: 'CanalClaro.cl'
}
const content =
'{"list":[{"id":"395","nom":"CANAL CLARO","num":"102","logo":"7c4b9e8566a6e867d1db4c7ce845f1f4.jpg","cat":"Exclusivos Claro","prog":[{"id":"665724465","nom":"Worst Cooks In America","ini":1636588800,"fin":1636592400}]}],"error":null}'
it('can generate valid url', () => {
expect(url).toBe('http://devportal.siba.com.co/index.php?action=grilla')
@@ -32,6 +32,7 @@ it('can generate valid request data', () => {
})
it('can parse response', () => {
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
const result = parser({ date, channel, content })
expect(result).toMatchObject([
{
@@ -46,7 +47,8 @@ it('can handle empty guide', () => {
const result = parser({
date,
channel,
content: '{"list":[],"error":null}'
content: fs.readFileSync(path.resolve(__dirname, '__data__/no_content.json'))
})
expect(result).toMatchObject([])
})

View File

@@ -0,0 +1 @@
{"cl":[{"ci":522,"el":[{"ei":122309300,"bsdt":1645916700000,"bst":"00:05","bedt":1645918200000,"len":25,"et":"King of Queens","ec":"Comedyserie","cop":"USA","yop":2001,"fsk":"ab 0 Jahre","epit":"Der Experte","sn":"4","en":"11","pu":"/static/img/program_guide/1522936_s.jpg"},{"ei":122309301,"bsdt":1645918200000,"bst":"00:30","bedt":1645919700000,"len":25,"et":"King of Queens","ec":"Comedyserie","cop":"USA","yop":2001,"fsk":"ab 0 Jahre","epit":"Speedy Gonzales","sn":"4","en":"12","pu":"/static/img/program_guide/1522937_s.jpg"}]}]}

View File

@@ -1,4 +1,6 @@
const { parser, url, request } = require('./sky.de.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
dayjs.extend(utc)
@@ -9,9 +11,6 @@ const channel = {
xmltv_id: 'WarnerTVComedyHD.de'
}
const content =
'{"cl":[{"ci":522,"el":[{"ei":122309300,"bsdt":1645916700000,"bst":"00:05","bedt":1645918200000,"len":25,"et":"King of Queens","ec":"Comedyserie","cop":"USA","yop":2001,"fsk":"ab 0 Jahre","epit":"Der Experte","sn":"4","en":"11","pu":"/static/img/program_guide/1522936_s.jpg"},{"ei":122309301,"bsdt":1645918200000,"bst":"00:30","bedt":1645919700000,"len":25,"et":"King of Queens","ec":"Comedyserie","cop":"USA","yop":2001,"fsk":"ab 0 Jahre","epit":"Speedy Gonzales","sn":"4","en":"12","pu":"/static/img/program_guide/1522937_s.jpg"}]}]}'
it('can generate valid url', () => {
expect(url).toBe('https://www.sky.de/sgtvg/service/getBroadcastsForGrid')
})
@@ -28,6 +27,7 @@ it('can generate valid request data', () => {
})
it('can parse response', () => {
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
const result = parser({ content, channel }).map(p => {
p.start = p.start.toJSON()
p.stop = p.stop.toJSON()

View File

@@ -0,0 +1,34 @@
[
{
"midill": "STOD2",
"midill_heiti": "Stöð 2",
"dagsetning": "2025-01-03T00:00:00Z",
"upphaf": "2025-01-03T08:00:00Z",
"titill": "Telma Borgþórsdóttir",
"isltitill": "Heimsókn",
"undirtitill": "Telma Borgþórsdóttir",
"seria": 8,
"thattur": 5,
"thattafjoldi": 10,
"birta_thatt": 1,
"opin": 0,
"beint": 0,
"frumsyning": 0,
"framundan_i_beinni": 0,
"tegund": "SER",
"flokkur": "Icelandic",
"adalhlutverk": "",
"leikstjori": "",
"ar": "2019",
"bannad": "Green",
"recidefni": 592645105,
"recidlidur": 592645184,
"recidsyning": null,
"refno": null,
"frelsi": 0,
"netdagar": 0,
"lysing": "Frábærir þættir með Sindra Sindrasyni sem lítur inn hjá íslenskum fagurkerum. Heimilin eru jafn ólík og þau eru mörg en eiga það þó eitt sameiginlegt að vera sett saman af alúð og smekklegheitum. Sindri hefur líka einstakt lag á að ná fram því besta í viðmælendum sínum.",
"slott": 15,
"slotlengd": "00:15"
}
]

View File

@@ -1,4 +1,6 @@
const { parser, url } = require('./stod2.is.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
@@ -11,49 +13,13 @@ dayjs.extend(timezone)
const date = dayjs.utc('2025-01-03', 'YYYY-MM-DD').startOf('day')
const channel = { site_id: 'stod2', xmltv_id: 'Stod2.is' }
const mockEpgData = JSON.stringify([
{
midill: 'STOD2',
midill_heiti: 'Stöð 2',
dagsetning: '2025-01-03T00:00:00Z',
upphaf: '2025-01-03T08:00:00Z',
titill: 'Telma Borgþórsdóttir',
isltitill: 'Heimsókn',
undirtitill: 'Telma Borgþórsdóttir',
seria: 8,
thattur: 5,
thattafjoldi: 10,
birta_thatt: 1,
opin: 0,
beint: 0,
frumsyning: 0,
framundan_i_beinni: 0,
tegund: 'SER',
flokkur: 'Icelandic',
adalhlutverk: '',
leikstjori: '',
ar: '2019',
bannad: 'Green',
recidefni: 592645105,
recidlidur: 592645184,
recidsyning: null,
refno: null,
frelsi: 0,
netdagar: 0,
lysing:
'Frábærir þættir með Sindra Sindrasyni sem lítur inn hjá íslenskum fagurkerum. Heimilin eru jafn ólík og þau eru mörg en eiga það þó eitt sameiginlegt að vera sett saman af alúð og smekklegheitum. Sindri hefur líka einstakt lag á að ná fram því besta í viðmælendum sínum.',
slott: 15,
slotlengd: '00:15'
}
])
it('can generate valid url', () => {
const generatedUrl = url({ date, channel })
expect(generatedUrl).toBe('https://api.stod2.is/dagskra/api/stod2/2025-01-03')
})
it('can parse response', () => {
const content = mockEpgData
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
const result = parser({ content }).map(p => {
p.start = p.start.toISOString()
p.stop = p.stop.toISOString()

View File

@@ -0,0 +1 @@
{"data":[{"date":"2023/08/20","weekday":"SUN","schedule":[{"programId":30668,"dateTime":"2023/08/20 00:00","time":"00:00","image":"https://prod-img.taiwanplus.com/live-schedule/Single/S30668_20230810104937.webp","title":"Master Class","shortDescription":"From blockchain to Buddha statues, Taiwans culture is a kaleidoscope of old and new just waiting to be discovered.","description":"From blockchain to Buddha statues, Taiwans culture is a kaleidoscope of old and new just waiting to be discovered.","ageRating":"0+","programWebSiteType":"4","url":"","vodId":null,"categoryId":90000474,"categoryType":2,"categoryName":"TaiwanPlus ✕ Discovery","categoryFullPath":"Originals/TaiwanPlus ✕ Discovery","encodedCategoryFullPath":"originals/taiwanplus-discovery"}]}],"success":true,"code":"0000","message":""}

View File

@@ -1,4 +1,6 @@
const { url, parser } = require('./taiwanplus.com.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
dayjs.extend(utc)
@@ -16,8 +18,7 @@ it('can generate valid url', () => {
})
it('can parse response', () => {
const content =
'{"data":[{"date":"2023/08/20","weekday":"SUN","schedule":[{"programId":30668,"dateTime":"2023/08/20 00:00","time":"00:00","image":"https://prod-img.taiwanplus.com/live-schedule/Single/S30668_20230810104937.webp","title":"Master Class","shortDescription":"From blockchain to Buddha statues, Taiwans culture is a kaleidoscope of old and new just waiting to be discovered.","description":"From blockchain to Buddha statues, Taiwans culture is a kaleidoscope of old and new just waiting to be discovered.","ageRating":"0+","programWebSiteType":"4","url":"","vodId":null,"categoryId":90000474,"categoryType":2,"categoryName":"TaiwanPlus ✕ Discovery","categoryFullPath":"Originals/TaiwanPlus ✕ Discovery","encodedCategoryFullPath":"originals/taiwanplus-discovery"}]}],"success":true,"code":"0000","message":""}'
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
const results = parser({ content, date })

View File

@@ -0,0 +1 @@
[{"id":"0afc3cc0-eab8-4960-a8b5-55d76edeb8f0","program":"The Bourne Ultimatum","episode":"The Bourne Ultimatum","description":"Jason Bourne dodges a ruthless C.I.A. official and his Agents from a new assassination program while searching for the origins of his life as a trained killer.","genre":"Action","thumbnailImage":"https://s3.ap-southeast-1.amazonaws.com/epg.tapdmv.com/tapactionflix.png","startTime":"2022-10-03T23:05:00.000Z","endTime":"2022-10-04T01:00:00.000Z","fileId":"94b7db9b-5bbd-47d3-a2d3-ce792342a756","createdAt":"2022-09-30T13:02:10.586Z","updatedAt":"2022-09-30T13:02:10.586Z"},{"id":"8dccd5e0-ab88-44b6-a2af-18d31c6e9ed7","program":"The Devil Inside ","episode":"The Devil Inside ","description":"In Italy, a woman becomes involved in a series of unauthorized exorcisms during her mission to discover what happened to her mother, who allegedly murdered three people during her own exorcism.","genre":"Horror","thumbnailImage":"https://s3.ap-southeast-1.amazonaws.com/epg.tapdmv.com/tapactionflix.png","startTime":"2022-10-04T01:00:00.000Z","endTime":"2022-10-04T02:25:00.000Z","fileId":"94b7db9b-5bbd-47d3-a2d3-ce792342a756","createdAt":"2022-09-30T13:02:24.031Z","updatedAt":"2022-09-30T13:02:24.031Z"}]

View File

@@ -0,0 +1 @@
[]

View File

@@ -1,4 +1,6 @@
const { parser, url } = require('./tapdmv.com.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
@@ -18,8 +20,7 @@ it('can generate valid url', () => {
})
it('can parse response', () => {
const content =
'[{"id":"0afc3cc0-eab8-4960-a8b5-55d76edeb8f0","program":"The Bourne Ultimatum","episode":"The Bourne Ultimatum","description":"Jason Bourne dodges a ruthless C.I.A. official and his Agents from a new assassination program while searching for the origins of his life as a trained killer.","genre":"Action","thumbnailImage":"https://s3.ap-southeast-1.amazonaws.com/epg.tapdmv.com/tapactionflix.png","startTime":"2022-10-03T23:05:00.000Z","endTime":"2022-10-04T01:00:00.000Z","fileId":"94b7db9b-5bbd-47d3-a2d3-ce792342a756","createdAt":"2022-09-30T13:02:10.586Z","updatedAt":"2022-09-30T13:02:10.586Z"},{"id":"8dccd5e0-ab88-44b6-a2af-18d31c6e9ed7","program":"The Devil Inside ","episode":"The Devil Inside ","description":"In Italy, a woman becomes involved in a series of unauthorized exorcisms during her mission to discover what happened to her mother, who allegedly murdered three people during her own exorcism.","genre":"Horror","thumbnailImage":"https://s3.ap-southeast-1.amazonaws.com/epg.tapdmv.com/tapactionflix.png","startTime":"2022-10-04T01:00:00.000Z","endTime":"2022-10-04T02:25:00.000Z","fileId":"94b7db9b-5bbd-47d3-a2d3-ce792342a756","createdAt":"2022-09-30T13:02:24.031Z","updatedAt":"2022-09-30T13:02:24.031Z"}]'
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
const result = parser({ content, date }).map(p => {
p.start = p.start.toJSON()
p.stop = p.stop.toJSON()
@@ -41,7 +42,7 @@ it('can parse response', () => {
it('can handle empty guide', () => {
const result = parser({
content: '[]',
content: fs.readFileSync(path.resolve(__dirname, '__data__/no_content.json')),
date
})
expect(result).toMatchObject([])

View File

@@ -0,0 +1,22 @@
{
"data": {
"epg": [
{
"title": "Yeh Rishta Kya Kehlata Hai",
"startTime": "2025-06-09T18:00:00.000Z",
"endTime": "2025-06-09T18:30:00.000Z",
"desc": "The story of the Rajshri family and their journey through life.",
"category": "Drama",
"boxCoverImage": "https://img.tataplay.com/thumbnails/1001/yeh-rishta.jpg"
},
{
"title": "Anupamaa",
"startTime": "2025-06-09T18:30:00.000Z",
"endTime": "2025-06-09T19:00:00.000Z",
"desc": "The story of Anupamaa, a housewife who rediscovers herself.",
"category": "Drama",
"boxCoverImage": "https://img.tataplay.com/thumbnails/1001/anupamaa.jpg"
}
]
}
}

View File

@@ -1,4 +1,6 @@
const { parser, url, channels } = require('./tataplay.com.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
@@ -13,28 +15,7 @@ it('can generate valid url', () => {
})
it('can parse response', () => {
const content = JSON.stringify({
data: {
epg: [
{
title: 'Yeh Rishta Kya Kehlata Hai',
startTime: '2025-06-09T18:00:00.000Z',
endTime: '2025-06-09T18:30:00.000Z',
desc: 'The story of the Rajshri family and their journey through life.',
category: 'Drama',
boxCoverImage: 'https://img.tataplay.com/thumbnails/1001/yeh-rishta.jpg'
},
{
title: 'Anupamaa',
startTime: '2025-06-09T18:30:00.000Z',
endTime: '2025-06-09T19:00:00.000Z',
desc: 'The story of Anupamaa, a housewife who rediscovers herself.',
category: 'Drama',
boxCoverImage: 'https://img.tataplay.com/thumbnails/1001/anupamaa.jpg'
}
]
}
})
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
const results = parser({ content, date })

View File

@@ -0,0 +1 @@
{"categoryItems":{"1":[{"id":136227,"type":"epgSeries","name":"Inimjaht","originalName":"Manhunt","price":null,"owner":"ETV","ownerId":1,"images":{"webGuideItemLarge":"/resized/ri93Qj4OLXXvg7QAsUOcKMnIb3g=/570x330/filters:format(jpeg)/inet-static.mw.elion.ee/epg_images/9/b/17e48b3966e65c02.jpg"},"packetIds":[30,34,38,129,130,162,191,242,243,244,447,483,484,485,486],"related":{"programmeIds":[27224371]}}]},"relations":{"programmes":{"27224371":{"id":27224371,"startAt":"2021-11-20T00:05:00+02:00","endAt":"2021-11-20T00:55:00+02:00","publicTo":"2021-12-04T02:05:00+02:00","status":"default","channelId":1,"broadcastId":78248901,"hasMarkers":false,"catchup":false}}}}

View File

@@ -0,0 +1 @@
{"categoryItems":{},"relations":{}}

View File

@@ -1,4 +1,6 @@
const { parser, url } = require('./teliatv.ee.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
@@ -30,8 +32,7 @@ it('can generate valid url with different language', () => {
})
it('can parse response', () => {
const content =
'{"categoryItems":{"1":[{"id":136227,"type":"epgSeries","name":"Inimjaht","originalName":"Manhunt","price":null,"owner":"ETV","ownerId":1,"images":{"webGuideItemLarge":"/resized/ri93Qj4OLXXvg7QAsUOcKMnIb3g=/570x330/filters:format(jpeg)/inet-static.mw.elion.ee/epg_images/9/b/17e48b3966e65c02.jpg"},"packetIds":[30,34,38,129,130,162,191,242,243,244,447,483,484,485,486],"related":{"programmeIds":[27224371]}}]},"relations":{"programmes":{"27224371":{"id":27224371,"startAt":"2021-11-20T00:05:00+02:00","endAt":"2021-11-20T00:55:00+02:00","publicTo":"2021-12-04T02:05:00+02:00","status":"default","channelId":1,"broadcastId":78248901,"hasMarkers":false,"catchup":false}}}}'
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
const result = parser({ content, channel }).map(p => {
p.start = p.start.toJSON()
p.stop = p.stop.toJSON()
@@ -53,7 +54,7 @@ it('can handle empty guide', () => {
const result = parser({
date,
channel,
content: '{"categoryItems":{},"relations":{}}'
content: fs.readFileSync(path.resolve(__dirname, '__data__/no_content.json'))
})
expect(result).toMatchObject([])
})

View File

@@ -0,0 +1 @@
{"response":"ok","data":{"thumb":"https://mobile-api.tvim.tv/images/chan_logos/70x25/T7.png","thumb_rel":"https://mobile-api.tvim.tv/images/chan_logos/70x25/T7.png","thumb_large_rel":"https://mobile-api.tvim.tv/images/chan_logos/120x60/T7.png","thumb_http":"http://mobile-api.tvim.tv/images/chan_logos/70x25/T7.png","thumb_large":"http://mobile-api.tvim.tv/images/chan_logos/120x60/T7.png","server_time":1635100951,"catchup_length":2,"_id":"T73","ind":2,"genre":"national","name":"T7","epg_id":"T7","chan":"T7","prog":[{"id":"T7-1635026400","title":"Programi i T7","from":1635026400,"end":1635040800,"starting":"00:00","from_utc":1635026400,"end_utc":1635040800,"desc":"Programi i T7","genre":"test","chan":"T7","epg_id":"T7","eng":""}]}}

View File

@@ -0,0 +1 @@
{"response":"ok","data":{"server_time":1635100927}}

View File

@@ -1,4 +1,6 @@
const { parser, url } = require('./tvim.tv.config.js')
const fs = require('fs')
const path = require('path')
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc')
const customParseFormat = require('dayjs/plugin/customParseFormat')
@@ -7,8 +9,7 @@ dayjs.extend(utc)
const date = dayjs.utc('2021-10-24', 'YYYY-MM-DD').startOf('d')
const channel = { site_id: 'T7', xmltv_id: 'T7.rs' }
const content =
'{"response":"ok","data":{"thumb":"https://mobile-api.tvim.tv/images/chan_logos/70x25/T7.png","thumb_rel":"https://mobile-api.tvim.tv/images/chan_logos/70x25/T7.png","thumb_large_rel":"https://mobile-api.tvim.tv/images/chan_logos/120x60/T7.png","thumb_http":"http://mobile-api.tvim.tv/images/chan_logos/70x25/T7.png","thumb_large":"http://mobile-api.tvim.tv/images/chan_logos/120x60/T7.png","server_time":1635100951,"catchup_length":2,"_id":"T73","ind":2,"genre":"national","name":"T7","epg_id":"T7","chan":"T7","prog":[{"id":"T7-1635026400","title":"Programi i T7","from":1635026400,"end":1635040800,"starting":"00:00","from_utc":1635026400,"end_utc":1635040800,"desc":"Programi i T7","genre":"test","chan":"T7","epg_id":"T7","eng":""}]}}'
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
it('can generate valid url', () => {
const result = url({ date, channel })
@@ -34,7 +35,7 @@ it('can handle empty guide', () => {
const result = parser({
date,
channel,
content: '{"response":"ok","data":{"server_time":1635100927}}'
content: fs.readFileSync(path.resolve(__dirname, '__data__/no_content.json'))
})
expect(result).toMatchObject([])
})