From 465d38abb9d025a9c6b1d3f1c3d756a9a69fac37 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 21 Jan 2022 17:00:04 +0300 Subject: [PATCH 01/16] Update create-database.js --- scripts/commands/create-database.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/commands/create-database.js b/scripts/commands/create-database.js index 59dd66bf..5697dcd3 100644 --- a/scripts/commands/create-database.js +++ b/scripts/commands/create-database.js @@ -13,23 +13,21 @@ const options = program .parse(process.argv) .opts() -const channels = [] - async function main() { logger.info('Starting...') logger.info(`Number of clusters: ${options.maxClusters}`) - await loadChannels() - await saveToDatabase() + await saveToDatabase(await getChannels()) logger.info('Done') } main() -async function loadChannels() { +async function getChannels() { logger.info(`Loading channels...`) + const channels = [] const files = await file.list(options.channels) for (const filepath of files) { const dir = file.dirname(filepath) @@ -51,9 +49,11 @@ async function loadChannels() { } } logger.info(`Found ${channels.length} channels`) + + return channels } -async function saveToDatabase() { +async function saveToDatabase(channels = []) { logger.info('Saving to the database...') await db.channels.load() await db.channels.reset() From af69100bc51cb840e8df3e450adb8f71844cb1ed Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 21 Jan 2022 17:30:14 +0300 Subject: [PATCH 02/16] Update create-databasee.js --- scripts/commands/create-database.js | 32 +++++++++++++------ .../sites/example.com_ca-nl.channels.xml | 1 + tests/commands/create-database.test.js | 2 +- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/scripts/commands/create-database.js b/scripts/commands/create-database.js index 5697dcd3..973e4059 100644 --- a/scripts/commands/create-database.js +++ b/scripts/commands/create-database.js @@ -1,6 +1,6 @@ const { db, file, parser, logger } = require('../core') const { program } = require('commander') -const _ = require('lodash') +const { shuffle } = require('lodash') const options = program .option( @@ -27,7 +27,8 @@ main() async function getChannels() { logger.info(`Loading channels...`) - const channels = [] + let channels = {} + const files = await file.list(options.channels) for (const filepath of files) { const dir = file.dirname(filepath) @@ -37,17 +38,28 @@ async function getChannels() { const configPath = `${dir}/${site}.config.js` const config = require(file.resolve(configPath)) if (config.ignore) continue - const [__, gid] = filename.match(/_([a-z-]+)\.channels\.xml/i) || [null, null] + const [__, groupId] = filename.match(/_([a-z-]+)\.channels\.xml/i) || [null, null] const items = await parser.parseChannels(filepath) for (const item of items) { - const countryCode = item.xmltv_id.split('.')[1] - item.country = countryCode ? countryCode.toUpperCase() : null - item.channelsPath = filepath - item.configPath = configPath - item.gid = gid - channels.push(item) + const key = `${item.site}:${item.site_id}` + if (!channels[key]) { + const countryCode = item.xmltv_id.split('.')[1] + item.country = countryCode ? countryCode.toUpperCase() : null + item.channelsPath = filepath + item.configPath = configPath + item.groups = [] + + channels[key] = item + } + + if (!channels[key].groups.includes(groupId)) { + channels[key].groups.push(groupId) + } } } + + channels = Object.values(channels) + logger.info(`Found ${channels.length} channels`) return channels @@ -57,7 +69,7 @@ async function saveToDatabase(channels = []) { logger.info('Saving to the database...') await db.channels.load() await db.channels.reset() - const chunks = split(_.shuffle(channels), options.maxClusters) + const chunks = split(shuffle(channels), options.maxClusters) for (const [i, chunk] of chunks.entries()) { for (const item of chunk) { item.cluster_id = i + 1 diff --git a/tests/__data__/input/sites/example.com_ca-nl.channels.xml b/tests/__data__/input/sites/example.com_ca-nl.channels.xml index d067c030..aa4b1ac9 100644 --- a/tests/__data__/input/sites/example.com_ca-nl.channels.xml +++ b/tests/__data__/input/sites/example.com_ca-nl.channels.xml @@ -2,5 +2,6 @@ CNN International Europe + CNN International Europe 2 \ No newline at end of file diff --git a/tests/commands/create-database.test.js b/tests/commands/create-database.test.js index d84c9146..2e3c3402 100644 --- a/tests/commands/create-database.test.js +++ b/tests/commands/create-database.test.js @@ -25,7 +25,7 @@ it('can create channels database', () => { site: 'example.com', channelsPath: 'tests/__data__/input/sites/example.com_ca-nl.channels.xml', configPath: 'tests/__data__/input/sites/example.com.config.js', - gid: 'ca-nl', + groups: ['ca-nl'], cluster_id: 1 } ]) From 4ec3e3584598a9da4a8c6bb608a60c857b3c7c7b Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 21 Jan 2022 18:00:33 +0300 Subject: [PATCH 03/16] Update load-cluster.js --- scripts/commands/load-cluster.js | 21 +++++++++------------ tests/__data__/input/database/channels.db | 8 ++++---- tests/commands/load-cluster.test.js | 11 ++++------- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/scripts/commands/load-cluster.js b/scripts/commands/load-cluster.js index c55e8441..4b077d68 100644 --- a/scripts/commands/load-cluster.js +++ b/scripts/commands/load-cluster.js @@ -47,18 +47,6 @@ async function main() { }) await grabber.grab(channel, config, async (data, err) => { - await file.append( - clusterLog, - JSON.stringify({ - _id: channel._id, - site: channel.site, - country: channel.country, - logo: data.channel.logo, - gid: channel.gid, - programs: data.programs - }) + '\n' - ) - logger.info( `[${i}/${total}] ${channel.site} - ${channel.xmltv_id} - ${data.date.format( 'MMM D, YYYY' @@ -67,6 +55,15 @@ async function main() { if (err) logger.error(err.message) + const result = { + _id: channel._id, + logo: data.channel.logo, + programs: data.programs, + error: err ? err.message : null + } + + await file.append(clusterLog, JSON.stringify(result) + '\n') + if (i < total) i++ }) } diff --git a/tests/__data__/input/database/channels.db b/tests/__data__/input/database/channels.db index 98d3979a..37493b35 100644 --- a/tests/__data__/input/database/channels.db +++ b/tests/__data__/input/database/channels.db @@ -1,4 +1,4 @@ -{"lang":"en","xmltv_id":"BravoEast.us","site_id":"237","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","name":"Bravo East","site":"directv.com","channelsPath":"sites/directv.com/directv.com_us.channels.xml","configPath":"sites/directv.com/directv.com.config.js","gid":"us","cluster_id":84,"country":"US","_id":"00AluKCrCnfgrl8W"} -{"lang":"fr","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"53","logo":null,"name":"CNN International Europe","site":"chaines-tv.orange.fr","channelsPath":"sites/chaines-tv.orange.fr/chaines-tv.orange.fr_fr.channels.xml","configPath":"tests/__data__/input/sites/example.com.config.js","gid":"fr","cluster_id":1,"_id":"0Wefq0oMR3feCcuY"} -{"lang":"ru","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"140","logo":"https://www.magticom.ge/images/channels/MjAxOC8wOS8xMC9lZmJhNWU5Yy0yMmNiLTRkMTAtOWY5Ny01ODM0MzY0ZTg0MmEuanBn.jpg","name":"CNN Int","site":"magticom.ge","channelsPath":"sites/magticom.ge/magticom.ge_ge.channels.xml","configPath":"tests/__data__/input/sites/example.com.config.js","gid":"ge","cluster_id":1,"_id":"1XzrxNkSF2AQNBrT"} -{"lang":"en","country":"ZA","xmltv_id":"MNetMovies2.za","site_id":"404a052b-3dea-4cac-a19c-de9a7d6f191d#MAP","logo":"https://rndcdn.dstv.com/dstvcms/2020/08/31/M-Net_Movies_2_Logo_4-3_lightbackground_xlrg.png","name":"M-Net Movies 2","site":"dstv.com","channelsPath":"sites/dstv.com/dstv.com_zw.channels.xml","configPath":"sites/dstv.com/dstv.com.config.js","gid":"zw","cluster_id":120,"_id":"1lnhXpN7g0ER5XwN"} +{"lang":"en","xmltv_id":"BravoEast.us","site_id":"237","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","name":"Bravo East","site":"directv.com","channelsPath":"sites/directv.com/directv.com_us.channels.xml","configPath":"sites/directv.com/directv.com.config.js","groups":["us"],"cluster_id":84,"country":"US","_id":"00AluKCrCnfgrl8W"} +{"lang":"fr","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"53","logo":null,"name":"CNN International Europe","site":"chaines-tv.orange.fr","channelsPath":"sites/chaines-tv.orange.fr/chaines-tv.orange.fr_fr.channels.xml","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["fr"],"cluster_id":1,"_id":"0Wefq0oMR3feCcuY"} +{"lang":"ru","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"140","logo":"https://www.magticom.ge/images/channels/MjAxOC8wOS8xMC9lZmJhNWU5Yy0yMmNiLTRkMTAtOWY5Ny01ODM0MzY0ZTg0MmEuanBn.jpg","name":"CNN Int","site":"magticom.ge","channelsPath":"sites/magticom.ge/magticom.ge_ge.channels.xml","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ge"],"cluster_id":1,"_id":"1XzrxNkSF2AQNBrT"} +{"lang":"en","country":"ZA","xmltv_id":"MNetMovies2.za","site_id":"404a052b-3dea-4cac-a19c-de9a7d6f191d#MAP","logo":"https://rndcdn.dstv.com/dstvcms/2020/08/31/M-Net_Movies_2_Logo_4-3_lightbackground_xlrg.png","name":"M-Net Movies 2","site":"dstv.com","channelsPath":"sites/dstv.com/dstv.com_zw.channels.xml","configPath":"sites/dstv.com/dstv.com.config.js","groups":["zw"],"cluster_id":120,"_id":"1lnhXpN7g0ER5XwN"} diff --git a/tests/commands/load-cluster.test.js b/tests/commands/load-cluster.test.js index e603ed0c..c2c768b1 100644 --- a/tests/commands/load-cluster.test.js +++ b/tests/commands/load-cluster.test.js @@ -23,18 +23,15 @@ it('can load cluster', () => { expect(output[0]).toMatchObject({ _id: '0Wefq0oMR3feCcuY', - site: 'chaines-tv.orange.fr', logo: 'https://example.com/logo.png', - country: 'US', - gid: 'fr' + error: null }) + expect(Object.keys(output[0]).sort()).toEqual(['_id', 'error', 'logo', 'programs']) + expect(output[1]).toMatchObject({ _id: '1XzrxNkSF2AQNBrT', - site: 'magticom.ge', - logo: 'https://www.magticom.ge/images/channels/MjAxOC8wOS8xMC9lZmJhNWU5Yy0yMmNiLTRkMTAtOWY5Ny01ODM0MzY0ZTg0MmEuanBn.jpg', - country: 'US', - gid: 'ge' + logo: 'https://www.magticom.ge/images/channels/MjAxOC8wOS8xMC9lZmJhNWU5Yy0yMmNiLTRkMTAtOWY5Ny01ODM0MzY0ZTg0MmEuanBn.jpg' }) }) From 642b09051f3c261f8b105ac3a4b04d0c8b60d6df Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 21 Jan 2022 19:25:50 +0300 Subject: [PATCH 04/16] Update load-cluster.js --- scripts/commands/load-cluster.js | 4 ++-- tests/commands/load-cluster.test.js | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/scripts/commands/load-cluster.js b/scripts/commands/load-cluster.js index 4b077d68..b859afa5 100644 --- a/scripts/commands/load-cluster.js +++ b/scripts/commands/load-cluster.js @@ -56,9 +56,9 @@ async function main() { if (err) logger.error(err.message) const result = { - _id: channel._id, - logo: data.channel.logo, + channel: data.channel, programs: data.programs, + date: data.date.format(), error: err ? err.message : null } diff --git a/tests/commands/load-cluster.test.js b/tests/commands/load-cluster.test.js index c2c768b1..fd0576b7 100644 --- a/tests/commands/load-cluster.test.js +++ b/tests/commands/load-cluster.test.js @@ -1,7 +1,11 @@ const fs = require('fs') const path = require('path') +const dayjs = require('dayjs') +const utc = require('dayjs/plugin/utc') const { execSync } = require('child_process') +dayjs.extend(utc) + beforeEach(() => { fs.rmdirSync('tests/__data__/temp', { recursive: true }) fs.rmdirSync('tests/__data__/output', { recursive: true }) @@ -21,17 +25,22 @@ beforeEach(() => { it('can load cluster', () => { const output = content('tests/__data__/output/logs/load-cluster/cluster_1.log') + expect(Object.keys(output[0]).sort()).toEqual(['channel', 'date', 'error', 'programs']) + expect(output[0]).toMatchObject({ - _id: '0Wefq0oMR3feCcuY', - logo: 'https://example.com/logo.png', + channel: { + _id: '0Wefq0oMR3feCcuY', + logo: 'https://example.com/logo.png' + }, + date: dayjs.utc().startOf('d').format(), error: null }) - expect(Object.keys(output[0]).sort()).toEqual(['_id', 'error', 'logo', 'programs']) - expect(output[1]).toMatchObject({ - _id: '1XzrxNkSF2AQNBrT', - logo: 'https://www.magticom.ge/images/channels/MjAxOC8wOS8xMC9lZmJhNWU5Yy0yMmNiLTRkMTAtOWY5Ny01ODM0MzY0ZTg0MmEuanBn.jpg' + channel: { + _id: '1XzrxNkSF2AQNBrT', + logo: 'https://www.magticom.ge/images/channels/MjAxOC8wOS8xMC9lZmJhNWU5Yy0yMmNiLTRkMTAtOWY5Ny01ODM0MzY0ZTg0MmEuanBn.jpg' + } }) }) From 15e54da0e2d10453a85bcd70953cf080d7cbe065 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 21 Jan 2022 19:42:27 +0300 Subject: [PATCH 05/16] Update save-results.js --- scripts/commands/save-results.js | 24 ++++++++++----- tests/__data__/input/logs/errors.log | 1 + .../input/logs/load-cluster/cluster_1.log | 3 +- tests/commands/save-results.test.js | 30 +++++++++++++------ 4 files changed, 41 insertions(+), 17 deletions(-) create mode 100644 tests/__data__/input/logs/errors.log diff --git a/scripts/commands/save-results.js b/scripts/commands/save-results.js index b5e03450..667692db 100644 --- a/scripts/commands/save-results.js +++ b/scripts/commands/save-results.js @@ -4,8 +4,9 @@ const _ = require('lodash') const LOGS_DIR = process.env.LOGS_DIR || 'scripts/logs' async function main() { + const errorsLog = `${LOGS_DIR}/errors.log` + await file.create(errorsLog) await db.channels.load() - await db.programs.load() await db.programs.reset() const files = await file.list(`${LOGS_DIR}/load-cluster/cluster_*.log`) @@ -13,8 +14,6 @@ async function main() { logger.info(`Parsing "${filepath}"...`) const results = await parser.parseLogs(filepath) for (const result of results) { - await db.channels.update({ _id: result._id }, { $set: { logo: result.logo } }) - const programs = result.programs.map(program => { return { title: program.title, @@ -27,13 +26,24 @@ async function main() { lang: program.lang, start: program.start, stop: program.stop, - site: result.site, - country: result.country, - gid: result.gid + _cid: result.channel._id } }) - await db.programs.insert(programs) + + if (result.channel.logo) { + await db.channels.update( + { _id: result.channel._id }, + { $set: { logo: result.channel.logo } } + ) + } + + if (result.error) { + await file.append( + errorsLog, + JSON.stringify({ ...result.channel, date: result.date, error: result.error }) + '\n' + ) + } } } diff --git a/tests/__data__/input/logs/errors.log b/tests/__data__/input/logs/errors.log new file mode 100644 index 00000000..d16cba84 --- /dev/null +++ b/tests/__data__/input/logs/errors.log @@ -0,0 +1 @@ +{"lang":"en","xmltv_id":"BravoEast.us","site_id":"237","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","name":"Bravo East","site":"directv.com","channelsPath":"sites/directv.com/directv.com_us.channels.xml","configPath":"sites/directv.com/directv.com.config.js","groups":["us"],"cluster_id":84,"country":"US","_id":"00AluKCrCnfgrl8W","date":"2022-01-21T00:00:00Z","error":"Invalid header value char"} diff --git a/tests/__data__/input/logs/load-cluster/cluster_1.log b/tests/__data__/input/logs/load-cluster/cluster_1.log index c182f4a2..bad7dbaf 100644 --- a/tests/__data__/input/logs/load-cluster/cluster_1.log +++ b/tests/__data__/input/logs/load-cluster/cluster_1.log @@ -1 +1,2 @@ -{"_id":"0Wefq0oMR3feCcuY","site":"andorradifusio.ad","gid":"ad","country":"AD","logo":"https://example.com/logo.png","programs":[{"title":"InfoNeu ","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","start":1641711600,"stop":1641715200},{"title":"Club Piolet","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641715200,"stop":1641718800},{"title":"InfoNeu ","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","start":1641718800,"stop":1641729600},{"title":"Andorra Actualitat (RNA)","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641729600,"stop":1641730800},{"title":"El Trànsit","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641730800,"stop":1641732000},{"title":"El Trànsit","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641732000,"stop":1641732300},{"title":"Informatiu migdia","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641732300,"stop":1641733800},{"title":"El Trànsit","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641733800,"stop":1641736200},{"title":"La Terre vue du Sport","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641736200,"stop":1641736800},{"title":"Informatiu migdia","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641736800,"stop":1641738300},{"title":"Club Piolet","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641738300,"stop":1641741900},{"title":"Informatiu migdia","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641741900,"stop":1641743400},{"title":"El Trànsit","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641743400,"stop":1641750900},{"title":"La rotonda","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641750900,"stop":1641753600},{"title":"Club Piolet","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641753600,"stop":1641757200},{"title":"El Trànsit","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641757200,"stop":1641757500},{"title":"Informatiu vespre","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641757500,"stop":1641759000},{"title":"Recull setmanal","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641759000,"stop":1641761100},{"title":"Memòries d'arxiu: 10 anys d'ATV","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641761100,"stop":1641763800},{"title":"El cafè dels matins","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641763800,"stop":1641766800},{"title":"La Terre vue du Sport","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641766800,"stop":1641767400},{"title":"Informatiu vespre","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641767400,"stop":1641772800},{"title":"Àrea Andorra Difusió","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641772800,"stop":1641776400}]} +{"channel":{"lang":"fr","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"53","logo":"https://example.com/logo.png","name":"CNN International Europe","site":"chaines-tv.orange.fr","channelsPath":"sites/chaines-tv.orange.fr/chaines-tv.orange.fr_fr.channels.xml","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["fr"],"cluster_id":1,"_id":"0Wefq0oMR3feCcuY"},"programs":[{"title":"InfoNeu ","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","start":1641711600,"stop":1641715200},{"title":"Club Piolet","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641715200,"stop":1641718800},{"title":"InfoNeu ","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","start":1641718800,"stop":1641729600},{"title":"Andorra Actualitat (RNA)","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641729600,"stop":1641730800},{"title":"El Trànsit","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641730800,"stop":1641732000},{"title":"El Trànsit","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641732000,"stop":1641732300},{"title":"Informatiu migdia","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641732300,"stop":1641733800},{"title":"El Trànsit","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641733800,"stop":1641736200},{"title":"La Terre vue du Sport","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641736200,"stop":1641736800},{"title":"Informatiu migdia","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641736800,"stop":1641738300},{"title":"Club Piolet","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641738300,"stop":1641741900},{"title":"Informatiu migdia","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641741900,"stop":1641743400},{"title":"El Trànsit","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641743400,"stop":1641750900},{"title":"La rotonda","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641750900,"stop":1641753600},{"title":"Club Piolet","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641753600,"stop":1641757200},{"title":"El Trànsit","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641757200,"stop":1641757500},{"title":"Informatiu vespre","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641757500,"stop":1641759000},{"title":"Recull setmanal","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641759000,"stop":1641761100},{"title":"Memòries d'arxiu: 10 anys d'ATV","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641761100,"stop":1641763800},{"title":"El cafè dels matins","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641763800,"stop":1641766800},{"title":"La Terre vue du Sport","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641766800,"stop":1641767400},{"title":"Informatiu vespre","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641767400,"stop":1641772800},{"title":"Àrea Andorra Difusió","description":null,"category":null,"icon":null,"channel":"AndorraTV.ad","lang":"ca","season":null,"episode":null,"start":1641772800,"stop":1641776400}],"date":"2022-01-21T00:00:00Z","error":null} +{"channel":{"lang":"en","xmltv_id":"BravoEast.us","site_id":"237","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","name":"Bravo East","site":"directv.com","channelsPath":"sites/directv.com/directv.com_us.channels.xml","configPath":"sites/directv.com/directv.com.config.js","groups":["us"],"cluster_id":84,"country":"US","_id":"00AluKCrCnfgrl8W"},"programs":[],"date":"2022-01-21T00:00:00Z","error":"Invalid header value char"} diff --git a/tests/commands/save-results.test.js b/tests/commands/save-results.test.js index 41407dd7..ba664823 100644 --- a/tests/commands/save-results.test.js +++ b/tests/commands/save-results.test.js @@ -12,38 +12,50 @@ beforeEach(() => { 'tests/__data__/output/database/channels.db' ) - execSync( + const stdout = execSync( 'DB_DIR=tests/__data__/output/database LOGS_DIR=tests/__data__/input/logs node scripts/commands/save-results.js', { encoding: 'utf8' } ) + console.log(stdout) }) -it('can save results to database', () => { - const output = content('tests/__data__/output/database/programs.db') +it('can save results', () => { + const programs = content('tests/__data__/output/database/programs.db') - expect(Object.keys(output[0]).sort()).toEqual([ + expect(Object.keys(programs[0]).sort()).toEqual([ + '_cid', '_id', 'category', 'channel', - 'country', 'description', 'episode', - 'gid', 'icon', 'lang', 'season', - 'site', 'start', 'stop', 'title' ]) - const database = content('tests/__data__/output/database/channels.db') + expect(programs[0]).toMatchObject({ + _cid: '0Wefq0oMR3feCcuY' + }) - expect(database[1]).toMatchObject({ + const channels = content('tests/__data__/output/database/channels.db') + + expect(channels[1]).toMatchObject({ _id: '0Wefq0oMR3feCcuY', logo: 'https://example.com/logo.png' }) + + const errors = content('tests/__data__/input/logs/errors.log') + + expect(errors[0]).toMatchObject({ + _id: '00AluKCrCnfgrl8W', + site: 'directv.com', + xmltv_id: 'BravoEast.us', + error: 'Invalid header value char' + }) }) function content(filepath) { From 0d2458685baed0e769498aafae38a1b47e16ba42 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 21 Jan 2022 19:46:50 +0300 Subject: [PATCH 06/16] Update create-database.js --- scripts/commands/create-database.js | 3 ++- tests/commands/create-database.test.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/commands/create-database.js b/scripts/commands/create-database.js index 973e4059..a08ae368 100644 --- a/scripts/commands/create-database.js +++ b/scripts/commands/create-database.js @@ -38,7 +38,8 @@ async function getChannels() { const configPath = `${dir}/${site}.config.js` const config = require(file.resolve(configPath)) if (config.ignore) continue - const [__, groupId] = filename.match(/_([a-z-]+)\.channels\.xml/i) || [null, null] + const [__, region] = filename.match(/_([a-z-]+)\.channels\.xml/i) || [null, null] + const groupId = `${region}/${site}` const items = await parser.parseChannels(filepath) for (const item of items) { const key = `${item.site}:${item.site_id}` diff --git a/tests/commands/create-database.test.js b/tests/commands/create-database.test.js index 2e3c3402..3b39e67a 100644 --- a/tests/commands/create-database.test.js +++ b/tests/commands/create-database.test.js @@ -25,7 +25,7 @@ it('can create channels database', () => { site: 'example.com', channelsPath: 'tests/__data__/input/sites/example.com_ca-nl.channels.xml', configPath: 'tests/__data__/input/sites/example.com.config.js', - groups: ['ca-nl'], + groups: ['ca-nl/example.com'], cluster_id: 1 } ]) From b28535247c9c199eb6498603fdf112a32f8755b7 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 21 Jan 2022 19:49:09 +0300 Subject: [PATCH 07/16] Rename to create-queue.js --- .github/workflows/auto-update.yml | 2 +- scripts/commands/{create-database.js => create-queue.js} | 0 .../commands/{create-database.test.js => create-queue.test.js} | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename scripts/commands/{create-database.js => create-queue.js} (100%) rename tests/commands/{create-database.test.js => create-queue.test.js} (92%) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 7750be6d..79bcbf6d 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -14,7 +14,7 @@ jobs: node-version: '14' cache: 'npm' - run: npm install - - run: node scripts/commands/create-database.js + - run: node scripts/commands/create-queue.js - run: node scripts/commands/create-matrix.js id: create-matrix - uses: actions/upload-artifact@v2 diff --git a/scripts/commands/create-database.js b/scripts/commands/create-queue.js similarity index 100% rename from scripts/commands/create-database.js rename to scripts/commands/create-queue.js diff --git a/tests/commands/create-database.test.js b/tests/commands/create-queue.test.js similarity index 92% rename from tests/commands/create-database.test.js rename to tests/commands/create-queue.test.js index 3b39e67a..71241687 100644 --- a/tests/commands/create-database.test.js +++ b/tests/commands/create-queue.test.js @@ -7,7 +7,7 @@ beforeEach(() => { fs.mkdirSync('tests/__data__/output') const stdout = execSync( - 'DB_DIR=tests/__data__/output/database node scripts/commands/create-database.js --channels=tests/__data__/input/sites/*.channels.xml --max-clusters=1', + 'DB_DIR=tests/__data__/output/database node scripts/commands/create-queue.js --channels=tests/__data__/input/sites/*.channels.xml --max-clusters=1', { encoding: 'utf8' } ) }) From b2824fcb04b3580023496e87a80723f4865bcdaa Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 21 Jan 2022 19:50:05 +0300 Subject: [PATCH 08/16] Update save-results.test.js --- tests/commands/save-results.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/commands/save-results.test.js b/tests/commands/save-results.test.js index ba664823..acb6c68d 100644 --- a/tests/commands/save-results.test.js +++ b/tests/commands/save-results.test.js @@ -16,7 +16,6 @@ beforeEach(() => { 'DB_DIR=tests/__data__/output/database LOGS_DIR=tests/__data__/input/logs node scripts/commands/save-results.js', { encoding: 'utf8' } ) - console.log(stdout) }) it('can save results', () => { From 158197fb226f39c10fa7a21eb443128b4c6a1f9f Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 21 Jan 2022 20:06:29 +0300 Subject: [PATCH 09/16] Update save-results.js --- scripts/commands/save-results.js | 2 +- tests/commands/save-results.test.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/commands/save-results.js b/scripts/commands/save-results.js index 667692db..49596f88 100644 --- a/scripts/commands/save-results.js +++ b/scripts/commands/save-results.js @@ -34,7 +34,7 @@ async function main() { if (result.channel.logo) { await db.channels.update( { _id: result.channel._id }, - { $set: { logo: result.channel.logo } } + { $set: { logo: result.channel.logo, programCount: result.programs.length } } ) } diff --git a/tests/commands/save-results.test.js b/tests/commands/save-results.test.js index acb6c68d..38cbb363 100644 --- a/tests/commands/save-results.test.js +++ b/tests/commands/save-results.test.js @@ -42,6 +42,22 @@ it('can save results', () => { const channels = content('tests/__data__/output/database/channels.db') + expect(Object.keys(channels[0]).sort()).toEqual([ + '_id', + 'channelsPath', + 'cluster_id', + 'configPath', + 'country', + 'groups', + 'lang', + 'logo', + 'name', + 'programCount', + 'site', + 'site_id', + 'xmltv_id' + ]) + expect(channels[1]).toMatchObject({ _id: '0Wefq0oMR3feCcuY', logo: 'https://example.com/logo.png' From 122b666e11c952ce604bfa54d7e14a5fc0a57ded Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 21 Jan 2022 20:10:45 +0300 Subject: [PATCH 10/16] Update update-api.js --- scripts/commands/update-api.js | 93 +++++++++++------------ tests/__data__/input/database/channels.db | 8 +- 2 files changed, 49 insertions(+), 52 deletions(-) diff --git a/scripts/commands/update-api.js b/scripts/commands/update-api.js index 04183d8f..347c2500 100644 --- a/scripts/commands/update-api.js +++ b/scripts/commands/update-api.js @@ -5,31 +5,45 @@ const DB_DIR = process.env.DB_DIR || 'scripts/database' const API_DIR = process.env.API_DIR || '.gh-pages/api' async function main() { - await generateChannelsJson() - await generateProgramsJson() - logger.info(`Done`) + await saveToChannelsJson(await loadChannels()) + await saveToProgramsJson(await loadPrograms()) } main() -async function generateChannelsJson() { - logger.info('Generating channels.json...') +async function loadChannels() { + logger.info('Loading channels from database...') - const channels = await loadChannels() + await db.channels.load() - const channelsPath = `${API_DIR}/channels.json` - logger.info(`Saving to "${channelsPath}"...`) - await file.create(channelsPath, JSON.stringify(channels)) -} + const channels = await db.channels.find({}).sort({ xmltv_id: 1 }) -async function generateProgramsJson() { - logger.info('Generating programs.json...') + const output = {} + for (const channel of channels) { + if (!output[channel.xmltv_id]) { + output[channel.xmltv_id] = { + id: channel.xmltv_id, + name: [], + logo: channel.logo || null, + country: channel.country, + guides: [] + } + } else { + output[channel.xmltv_id].logo = output[channel.xmltv_id].logo || channel.logo + } - const programs = await loadPrograms() + output[channel.xmltv_id].name.push(channel.name) + output[channel.xmltv_id].name = _.uniq(output[channel.xmltv_id].name) + channel.groups.forEach(group => { + if (channel.programCount) { + output[channel.xmltv_id].guides.push( + `https://iptv-org.github.io/epg/guides/${group}.epg.xml` + ) + } + }) + } - const programsPath = `${API_DIR}/programs.json` - logger.info(`Saving to "${programsPath}"...`) - await file.create(programsPath, JSON.stringify(programs)) + return Object.values(output) } async function loadPrograms() { @@ -37,9 +51,9 @@ async function loadPrograms() { await db.programs.load() - let items = await db.programs.find({}) + let programs = await db.programs.find({}) - items = items.map(item => { + programs = programs.map(item => { const categories = Array.isArray(item.category) ? item.category : [item.category] return { @@ -58,36 +72,19 @@ async function loadPrograms() { }) logger.info('Sort programs...') - return _.sortBy(items, ['channel', 'site', 'start']) + programs = _.sortBy(programs, ['channel', 'site', 'start']) + + return programs } -async function loadChannels() { - logger.info('Loading channels from database...') - - await db.channels.load() - - const items = await db.channels.find({}).sort({ xmltv_id: 1 }) - - const output = {} - for (const item of items) { - if (!output[item.xmltv_id]) { - output[item.xmltv_id] = { - id: item.xmltv_id, - name: [], - logo: item.logo || null, - country: item.country, - guides: [] - } - } else { - output[item.xmltv_id].logo = output[item.xmltv_id].logo || item.logo - } - - output[item.xmltv_id].name.push(item.name) - output[item.xmltv_id].name = _.uniq(output[item.xmltv_id].name) - output[item.xmltv_id].guides.push( - `https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml` - ) - } - - return Object.values(output) +async function saveToChannelsJson(channels = []) { + const channelsPath = `${API_DIR}/channels.json` + logger.info(`Saving to "${channelsPath}"...`) + await file.create(channelsPath, JSON.stringify(channels)) +} + +async function saveToProgramsJson(programs = []) { + const programsPath = `${API_DIR}/programs.json` + logger.info(`Saving to "${programsPath}"...`) + await file.create(programsPath, JSON.stringify(programs)) } diff --git a/tests/__data__/input/database/channels.db b/tests/__data__/input/database/channels.db index 37493b35..dd53cc9e 100644 --- a/tests/__data__/input/database/channels.db +++ b/tests/__data__/input/database/channels.db @@ -1,4 +1,4 @@ -{"lang":"en","xmltv_id":"BravoEast.us","site_id":"237","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","name":"Bravo East","site":"directv.com","channelsPath":"sites/directv.com/directv.com_us.channels.xml","configPath":"sites/directv.com/directv.com.config.js","groups":["us"],"cluster_id":84,"country":"US","_id":"00AluKCrCnfgrl8W"} -{"lang":"fr","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"53","logo":null,"name":"CNN International Europe","site":"chaines-tv.orange.fr","channelsPath":"sites/chaines-tv.orange.fr/chaines-tv.orange.fr_fr.channels.xml","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["fr"],"cluster_id":1,"_id":"0Wefq0oMR3feCcuY"} -{"lang":"ru","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"140","logo":"https://www.magticom.ge/images/channels/MjAxOC8wOS8xMC9lZmJhNWU5Yy0yMmNiLTRkMTAtOWY5Ny01ODM0MzY0ZTg0MmEuanBn.jpg","name":"CNN Int","site":"magticom.ge","channelsPath":"sites/magticom.ge/magticom.ge_ge.channels.xml","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ge"],"cluster_id":1,"_id":"1XzrxNkSF2AQNBrT"} -{"lang":"en","country":"ZA","xmltv_id":"MNetMovies2.za","site_id":"404a052b-3dea-4cac-a19c-de9a7d6f191d#MAP","logo":"https://rndcdn.dstv.com/dstvcms/2020/08/31/M-Net_Movies_2_Logo_4-3_lightbackground_xlrg.png","name":"M-Net Movies 2","site":"dstv.com","channelsPath":"sites/dstv.com/dstv.com_zw.channels.xml","configPath":"sites/dstv.com/dstv.com.config.js","groups":["zw"],"cluster_id":120,"_id":"1lnhXpN7g0ER5XwN"} +{"lang":"en","xmltv_id":"BravoEast.us","site_id":"237","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","name":"Bravo East","site":"directv.com","channelsPath":"sites/directv.com/directv.com_us.channels.xml","configPath":"sites/directv.com/directv.com.config.js","groups":["us/directv.com"],"cluster_id":84,"country":"US","programCount":1,"_id":"00AluKCrCnfgrl8W"} +{"lang":"fr","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"53","logo":null,"name":"CNN International Europe","site":"chaines-tv.orange.fr","channelsPath":"sites/chaines-tv.orange.fr/chaines-tv.orange.fr_fr.channels.xml","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["fr/chaines-tv.orange.fr"],"cluster_id":1,"programCount":1,"_id":"0Wefq0oMR3feCcuY"} +{"lang":"ru","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"140","logo":"https://www.magticom.ge/images/channels/MjAxOC8wOS8xMC9lZmJhNWU5Yy0yMmNiLTRkMTAtOWY5Ny01ODM0MzY0ZTg0MmEuanBn.jpg","name":"CNN Int","site":"magticom.ge","channelsPath":"sites/magticom.ge/magticom.ge_ge.channels.xml","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ge/magticom.ge"],"cluster_id":1,"programCount":1,"_id":"1XzrxNkSF2AQNBrT"} +{"lang":"en","country":"ZA","xmltv_id":"MNetMovies2.za","site_id":"404a052b-3dea-4cac-a19c-de9a7d6f191d#MAP","logo":"https://rndcdn.dstv.com/dstvcms/2020/08/31/M-Net_Movies_2_Logo_4-3_lightbackground_xlrg.png","name":"M-Net Movies 2","site":"dstv.com","channelsPath":"sites/dstv.com/dstv.com_zw.channels.xml","configPath":"sites/dstv.com/dstv.com.config.js","groups":["zw/dstv.com"],"cluster_id":120,"programCount":1,"_id":"1lnhXpN7g0ER5XwN"} From 074f4c93574624a016513baf19e215d1040354fd Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 21 Jan 2022 22:40:25 +0300 Subject: [PATCH 11/16] Update update-guides.js --- scripts/commands/update-guides.js | 78 ++++++---------- .../chaines-tv.orange.fr.epg.xml} | 2 +- .../guides/{za => zw}/dstv.com.epg.xml | 0 .../__data__/expected/logs/update-guides.log | 4 +- tests/__data__/input/database/channels.db | 8 +- tests/__data__/input/database/programs.db | 92 +++++++++---------- tests/commands/update-guides.test.js | 10 +- 7 files changed, 88 insertions(+), 106 deletions(-) rename tests/__data__/expected/guides/{us/magticom.ge.epg.xml => fr/chaines-tv.orange.fr.epg.xml} (97%) rename tests/__data__/expected/guides/{za => zw}/dstv.com.epg.xml (100%) diff --git a/scripts/commands/update-guides.js b/scripts/commands/update-guides.js index ac530434..b2470d7c 100644 --- a/scripts/commands/update-guides.js +++ b/scripts/commands/update-guides.js @@ -17,75 +17,57 @@ main() async function generateGuides() { logger.info(`Generating guides/...`) - const channels = await loadChannels() - const programs = await loadPrograms() + const grouped = groupByGroup(await loadChannels()) - const grouped = _.groupBy(programs, i => `${i.gid}_${i.site}`) - for (let key in grouped) { - const [gid, site] = key.split('_') || [null, null] - const filepath = `${PUBLIC_DIR}/guides/${gid}/${site}.epg.xml` - const groupProgs = grouped[key] - const groupChannels = Object.keys(_.groupBy(groupProgs, i => `${i.site}_${i.channel}`)).map( - key => { - let [site, channel] = key.split('_') + logger.info('Loading "database/programs.db"...') + await db.programs.load() - return channels.find(i => i.xmltv_id === channel && i.site === site) - } - ) - - const output = grabber.convertToXMLTV({ channels: groupChannels, programs: groupProgs }) + for (const key in grouped) { + const filepath = `${PUBLIC_DIR}/guides/${key}.epg.xml` + const channels = grouped[key] + const programs = await loadProgramsForChannels(channels) + const output = grabber.convertToXMLTV({ channels, programs }) logger.info(`Creating "${filepath}"...`) await file.create(filepath, output) await log({ - gid, - site, - count: groupChannels.length, - status: 1 + group: key, + count: programs.length }) } logger.info(`Done`) } +function groupByGroup(channels = []) { + const groups = {} + + channels.forEach(channel => { + channel.groups.forEach(key => { + if (!groups[key]) { + groups[key] = [] + } + + groups[key].push(channel) + }) + }) + + return groups +} + async function loadChannels() { logger.info('Loading channels...') await db.channels.load() - return await db.channels.find({}).sort({ xmltv_id: 1 }) + return await db.channels.find({ programCount: { $gt: 0 } }).sort({ xmltv_id: 1 }) } -async function loadPrograms() { - logger.info('Loading programs...') +async function loadProgramsForChannels(channels = []) { + const cids = channels.map(c => c._id) - logger.info('Loading "database/programs.db"...') - await db.programs.load() - - logger.info('Loading programs from "database/programs.db"...') - let programs = await db.programs.find({}).sort({ channel: 1, start: 1 }) - - programs = programs.map(program => { - return { - title: program.title, - description: program.description, - category: program.category, - icon: program.icon, - channel: program.channel, - lang: program.lang, - start: program.start, - stop: program.stop, - site: program.site, - country: program.country, - season: program.season, - episode: program.episode, - gid: program.gid, - _id: program._id - } - }) - - return programs + return await db.programs.find({ _cid: { $in: cids } }).sort({ channel: 1, start: 1 }) } async function setUp() { diff --git a/tests/__data__/expected/guides/us/magticom.ge.epg.xml b/tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.xml similarity index 97% rename from tests/__data__/expected/guides/us/magticom.ge.epg.xml rename to tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.xml index cc4f9435..9b28bc7d 100644 --- a/tests/__data__/expected/guides/us/magticom.ge.epg.xml +++ b/tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.xml @@ -1,5 +1,5 @@ -CNN Inthttps://magticom.ge +CNN International Europehttps://chaines-tv.orange.fr CNN Newsroom SundayСвежая мировая информационная сводка от CNN. О политике, экономике, общественной жизни, культуре, спорте.Category1Category2 Fareed Zakaria GPSИнтервью с главными игроками мировой политики.Category1 African Voices Changemakers. 114-я серия114-я серия. Африка сегодня - люди, новости, события. diff --git a/tests/__data__/expected/guides/za/dstv.com.epg.xml b/tests/__data__/expected/guides/zw/dstv.com.epg.xml similarity index 100% rename from tests/__data__/expected/guides/za/dstv.com.epg.xml rename to tests/__data__/expected/guides/zw/dstv.com.epg.xml diff --git a/tests/__data__/expected/logs/update-guides.log b/tests/__data__/expected/logs/update-guides.log index 62c845cc..1cb2c8ad 100644 --- a/tests/__data__/expected/logs/update-guides.log +++ b/tests/__data__/expected/logs/update-guides.log @@ -1,2 +1,2 @@ -{"gid":"us","site":"magticom.ge","count":1,"status":1} -{"gid":"za","site":"dstv.com","count":1,"status":1} +{"group":"fr/chaines-tv.orange.fr","count":32} +{"group":"zw/dstv.com","count":14} diff --git a/tests/__data__/input/database/channels.db b/tests/__data__/input/database/channels.db index dd53cc9e..df828e7f 100644 --- a/tests/__data__/input/database/channels.db +++ b/tests/__data__/input/database/channels.db @@ -1,4 +1,4 @@ -{"lang":"en","xmltv_id":"BravoEast.us","site_id":"237","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","name":"Bravo East","site":"directv.com","channelsPath":"sites/directv.com/directv.com_us.channels.xml","configPath":"sites/directv.com/directv.com.config.js","groups":["us/directv.com"],"cluster_id":84,"country":"US","programCount":1,"_id":"00AluKCrCnfgrl8W"} -{"lang":"fr","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"53","logo":null,"name":"CNN International Europe","site":"chaines-tv.orange.fr","channelsPath":"sites/chaines-tv.orange.fr/chaines-tv.orange.fr_fr.channels.xml","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["fr/chaines-tv.orange.fr"],"cluster_id":1,"programCount":1,"_id":"0Wefq0oMR3feCcuY"} -{"lang":"ru","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"140","logo":"https://www.magticom.ge/images/channels/MjAxOC8wOS8xMC9lZmJhNWU5Yy0yMmNiLTRkMTAtOWY5Ny01ODM0MzY0ZTg0MmEuanBn.jpg","name":"CNN Int","site":"magticom.ge","channelsPath":"sites/magticom.ge/magticom.ge_ge.channels.xml","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ge/magticom.ge"],"cluster_id":1,"programCount":1,"_id":"1XzrxNkSF2AQNBrT"} -{"lang":"en","country":"ZA","xmltv_id":"MNetMovies2.za","site_id":"404a052b-3dea-4cac-a19c-de9a7d6f191d#MAP","logo":"https://rndcdn.dstv.com/dstvcms/2020/08/31/M-Net_Movies_2_Logo_4-3_lightbackground_xlrg.png","name":"M-Net Movies 2","site":"dstv.com","channelsPath":"sites/dstv.com/dstv.com_zw.channels.xml","configPath":"sites/dstv.com/dstv.com.config.js","groups":["zw/dstv.com"],"cluster_id":120,"programCount":1,"_id":"1lnhXpN7g0ER5XwN"} +{"lang":"en","xmltv_id":"BravoEast.us","site_id":"237","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","name":"Bravo East","site":"directv.com","channelsPath":"sites/directv.com/directv.com_us.channels.xml","configPath":"sites/directv.com/directv.com.config.js","groups":["us/directv.com"],"cluster_id":84,"country":"US","programCount":0,"_id":"00AluKCrCnfgrl8W"} +{"lang":"fr","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"53","logo":null,"name":"CNN International Europe","site":"chaines-tv.orange.fr","channelsPath":"sites/chaines-tv.orange.fr/chaines-tv.orange.fr_fr.channels.xml","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["fr/chaines-tv.orange.fr"],"cluster_id":1,"programCount":32,"_id":"0Wefq0oMR3feCcuY"} +{"lang":"ru","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"140","logo":"https://www.magticom.ge/images/channels/MjAxOC8wOS8xMC9lZmJhNWU5Yy0yMmNiLTRkMTAtOWY5Ny01ODM0MzY0ZTg0MmEuanBn.jpg","name":"CNN Int","site":"magticom.ge","channelsPath":"sites/magticom.ge/magticom.ge_ge.channels.xml","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ge/magticom.ge"],"cluster_id":1,"programCount":0,"_id":"1XzrxNkSF2AQNBrT"} +{"lang":"en","country":"ZA","xmltv_id":"MNetMovies2.za","site_id":"404a052b-3dea-4cac-a19c-de9a7d6f191d#MAP","logo":"https://rndcdn.dstv.com/dstvcms/2020/08/31/M-Net_Movies_2_Logo_4-3_lightbackground_xlrg.png","name":"M-Net Movies 2","site":"dstv.com","channelsPath":"sites/dstv.com/dstv.com_zw.channels.xml","configPath":"sites/dstv.com/dstv.com.config.js","groups":["zw/dstv.com"],"cluster_id":120,"programCount":14,"_id":"1lnhXpN7g0ER5XwN"} diff --git a/tests/__data__/input/database/programs.db b/tests/__data__/input/database/programs.db index 3c7e1ac5..39039d4e 100644 --- a/tests/__data__/input/database/programs.db +++ b/tests/__data__/input/database/programs.db @@ -1,46 +1,46 @@ -{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641825900,"stop":1641826800,"site":"magticom.ge","gid":"us","country":"US","_id":"12AJc0GeEJE9p4c3"} -{"title":"Connecting Africa. 114-я серия","description":"114-я серия. Проект, рассказывающий о людях и компаниях, которые совершают революцию в африканском бизнесе, и о тех, кто объединяет континент, выступая за свободную торговлю в Африке.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641843900,"stop":1641844800,"site":"magticom.ge","gid":"us","country":"US","_id":"1dxcT34nyxzOlxBL"} -{"title":"Connect the World","description":"Актуальная мировая информация с разных континентов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641826800,"stop":1641830400,"site":"magticom.ge","gid":"us","country":"US","_id":"2uJe4w2lgvjNOXo0"} -{"title":"The Lead with Jake Tapper","description":"Оперативная сводка новостей страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641844800,"stop":1641848400,"site":"magticom.ge","gid":"us","country":"US","_id":"6As6GzEVhb3OWM0M"} -{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641817800,"stop":1641819600,"site":"magticom.ge","gid":"us","country":"US","_id":"6DXKlITWehX1Jx4F"} -{"title":"CNN Newsroom with Michael Holmes","description":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641790800,"stop":1641794400,"site":"magticom.ge","gid":"us","country":"US","_id":"AadPdMZ3s72y8NMk"} -{"title":"The Situation Room with Wolf Blitzer","description":"Командный центр новостей, политики и неординарных репортажей со всего мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641852000,"stop":1641855600,"site":"magticom.ge","gid":"us","country":"US","_id":"Az3ABKy3HnE7sJZk"} -{"title":"One World with Zain Asher","description":"Освещаются важные новости с каждого континента, от политики и текущих дел до социальных вопросов и многого другого.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641830400,"stop":1641833100,"site":"magticom.ge","gid":"us","country":"US","_id":"DMurxgt5OD0E9OIE"} -{"title":"TBD","description":"Информационно-познавательный проект CNN.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641783600,"stop":1641785400,"site":"magticom.ge","gid":"us","country":"US","_id":"HQJqM2kIa77llWbC"} -{"title":"Marketplace Africa. 548-я серия","description":"548-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641782700,"stop":1641783600,"site":"magticom.ge","gid":"us","country":"US","_id":"Jn3khh5n9Brkxq4U"} -{"title":"CNN Newsroom with Michael Holmes","description":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641787200,"stop":1641789900,"site":"magticom.ge","gid":"us","country":"US","_id":"KcrIoQTXtUdw74sO"} -{"title":"The Global Brief with Bianca Nobilo","description":"Global Brief с Бьянкой Нобило проницательно исследует меняющийся мир для меняющейся аудитории, обеспечивая непревзойденную глубину и качество для занятых зрителей в быстро меняющемся мире.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641848400,"stop":1641850200,"site":"magticom.ge","gid":"us","country":"US","_id":"LGD7WmQogDRxZn01"} -{"title":"CNN Newsroom with Rosemary Church","description":"Свежая мировая информационная сводка от CNN. О политике, экономике, общественной жизни, культуре, спорте.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641798000,"stop":1641805200,"site":"magticom.ge","gid":"us","country":"US","_id":"LyCBivUTdZFW9X53"} -{"title":"Marketplace Africa. 549-я серия","description":"549-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641833100,"stop":1641834000,"site":"magticom.ge","gid":"us","country":"US","_id":"PbrZinuZKgBHqDVj"} -{"title":"African Voices Changemakers. 114-я серия","description":"114-я серия. Африка сегодня - люди, новости, события.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641780000,"stop":1641781800,"site":"magticom.ge","gid":"us","country":"US","_id":"SvrCK31v78V5y7EA"} -{"title":"Anderson Cooper 360","description":"Уникальный взгляд Андерсона Купера на главные события мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641859200,"stop":1641862800,"site":"magticom.ge","gid":"us","country":"US","_id":"TFGrOFJGkaOs9pU7"} -{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641850200,"stop":1641852000,"site":"magticom.ge","gid":"us","country":"US","_id":"UynlLeT41MsjFElg"} -{"title":"New Day","description":"Свежий обзор событий в стране и мире.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641808800,"stop":1641817800,"site":"magticom.ge","gid":"us","country":"US","_id":"UyvhQ4wRNq5d5XRd"} -{"title":"Amanpour","description":"Сводка новостей от знаменитой ведущей канала CNN.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641834000,"stop":1641837600,"site":"magticom.ge","gid":"us","country":"US","_id":"WbsOCkmPH5gjmo4M"} -{"title":"Early Start","description":"Новости дня с Кристиной Романс и Дейвом Бриггсом.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641805200,"stop":1641808800,"site":"magticom.ge","gid":"us","country":"US","_id":"YB96P2mMO4TA0pID"} -{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641789900,"stop":1641790800,"site":"magticom.ge","gid":"us","country":"US","_id":"aDdCAlgqLG2yxM1m"} -{"title":"CNN Newsroom Sunday","description":"Свежая мировая информационная сводка от CNN. О политике, экономике, общественной жизни, культуре, спорте.","category":["Category1","Category2"],"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641772800,"stop":1641776400,"site":"magticom.ge","gid":"us","country":"US","_id":"aYCk87dUOAkCJE9x"} -{"title":"Fareed Zakaria GPS","description":"Интервью с главными игроками мировой политики.","category":"Category1","season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641776400,"stop":1641780000,"site":"magticom.ge","gid":"us","country":"US","_id":"c1nCoWVetBZ3mn5q"} -{"title":"Inside Africa. 586-я серия","description":"586-я серия. Своеобразное \"путешествие\" по Африке - почувствуйте все разнообразие культур различных стран и регионов континента.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641785400,"stop":1641787200,"site":"magticom.ge","gid":"us","country":"US","_id":"goaDr7BsGGm3LCfz"} -{"title":"CNN Newsroom with Robyn Curnow","description":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641794400,"stop":1641797100,"site":"magticom.ge","gid":"us","country":"US","_id":"nixd3gRF1S1K0ZOs"} -{"title":"Marketplace Africa. 549-я серия","description":"549-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641781800,"stop":1641782700,"site":"magticom.ge","gid":"us","country":"US","_id":"r1b8EvZc0tYs88ga"} -{"title":"Erin Burnett OutFront","description":"Обсуждение самых важных мировых тем в эфире канала CNN.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641855600,"stop":1641859200,"site":"magticom.ge","gid":"us","country":"US","_id":"sIQtUtowtATc7dLj"} -{"title":"Connect the World","description":"Актуальная мировая информация с разных континентов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641823200,"stop":1641825900,"site":"magticom.ge","gid":"us","country":"US","_id":"tXBIZ2BZBIkhnoTZ"} -{"title":"Quest Means Business","description":"Ричард Квест возглавляет группу экспертов и корреспондентов, чтобы предоставить актуальные факты, цифры и анализ из делового мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641841200,"stop":1641843900,"site":"magticom.ge","gid":"us","country":"US","_id":"xlE5epkjzdfUQpXO"} -{"title":"First Move with Julia Chatterley","description":"Несколько больших историй, связанных с открытием рынков в США.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641819600,"stop":1641823200,"site":"magticom.ge","gid":"us","country":"US","_id":"yEVXucyUomVmktMF"} -{"title":"Hala Gorani Tonight","description":"Используя свой 25-летний журналистский опыт, Хала Горани будет освещать ключевые события в картине дня посредством диалога с гостями и экспертами-аналитиками.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641837600,"stop":1641841200,"site":"magticom.ge","gid":"us","country":"US","_id":"yPgmYrWwfxHW3WUA"} -{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641797100,"stop":1641798000,"site":"magticom.ge","gid":"us","country":"US","_id":"zX70wOz5drExRTJX"} -{"title":"Robin Hood","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641822300,"stop":1641829200,"site":"dstv.com","gid":"za","country":"ZA","_id":"1AoKArQw6MxP6pVU"} -{"title":"The Water Diviner","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641776100,"stop":1641782700,"site":"dstv.com","gid":"za","country":"ZA","_id":"6v7w0SB4IlnfEEu3"} -{"title":"Bad Boys For Life","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641847200,"stop":1641850800,"site":"dstv.com","gid":"za","country":"ZA","_id":"83VRYvggmyfCzkOm"} -{"title":"12 Strong","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641814500,"stop":1641822300,"site":"dstv.com","gid":"za","country":"ZA","_id":"DbjwscjIuVDY8TPx"} -{"title":"Backdraft","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641801300,"stop":1641809400,"site":"dstv.com","gid":"za","country":"ZA","_id":"IwuwkjCKqWvio7ba"} -{"title":"Force Of Nature","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641841200,"stop":1641847200,"site":"dstv.com","gid":"za","country":"ZA","_id":"LP56HczEup0ed3Xx"} -{"title":"Mafia","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641809400,"stop":1641814500,"site":"dstv.com","gid":"za","country":"ZA","_id":"MM9DPxERAgGGak39"} -{"title":"The Last Witch Hunter","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641834780,"stop":1641841200,"site":"dstv.com","gid":"za","country":"ZA","_id":"MciJOpN3YCodj6Na"} -{"title":"Beyond The Line","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641796500,"stop":1641801300,"site":"dstv.com","gid":"za","country":"ZA","_id":"ZKA2s6QrM0xRrfGz"} -{"title":"Paranoia","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641790200,"stop":1641796500,"site":"dstv.com","gid":"za","country":"ZA","_id":"ZpdIZeSRhPycDX9D"} -{"title":"The Scorpion King","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641829200,"stop":1641834780,"site":"dstv.com","gid":"za","country":"ZA","_id":"doO4Lh1pAt6L6wHa"} -{"title":"Fatman","description":null,"category":null,"season":9,"episode":257,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641761700,"stop":1641767700,"site":"dstv.com","gid":"za","country":"ZA","_id":"fHahGuzHnU7xVEJX"} -{"title":"Outbreak","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641782700,"stop":1641790200,"site":"dstv.com","gid":"za","country":"ZA","_id":"mkvcMP4FMwL2a5ax"} -{"title":"Motherless Brooklyn","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641767700,"stop":1641776100,"site":"dstv.com","gid":"za","country":"ZA","_id":"nxTIAJsBwyXztRun"} +{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641825900,"stop":1641826800,"_cid":"0Wefq0oMR3feCcuY","_id":"12AJc0GeEJE9p4c3"} +{"title":"Connecting Africa. 114-я серия","description":"114-я серия. Проект, рассказывающий о людях и компаниях, которые совершают революцию в африканском бизнесе, и о тех, кто объединяет континент, выступая за свободную торговлю в Африке.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641843900,"stop":1641844800,"_cid":"0Wefq0oMR3feCcuY","_id":"1dxcT34nyxzOlxBL"} +{"title":"Connect the World","description":"Актуальная мировая информация с разных континентов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641826800,"stop":1641830400,"_cid":"0Wefq0oMR3feCcuY","_id":"2uJe4w2lgvjNOXo0"} +{"title":"The Lead with Jake Tapper","description":"Оперативная сводка новостей страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641844800,"stop":1641848400,"_cid":"0Wefq0oMR3feCcuY","_id":"6As6GzEVhb3OWM0M"} +{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641817800,"stop":1641819600,"_cid":"0Wefq0oMR3feCcuY","_id":"6DXKlITWehX1Jx4F"} +{"title":"CNN Newsroom with Michael Holmes","description":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641790800,"stop":1641794400,"_cid":"0Wefq0oMR3feCcuY","_id":"AadPdMZ3s72y8NMk"} +{"title":"The Situation Room with Wolf Blitzer","description":"Командный центр новостей, политики и неординарных репортажей со всего мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641852000,"stop":1641855600,"_cid":"0Wefq0oMR3feCcuY","_id":"Az3ABKy3HnE7sJZk"} +{"title":"One World with Zain Asher","description":"Освещаются важные новости с каждого континента, от политики и текущих дел до социальных вопросов и многого другого.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641830400,"stop":1641833100,"_cid":"0Wefq0oMR3feCcuY","_id":"DMurxgt5OD0E9OIE"} +{"title":"TBD","description":"Информационно-познавательный проект CNN.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641783600,"stop":1641785400,"_cid":"0Wefq0oMR3feCcuY","_id":"HQJqM2kIa77llWbC"} +{"title":"Marketplace Africa. 548-я серия","description":"548-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641782700,"stop":1641783600,"_cid":"0Wefq0oMR3feCcuY","_id":"Jn3khh5n9Brkxq4U"} +{"title":"CNN Newsroom with Michael Holmes","description":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641787200,"stop":1641789900,"_cid":"0Wefq0oMR3feCcuY","_id":"KcrIoQTXtUdw74sO"} +{"title":"The Global Brief with Bianca Nobilo","description":"Global Brief с Бьянкой Нобило проницательно исследует меняющийся мир для меняющейся аудитории, обеспечивая непревзойденную глубину и качество для занятых зрителей в быстро меняющемся мире.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641848400,"stop":1641850200,"_cid":"0Wefq0oMR3feCcuY","_id":"LGD7WmQogDRxZn01"} +{"title":"CNN Newsroom with Rosemary Church","description":"Свежая мировая информационная сводка от CNN. О политике, экономике, общественной жизни, культуре, спорте.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641798000,"stop":1641805200,"_cid":"0Wefq0oMR3feCcuY","_id":"LyCBivUTdZFW9X53"} +{"title":"Marketplace Africa. 549-я серия","description":"549-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641833100,"stop":1641834000,"_cid":"0Wefq0oMR3feCcuY","_id":"PbrZinuZKgBHqDVj"} +{"title":"African Voices Changemakers. 114-я серия","description":"114-я серия. Африка сегодня - люди, новости, события.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641780000,"stop":1641781800,"_cid":"0Wefq0oMR3feCcuY","_id":"SvrCK31v78V5y7EA"} +{"title":"Anderson Cooper 360","description":"Уникальный взгляд Андерсона Купера на главные события мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641859200,"stop":1641862800,"_cid":"0Wefq0oMR3feCcuY","_id":"TFGrOFJGkaOs9pU7"} +{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641850200,"stop":1641852000,"_cid":"0Wefq0oMR3feCcuY","_id":"UynlLeT41MsjFElg"} +{"title":"New Day","description":"Свежий обзор событий в стране и мире.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641808800,"stop":1641817800,"_cid":"0Wefq0oMR3feCcuY","_id":"UyvhQ4wRNq5d5XRd"} +{"title":"Amanpour","description":"Сводка новостей от знаменитой ведущей канала CNN.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641834000,"stop":1641837600,"_cid":"0Wefq0oMR3feCcuY","_id":"WbsOCkmPH5gjmo4M"} +{"title":"Early Start","description":"Новости дня с Кристиной Романс и Дейвом Бриггсом.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641805200,"stop":1641808800,"_cid":"0Wefq0oMR3feCcuY","_id":"YB96P2mMO4TA0pID"} +{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641789900,"stop":1641790800,"_cid":"0Wefq0oMR3feCcuY","_id":"aDdCAlgqLG2yxM1m"} +{"title":"CNN Newsroom Sunday","description":"Свежая мировая информационная сводка от CNN. О политике, экономике, общественной жизни, культуре, спорте.","category":["Category1","Category2"],"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641772800,"stop":1641776400,"_cid":"0Wefq0oMR3feCcuY","_id":"aYCk87dUOAkCJE9x"} +{"title":"Fareed Zakaria GPS","description":"Интервью с главными игроками мировой политики.","category":"Category1","season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641776400,"stop":1641780000,"_cid":"0Wefq0oMR3feCcuY","_id":"c1nCoWVetBZ3mn5q"} +{"title":"Inside Africa. 586-я серия","description":"586-я серия. Своеобразное \"путешествие\" по Африке - почувствуйте все разнообразие культур различных стран и регионов континента.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641785400,"stop":1641787200,"_cid":"0Wefq0oMR3feCcuY","_id":"goaDr7BsGGm3LCfz"} +{"title":"CNN Newsroom with Robyn Curnow","description":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641794400,"stop":1641797100,"_cid":"0Wefq0oMR3feCcuY","_id":"nixd3gRF1S1K0ZOs"} +{"title":"Marketplace Africa. 549-я серия","description":"549-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641781800,"stop":1641782700,"_cid":"0Wefq0oMR3feCcuY","_id":"r1b8EvZc0tYs88ga"} +{"title":"Erin Burnett OutFront","description":"Обсуждение самых важных мировых тем в эфире канала CNN.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641855600,"stop":1641859200,"_cid":"0Wefq0oMR3feCcuY","_id":"sIQtUtowtATc7dLj"} +{"title":"Connect the World","description":"Актуальная мировая информация с разных континентов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641823200,"stop":1641825900,"_cid":"0Wefq0oMR3feCcuY","_id":"tXBIZ2BZBIkhnoTZ"} +{"title":"Quest Means Business","description":"Ричард Квест возглавляет группу экспертов и корреспондентов, чтобы предоставить актуальные факты, цифры и анализ из делового мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641841200,"stop":1641843900,"_cid":"0Wefq0oMR3feCcuY","_id":"xlE5epkjzdfUQpXO"} +{"title":"First Move with Julia Chatterley","description":"Несколько больших историй, связанных с открытием рынков в США.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641819600,"stop":1641823200,"_cid":"0Wefq0oMR3feCcuY","_id":"yEVXucyUomVmktMF"} +{"title":"Hala Gorani Tonight","description":"Используя свой 25-летний журналистский опыт, Хала Горани будет освещать ключевые события в картине дня посредством диалога с гостями и экспертами-аналитиками.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641837600,"stop":1641841200,"_cid":"0Wefq0oMR3feCcuY","_id":"yPgmYrWwfxHW3WUA"} +{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641797100,"stop":1641798000,"_cid":"0Wefq0oMR3feCcuY","_id":"zX70wOz5drExRTJX"} +{"title":"Robin Hood","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641822300,"stop":1641829200,"_cid":"1lnhXpN7g0ER5XwN","_id":"1AoKArQw6MxP6pVU"} +{"title":"The Water Diviner","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641776100,"stop":1641782700,"_cid":"1lnhXpN7g0ER5XwN","_id":"6v7w0SB4IlnfEEu3"} +{"title":"Bad Boys For Life","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641847200,"stop":1641850800,"_cid":"1lnhXpN7g0ER5XwN","_id":"83VRYvggmyfCzkOm"} +{"title":"12 Strong","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641814500,"stop":1641822300,"_cid":"1lnhXpN7g0ER5XwN","_id":"DbjwscjIuVDY8TPx"} +{"title":"Backdraft","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641801300,"stop":1641809400,"_cid":"1lnhXpN7g0ER5XwN","_id":"IwuwkjCKqWvio7ba"} +{"title":"Force Of Nature","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641841200,"stop":1641847200,"_cid":"1lnhXpN7g0ER5XwN","_id":"LP56HczEup0ed3Xx"} +{"title":"Mafia","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641809400,"stop":1641814500,"_cid":"1lnhXpN7g0ER5XwN","_id":"MM9DPxERAgGGak39"} +{"title":"The Last Witch Hunter","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641834780,"stop":1641841200,"_cid":"1lnhXpN7g0ER5XwN","_id":"MciJOpN3YCodj6Na"} +{"title":"Beyond The Line","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641796500,"stop":1641801300,"_cid":"1lnhXpN7g0ER5XwN","_id":"ZKA2s6QrM0xRrfGz"} +{"title":"Paranoia","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641790200,"stop":1641796500,"_cid":"1lnhXpN7g0ER5XwN","_id":"ZpdIZeSRhPycDX9D"} +{"title":"The Scorpion King","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641829200,"stop":1641834780,"_cid":"1lnhXpN7g0ER5XwN","_id":"doO4Lh1pAt6L6wHa"} +{"title":"Fatman","description":null,"category":null,"season":9,"episode":257,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641761700,"stop":1641767700,"_cid":"1lnhXpN7g0ER5XwN","_id":"fHahGuzHnU7xVEJX"} +{"title":"Outbreak","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641782700,"stop":1641790200,"_cid":"1lnhXpN7g0ER5XwN","_id":"mkvcMP4FMwL2a5ax"} +{"title":"Motherless Brooklyn","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641767700,"stop":1641776100,"_cid":"1lnhXpN7g0ER5XwN","_id":"nxTIAJsBwyXztRun"} diff --git a/tests/commands/update-guides.test.js b/tests/commands/update-guides.test.js index d9113b4c..391bf252 100644 --- a/tests/commands/update-guides.test.js +++ b/tests/commands/update-guides.test.js @@ -15,7 +15,7 @@ beforeEach(() => { 'tests/__data__/temp/database/programs.db' ) - execSync( + const stdout = execSync( 'DB_DIR=tests/__data__/temp/database PUBLIC_DIR=tests/__data__/output LOGS_DIR=tests/__data__/output/logs node scripts/commands/update-guides.js', { encoding: 'utf8' } ) @@ -26,13 +26,13 @@ afterEach(() => { }) it('can generate /guides', () => { - const output1 = content('tests/__data__/output/guides/us/magticom.ge.epg.xml') - const expected1 = content('tests/__data__/expected/guides/us/magticom.ge.epg.xml') + const output1 = content('tests/__data__/output/guides/fr/chaines-tv.orange.fr.epg.xml') + const expected1 = content('tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.xml') expect(output1).toBe(expected1) - const output2 = content('tests/__data__/output/guides/za/dstv.com.epg.xml') - const expected2 = content('tests/__data__/expected/guides/za/dstv.com.epg.xml') + const output2 = content('tests/__data__/output/guides/zw/dstv.com.epg.xml') + const expected2 = content('tests/__data__/expected/guides/zw/dstv.com.epg.xml') expect(output2).toBe(expected2) From 1a33b7d78d54f3a4baf9f2672e09bc9f8e598ba0 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 21 Jan 2022 23:15:39 +0300 Subject: [PATCH 12/16] Update update-readme.js --- scripts/commands/update-readme.js | 58 ++++++++++----------- tests/__data__/input/logs/update-guides.log | 14 ++--- tests/commands/update-readme.test.js | 2 +- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/scripts/commands/update-readme.js b/scripts/commands/update-readme.js index db6021fe..2b0d0e17 100644 --- a/scripts/commands/update-readme.js +++ b/scripts/commands/update-readme.js @@ -1,14 +1,11 @@ const { file, markdown, parser, logger } = require('../core') +const provinces = require('../data/ca-provinces.json') const countries = require('../data/countries.json') const states = require('../data/us-states.json') -const provinces = require('../data/ca-provinces.json') const { program } = require('commander') const _ = require('lodash') const LOGS_DIR = process.env.LOGS_DIR || 'scripts/logs' -const LOG_PATH = `${LOGS_DIR}/update-guides.log` - -let log = [] const options = program .option('-c, --config ', 'Set path to config file', '.readme/config.json') @@ -16,31 +13,28 @@ const options = program .opts() async function main() { - await setUp() - - await generateCountriesTable() - await generateUSStatesTable() - await generateCanadaProvincesTable() - + const records = await getLogRecords() + await generateCountriesTable(records) + await generateUSStatesTable(records) + await generateCanadaProvincesTable(records) await updateReadme() } main() -async function generateCountriesTable() { +async function generateCountriesTable(items = []) { logger.info('Generating countries table...') - const items = log.filter(i => i.gid.length === 2) let rows = [] for (const item of items) { - const code = item.gid.toUpperCase() - const country = countries[code] + const country = countries[item.code] + if (!country) continue rows.push({ flag: country.flag, name: country.name, channels: item.count, - epg: `https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml` + epg: `https://iptv-org.github.io/epg/guides/${item.group}.epg.xml` }) } @@ -52,19 +46,18 @@ async function generateCountriesTable() { await file.create('./.readme/_countries.md', table) } -async function generateUSStatesTable() { +async function generateUSStatesTable(items = []) { logger.info('Generating US states table...') - const items = log.filter(i => i.gid.startsWith('us-')) let rows = [] for (const item of items) { - const code = item.gid.toUpperCase() - const state = states[code] + const state = states[item.code] + if (!state) continue rows.push({ name: state.name, channels: item.count, - epg: `https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml` + epg: `https://iptv-org.github.io/epg/guides/${item.group}.epg.xml` }) } @@ -76,19 +69,18 @@ async function generateUSStatesTable() { await file.create('./.readme/_us-states.md', table) } -async function generateCanadaProvincesTable() { +async function generateCanadaProvincesTable(items = []) { logger.info('Generating Canada provinces table...') - const items = log.filter(i => i.gid.startsWith('ca-')) let rows = [] for (const item of items) { - const code = item.gid.toUpperCase() - const province = provinces[code] + const province = provinces[item.code] + if (!province) continue rows.push({ name: province.name, channels: item.count, - epg: `https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml` + epg: `https://iptv-org.github.io/epg/guides/${item.group}.epg.xml` }) } @@ -108,11 +100,19 @@ async function updateReadme() { await markdown.compile(options.config) } -async function setUp() { - log = await parser.parseLogs(LOG_PATH) +async function getLogRecords() { + const logPath = `${LOGS_DIR}/update-guides.log` + const records = await parser.parseLogs(logPath) - if (!log.length) { - logger.error(`File "${LOG_PATH}" is empty`) + if (!records.length) { + logger.error(`File "${logPath}" is empty`) process.exit(1) } + + return records.map(item => { + const code = item.group.split('/')[0] || '' + item.code = code.toUpperCase() + + return item + }) } diff --git a/tests/__data__/input/logs/update-guides.log b/tests/__data__/input/logs/update-guides.log index 1afbb852..39141054 100644 --- a/tests/__data__/input/logs/update-guides.log +++ b/tests/__data__/input/logs/update-guides.log @@ -1,7 +1,7 @@ -{"gid":"us","site":"magticom.ge","count":74,"status":1} -{"gid":"za","site":"dstv.com","count":1,"status":1} -{"gid":"us-pr","site":"tvtv.us","count":14,"status":1} -{"gid":"us-pr","site":"gatotv.com","count":7,"status":1} -{"gid":"us-pr","site":"directv.com","count":1,"status":1} -{"gid":"ca-nl","site":"tvtv.us","count":1,"status":1} -{"gid":"us","site":"tvtv.us","count":372,"status":1} +{"group":"us/magticom.ge","count":74} +{"group":"za/dstv.com","count":1} +{"group":"us-pr/tvtv.us","count":14} +{"group":"us-pr/gatotv.com","count":7} +{"group":"us-pr/directv.com","count":1} +{"group":"ca-nl/tvtv.us","count":1} +{"group":"us/tvtv.us","count":372} diff --git a/tests/commands/update-readme.test.js b/tests/commands/update-readme.test.js index fbd903ee..b15082a2 100644 --- a/tests/commands/update-readme.test.js +++ b/tests/commands/update-readme.test.js @@ -6,7 +6,7 @@ beforeEach(() => { fs.rmdirSync('tests/__data__/output', { recursive: true }) fs.mkdirSync('tests/__data__/output') - execSync( + const stdout = execSync( 'LOGS_DIR=tests/__data__/input/logs node scripts/commands/update-readme.js --config=tests/__data__/input/_readme.json', { encoding: 'utf8' } ) From b297cdaf2ae8176880f5eed7ec691c122c97d590 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 21 Jan 2022 23:30:53 +0300 Subject: [PATCH 13/16] Update programs.db --- tests/__data__/input/database/programs.db | 92 +++++++++++------------ 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/tests/__data__/input/database/programs.db b/tests/__data__/input/database/programs.db index 39039d4e..58bcea0b 100644 --- a/tests/__data__/input/database/programs.db +++ b/tests/__data__/input/database/programs.db @@ -1,46 +1,46 @@ -{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641825900,"stop":1641826800,"_cid":"0Wefq0oMR3feCcuY","_id":"12AJc0GeEJE9p4c3"} -{"title":"Connecting Africa. 114-я серия","description":"114-я серия. Проект, рассказывающий о людях и компаниях, которые совершают революцию в африканском бизнесе, и о тех, кто объединяет континент, выступая за свободную торговлю в Африке.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641843900,"stop":1641844800,"_cid":"0Wefq0oMR3feCcuY","_id":"1dxcT34nyxzOlxBL"} -{"title":"Connect the World","description":"Актуальная мировая информация с разных континентов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641826800,"stop":1641830400,"_cid":"0Wefq0oMR3feCcuY","_id":"2uJe4w2lgvjNOXo0"} -{"title":"The Lead with Jake Tapper","description":"Оперативная сводка новостей страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641844800,"stop":1641848400,"_cid":"0Wefq0oMR3feCcuY","_id":"6As6GzEVhb3OWM0M"} -{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641817800,"stop":1641819600,"_cid":"0Wefq0oMR3feCcuY","_id":"6DXKlITWehX1Jx4F"} -{"title":"CNN Newsroom with Michael Holmes","description":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641790800,"stop":1641794400,"_cid":"0Wefq0oMR3feCcuY","_id":"AadPdMZ3s72y8NMk"} -{"title":"The Situation Room with Wolf Blitzer","description":"Командный центр новостей, политики и неординарных репортажей со всего мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641852000,"stop":1641855600,"_cid":"0Wefq0oMR3feCcuY","_id":"Az3ABKy3HnE7sJZk"} -{"title":"One World with Zain Asher","description":"Освещаются важные новости с каждого континента, от политики и текущих дел до социальных вопросов и многого другого.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641830400,"stop":1641833100,"_cid":"0Wefq0oMR3feCcuY","_id":"DMurxgt5OD0E9OIE"} -{"title":"TBD","description":"Информационно-познавательный проект CNN.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641783600,"stop":1641785400,"_cid":"0Wefq0oMR3feCcuY","_id":"HQJqM2kIa77llWbC"} -{"title":"Marketplace Africa. 548-я серия","description":"548-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641782700,"stop":1641783600,"_cid":"0Wefq0oMR3feCcuY","_id":"Jn3khh5n9Brkxq4U"} -{"title":"CNN Newsroom with Michael Holmes","description":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641787200,"stop":1641789900,"_cid":"0Wefq0oMR3feCcuY","_id":"KcrIoQTXtUdw74sO"} -{"title":"The Global Brief with Bianca Nobilo","description":"Global Brief с Бьянкой Нобило проницательно исследует меняющийся мир для меняющейся аудитории, обеспечивая непревзойденную глубину и качество для занятых зрителей в быстро меняющемся мире.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641848400,"stop":1641850200,"_cid":"0Wefq0oMR3feCcuY","_id":"LGD7WmQogDRxZn01"} -{"title":"CNN Newsroom with Rosemary Church","description":"Свежая мировая информационная сводка от CNN. О политике, экономике, общественной жизни, культуре, спорте.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641798000,"stop":1641805200,"_cid":"0Wefq0oMR3feCcuY","_id":"LyCBivUTdZFW9X53"} -{"title":"Marketplace Africa. 549-я серия","description":"549-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641833100,"stop":1641834000,"_cid":"0Wefq0oMR3feCcuY","_id":"PbrZinuZKgBHqDVj"} -{"title":"African Voices Changemakers. 114-я серия","description":"114-я серия. Африка сегодня - люди, новости, события.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641780000,"stop":1641781800,"_cid":"0Wefq0oMR3feCcuY","_id":"SvrCK31v78V5y7EA"} -{"title":"Anderson Cooper 360","description":"Уникальный взгляд Андерсона Купера на главные события мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641859200,"stop":1641862800,"_cid":"0Wefq0oMR3feCcuY","_id":"TFGrOFJGkaOs9pU7"} -{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641850200,"stop":1641852000,"_cid":"0Wefq0oMR3feCcuY","_id":"UynlLeT41MsjFElg"} -{"title":"New Day","description":"Свежий обзор событий в стране и мире.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641808800,"stop":1641817800,"_cid":"0Wefq0oMR3feCcuY","_id":"UyvhQ4wRNq5d5XRd"} -{"title":"Amanpour","description":"Сводка новостей от знаменитой ведущей канала CNN.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641834000,"stop":1641837600,"_cid":"0Wefq0oMR3feCcuY","_id":"WbsOCkmPH5gjmo4M"} -{"title":"Early Start","description":"Новости дня с Кристиной Романс и Дейвом Бриггсом.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641805200,"stop":1641808800,"_cid":"0Wefq0oMR3feCcuY","_id":"YB96P2mMO4TA0pID"} -{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641789900,"stop":1641790800,"_cid":"0Wefq0oMR3feCcuY","_id":"aDdCAlgqLG2yxM1m"} -{"title":"CNN Newsroom Sunday","description":"Свежая мировая информационная сводка от CNN. О политике, экономике, общественной жизни, культуре, спорте.","category":["Category1","Category2"],"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641772800,"stop":1641776400,"_cid":"0Wefq0oMR3feCcuY","_id":"aYCk87dUOAkCJE9x"} -{"title":"Fareed Zakaria GPS","description":"Интервью с главными игроками мировой политики.","category":"Category1","season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641776400,"stop":1641780000,"_cid":"0Wefq0oMR3feCcuY","_id":"c1nCoWVetBZ3mn5q"} -{"title":"Inside Africa. 586-я серия","description":"586-я серия. Своеобразное \"путешествие\" по Африке - почувствуйте все разнообразие культур различных стран и регионов континента.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641785400,"stop":1641787200,"_cid":"0Wefq0oMR3feCcuY","_id":"goaDr7BsGGm3LCfz"} -{"title":"CNN Newsroom with Robyn Curnow","description":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641794400,"stop":1641797100,"_cid":"0Wefq0oMR3feCcuY","_id":"nixd3gRF1S1K0ZOs"} -{"title":"Marketplace Africa. 549-я серия","description":"549-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641781800,"stop":1641782700,"_cid":"0Wefq0oMR3feCcuY","_id":"r1b8EvZc0tYs88ga"} -{"title":"Erin Burnett OutFront","description":"Обсуждение самых важных мировых тем в эфире канала CNN.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641855600,"stop":1641859200,"_cid":"0Wefq0oMR3feCcuY","_id":"sIQtUtowtATc7dLj"} -{"title":"Connect the World","description":"Актуальная мировая информация с разных континентов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641823200,"stop":1641825900,"_cid":"0Wefq0oMR3feCcuY","_id":"tXBIZ2BZBIkhnoTZ"} -{"title":"Quest Means Business","description":"Ричард Квест возглавляет группу экспертов и корреспондентов, чтобы предоставить актуальные факты, цифры и анализ из делового мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641841200,"stop":1641843900,"_cid":"0Wefq0oMR3feCcuY","_id":"xlE5epkjzdfUQpXO"} -{"title":"First Move with Julia Chatterley","description":"Несколько больших историй, связанных с открытием рынков в США.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641819600,"stop":1641823200,"_cid":"0Wefq0oMR3feCcuY","_id":"yEVXucyUomVmktMF"} -{"title":"Hala Gorani Tonight","description":"Используя свой 25-летний журналистский опыт, Хала Горани будет освещать ключевые события в картине дня посредством диалога с гостями и экспертами-аналитиками.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641837600,"stop":1641841200,"_cid":"0Wefq0oMR3feCcuY","_id":"yPgmYrWwfxHW3WUA"} -{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641797100,"stop":1641798000,"_cid":"0Wefq0oMR3feCcuY","_id":"zX70wOz5drExRTJX"} -{"title":"Robin Hood","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641822300,"stop":1641829200,"_cid":"1lnhXpN7g0ER5XwN","_id":"1AoKArQw6MxP6pVU"} -{"title":"The Water Diviner","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641776100,"stop":1641782700,"_cid":"1lnhXpN7g0ER5XwN","_id":"6v7w0SB4IlnfEEu3"} -{"title":"Bad Boys For Life","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641847200,"stop":1641850800,"_cid":"1lnhXpN7g0ER5XwN","_id":"83VRYvggmyfCzkOm"} -{"title":"12 Strong","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641814500,"stop":1641822300,"_cid":"1lnhXpN7g0ER5XwN","_id":"DbjwscjIuVDY8TPx"} -{"title":"Backdraft","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641801300,"stop":1641809400,"_cid":"1lnhXpN7g0ER5XwN","_id":"IwuwkjCKqWvio7ba"} -{"title":"Force Of Nature","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641841200,"stop":1641847200,"_cid":"1lnhXpN7g0ER5XwN","_id":"LP56HczEup0ed3Xx"} -{"title":"Mafia","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641809400,"stop":1641814500,"_cid":"1lnhXpN7g0ER5XwN","_id":"MM9DPxERAgGGak39"} -{"title":"The Last Witch Hunter","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641834780,"stop":1641841200,"_cid":"1lnhXpN7g0ER5XwN","_id":"MciJOpN3YCodj6Na"} -{"title":"Beyond The Line","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641796500,"stop":1641801300,"_cid":"1lnhXpN7g0ER5XwN","_id":"ZKA2s6QrM0xRrfGz"} -{"title":"Paranoia","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641790200,"stop":1641796500,"_cid":"1lnhXpN7g0ER5XwN","_id":"ZpdIZeSRhPycDX9D"} -{"title":"The Scorpion King","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641829200,"stop":1641834780,"_cid":"1lnhXpN7g0ER5XwN","_id":"doO4Lh1pAt6L6wHa"} -{"title":"Fatman","description":null,"category":null,"season":9,"episode":257,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641761700,"stop":1641767700,"_cid":"1lnhXpN7g0ER5XwN","_id":"fHahGuzHnU7xVEJX"} -{"title":"Outbreak","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641782700,"stop":1641790200,"_cid":"1lnhXpN7g0ER5XwN","_id":"mkvcMP4FMwL2a5ax"} -{"title":"Motherless Brooklyn","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641767700,"stop":1641776100,"_cid":"1lnhXpN7g0ER5XwN","_id":"nxTIAJsBwyXztRun"} +{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641825900,"stop":1641826800,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"12AJc0GeEJE9p4c3"} +{"title":"Connecting Africa. 114-я серия","description":"114-я серия. Проект, рассказывающий о людях и компаниях, которые совершают революцию в африканском бизнесе, и о тех, кто объединяет континент, выступая за свободную торговлю в Африке.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641843900,"stop":1641844800,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"1dxcT34nyxzOlxBL"} +{"title":"Connect the World","description":"Актуальная мировая информация с разных континентов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641826800,"stop":1641830400,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"2uJe4w2lgvjNOXo0"} +{"title":"The Lead with Jake Tapper","description":"Оперативная сводка новостей страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641844800,"stop":1641848400,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"6As6GzEVhb3OWM0M"} +{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641817800,"stop":1641819600,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"6DXKlITWehX1Jx4F"} +{"title":"CNN Newsroom with Michael Holmes","description":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641790800,"stop":1641794400,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"AadPdMZ3s72y8NMk"} +{"title":"The Situation Room with Wolf Blitzer","description":"Командный центр новостей, политики и неординарных репортажей со всего мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641852000,"stop":1641855600,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"Az3ABKy3HnE7sJZk"} +{"title":"One World with Zain Asher","description":"Освещаются важные новости с каждого континента, от политики и текущих дел до социальных вопросов и многого другого.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641830400,"stop":1641833100,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"DMurxgt5OD0E9OIE"} +{"title":"TBD","description":"Информационно-познавательный проект CNN.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641783600,"stop":1641785400,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"HQJqM2kIa77llWbC"} +{"title":"Marketplace Africa. 548-я серия","description":"548-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641782700,"stop":1641783600,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"Jn3khh5n9Brkxq4U"} +{"title":"CNN Newsroom with Michael Holmes","description":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641787200,"stop":1641789900,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"KcrIoQTXtUdw74sO"} +{"title":"The Global Brief with Bianca Nobilo","description":"Global Brief с Бьянкой Нобило проницательно исследует меняющийся мир для меняющейся аудитории, обеспечивая непревзойденную глубину и качество для занятых зрителей в быстро меняющемся мире.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641848400,"stop":1641850200,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"LGD7WmQogDRxZn01"} +{"title":"CNN Newsroom with Rosemary Church","description":"Свежая мировая информационная сводка от CNN. О политике, экономике, общественной жизни, культуре, спорте.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641798000,"stop":1641805200,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"LyCBivUTdZFW9X53"} +{"title":"Marketplace Africa. 549-я серия","description":"549-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641833100,"stop":1641834000,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"PbrZinuZKgBHqDVj"} +{"title":"African Voices Changemakers. 114-я серия","description":"114-я серия. Африка сегодня - люди, новости, события.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641780000,"stop":1641781800,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"SvrCK31v78V5y7EA"} +{"title":"Anderson Cooper 360","description":"Уникальный взгляд Андерсона Купера на главные события мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641859200,"stop":1641862800,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"TFGrOFJGkaOs9pU7"} +{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641850200,"stop":1641852000,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"UynlLeT41MsjFElg"} +{"title":"New Day","description":"Свежий обзор событий в стране и мире.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641808800,"stop":1641817800,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"UyvhQ4wRNq5d5XRd"} +{"title":"Amanpour","description":"Сводка новостей от знаменитой ведущей канала CNN.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641834000,"stop":1641837600,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"WbsOCkmPH5gjmo4M"} +{"title":"Early Start","description":"Новости дня с Кристиной Романс и Дейвом Бриггсом.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641805200,"stop":1641808800,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"YB96P2mMO4TA0pID"} +{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641789900,"stop":1641790800,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"aDdCAlgqLG2yxM1m"} +{"title":"CNN Newsroom Sunday","description":"Свежая мировая информационная сводка от CNN. О политике, экономике, общественной жизни, культуре, спорте.","category":["Category1","Category2"],"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641772800,"stop":1641776400,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"aYCk87dUOAkCJE9x"} +{"title":"Fareed Zakaria GPS","description":"Интервью с главными игроками мировой политики.","category":"Category1","season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641776400,"stop":1641780000,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"c1nCoWVetBZ3mn5q"} +{"title":"Inside Africa. 586-я серия","description":"586-я серия. Своеобразное \"путешествие\" по Африке - почувствуйте все разнообразие культур различных стран и регионов континента.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641785400,"stop":1641787200,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"goaDr7BsGGm3LCfz"} +{"title":"CNN Newsroom with Robyn Curnow","description":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641794400,"stop":1641797100,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"nixd3gRF1S1K0ZOs"} +{"title":"Marketplace Africa. 549-я серия","description":"549-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641781800,"stop":1641782700,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"r1b8EvZc0tYs88ga"} +{"title":"Erin Burnett OutFront","description":"Обсуждение самых важных мировых тем в эфире канала CNN.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641855600,"stop":1641859200,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"sIQtUtowtATc7dLj"} +{"title":"Connect the World","description":"Актуальная мировая информация с разных континентов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641823200,"stop":1641825900,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"tXBIZ2BZBIkhnoTZ"} +{"title":"Quest Means Business","description":"Ричард Квест возглавляет группу экспертов и корреспондентов, чтобы предоставить актуальные факты, цифры и анализ из делового мира.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641841200,"stop":1641843900,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"xlE5epkjzdfUQpXO"} +{"title":"First Move with Julia Chatterley","description":"Несколько больших историй, связанных с открытием рынков в США.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641819600,"stop":1641823200,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"yEVXucyUomVmktMF"} +{"title":"Hala Gorani Tonight","description":"Используя свой 25-летний журналистский опыт, Хала Горани будет освещать ключевые события в картине дня посредством диалога с гостями и экспертами-аналитиками.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641837600,"stop":1641841200,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"yPgmYrWwfxHW3WUA"} +{"title":"World Sport","description":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","category":null,"season":null,"episode":null,"icon":null,"channel":"CNNInternationalEurope.us","lang":"ru","start":1641797100,"stop":1641798000,"site":"chaines-tv.orange.fr","_cid":"0Wefq0oMR3feCcuY","_id":"zX70wOz5drExRTJX"} +{"title":"Robin Hood","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641822300,"stop":1641829200,"site":"dstv.com","_cid":"1lnhXpN7g0ER5XwN","_id":"1AoKArQw6MxP6pVU"} +{"title":"The Water Diviner","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641776100,"stop":1641782700,"site":"dstv.com","_cid":"1lnhXpN7g0ER5XwN","_id":"6v7w0SB4IlnfEEu3"} +{"title":"Bad Boys For Life","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641847200,"stop":1641850800,"site":"dstv.com","_cid":"1lnhXpN7g0ER5XwN","_id":"83VRYvggmyfCzkOm"} +{"title":"12 Strong","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641814500,"stop":1641822300,"site":"dstv.com","_cid":"1lnhXpN7g0ER5XwN","_id":"DbjwscjIuVDY8TPx"} +{"title":"Backdraft","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641801300,"stop":1641809400,"site":"dstv.com","_cid":"1lnhXpN7g0ER5XwN","_id":"IwuwkjCKqWvio7ba"} +{"title":"Force Of Nature","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641841200,"stop":1641847200,"site":"dstv.com","_cid":"1lnhXpN7g0ER5XwN","_id":"LP56HczEup0ed3Xx"} +{"title":"Mafia","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641809400,"stop":1641814500,"site":"dstv.com","_cid":"1lnhXpN7g0ER5XwN","_id":"MM9DPxERAgGGak39"} +{"title":"The Last Witch Hunter","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641834780,"stop":1641841200,"site":"dstv.com","_cid":"1lnhXpN7g0ER5XwN","_id":"MciJOpN3YCodj6Na"} +{"title":"Beyond The Line","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641796500,"stop":1641801300,"site":"dstv.com","_cid":"1lnhXpN7g0ER5XwN","_id":"ZKA2s6QrM0xRrfGz"} +{"title":"Paranoia","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641790200,"stop":1641796500,"site":"dstv.com","_cid":"1lnhXpN7g0ER5XwN","_id":"ZpdIZeSRhPycDX9D"} +{"title":"The Scorpion King","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641829200,"stop":1641834780,"site":"dstv.com","_cid":"1lnhXpN7g0ER5XwN","_id":"doO4Lh1pAt6L6wHa"} +{"title":"Fatman","description":null,"category":null,"season":9,"episode":257,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641761700,"stop":1641767700,"site":"dstv.com","_cid":"1lnhXpN7g0ER5XwN","_id":"fHahGuzHnU7xVEJX"} +{"title":"Outbreak","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641782700,"stop":1641790200,"site":"dstv.com","_cid":"1lnhXpN7g0ER5XwN","_id":"mkvcMP4FMwL2a5ax"} +{"title":"Motherless Brooklyn","description":null,"category":null,"season":null,"episode":null,"icon":null,"channel":"MNetMovies2.za","lang":"en","start":1641767700,"stop":1641776100,"site":"dstv.com","_cid":"1lnhXpN7g0ER5XwN","_id":"nxTIAJsBwyXztRun"} From ee8580488dc5ff0e02404a7d83a66ce5431e822a Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 21 Jan 2022 23:31:37 +0300 Subject: [PATCH 14/16] Update save-results.js --- scripts/commands/save-results.js | 1 + tests/__data__/expected/api/channels.json | 2 +- tests/__data__/expected/api/programs.json | 2 +- tests/commands/save-results.test.js | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/commands/save-results.js b/scripts/commands/save-results.js index 49596f88..82feac10 100644 --- a/scripts/commands/save-results.js +++ b/scripts/commands/save-results.js @@ -26,6 +26,7 @@ async function main() { lang: program.lang, start: program.start, stop: program.stop, + site: result.channel.site, _cid: result.channel._id } }) diff --git a/tests/__data__/expected/api/channels.json b/tests/__data__/expected/api/channels.json index a3593aa1..d459d674 100644 --- a/tests/__data__/expected/api/channels.json +++ b/tests/__data__/expected/api/channels.json @@ -1 +1 @@ -[{"id":"BravoEast.us","name":["Bravo East"],"logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","country":"US","guides":["https://iptv-org.github.io/epg/guides/us/directv.com.epg.xml"]},{"id":"CNNInternationalEurope.us","name":["CNN International Europe","CNN Int"],"logo":"https://www.magticom.ge/images/channels/MjAxOC8wOS8xMC9lZmJhNWU5Yy0yMmNiLTRkMTAtOWY5Ny01ODM0MzY0ZTg0MmEuanBn.jpg","country":"US","guides":["https://iptv-org.github.io/epg/guides/fr/chaines-tv.orange.fr.epg.xml","https://iptv-org.github.io/epg/guides/ge/magticom.ge.epg.xml"]},{"id":"MNetMovies2.za","name":["M-Net Movies 2"],"logo":"https://rndcdn.dstv.com/dstvcms/2020/08/31/M-Net_Movies_2_Logo_4-3_lightbackground_xlrg.png","country":"ZA","guides":["https://iptv-org.github.io/epg/guides/zw/dstv.com.epg.xml"]}] \ No newline at end of file +[{"id":"BravoEast.us","name":["Bravo East"],"logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","country":"US","guides":[]},{"id":"CNNInternationalEurope.us","name":["CNN International Europe","CNN Int"],"logo":"https://www.magticom.ge/images/channels/MjAxOC8wOS8xMC9lZmJhNWU5Yy0yMmNiLTRkMTAtOWY5Ny01ODM0MzY0ZTg0MmEuanBn.jpg","country":"US","guides":["https://iptv-org.github.io/epg/guides/fr/chaines-tv.orange.fr.epg.xml"]},{"id":"MNetMovies2.za","name":["M-Net Movies 2"],"logo":"https://rndcdn.dstv.com/dstvcms/2020/08/31/M-Net_Movies_2_Logo_4-3_lightbackground_xlrg.png","country":"ZA","guides":["https://iptv-org.github.io/epg/guides/zw/dstv.com.epg.xml"]}] \ No newline at end of file diff --git a/tests/__data__/expected/api/programs.json b/tests/__data__/expected/api/programs.json index 23e257f7..24ce6a2a 100644 --- a/tests/__data__/expected/api/programs.json +++ b/tests/__data__/expected/api/programs.json @@ -1 +1 @@ -[{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"CNN Newsroom Sunday","desc":"Свежая мировая информационная сводка от CNN. О политике, экономике, общественной жизни, культуре, спорте.","categories":["Category1","Category2"],"season":null,"episode":null,"image":null,"start":1641772800,"stop":1641776400},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"Fareed Zakaria GPS","desc":"Интервью с главными игроками мировой политики.","categories":["Category1"],"season":null,"episode":null,"image":null,"start":1641776400,"stop":1641780000},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"African Voices Changemakers. 114-я серия","desc":"114-я серия. Африка сегодня - люди, новости, события.","categories":[],"season":null,"episode":null,"image":null,"start":1641780000,"stop":1641781800},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"Marketplace Africa. 549-я серия","desc":"549-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","categories":[],"season":null,"episode":null,"image":null,"start":1641781800,"stop":1641782700},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"Marketplace Africa. 548-я серия","desc":"548-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","categories":[],"season":null,"episode":null,"image":null,"start":1641782700,"stop":1641783600},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"TBD","desc":"Информационно-познавательный проект CNN.","categories":[],"season":null,"episode":null,"image":null,"start":1641783600,"stop":1641785400},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"Inside Africa. 586-я серия","desc":"586-я серия. Своеобразное \"путешествие\" по Африке - почувствуйте все разнообразие культур различных стран и регионов континента.","categories":[],"season":null,"episode":null,"image":null,"start":1641785400,"stop":1641787200},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"CNN Newsroom with Michael Holmes","desc":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","categories":[],"season":null,"episode":null,"image":null,"start":1641787200,"stop":1641789900},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"World Sport","desc":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","categories":[],"season":null,"episode":null,"image":null,"start":1641789900,"stop":1641790800},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"CNN Newsroom with Michael Holmes","desc":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","categories":[],"season":null,"episode":null,"image":null,"start":1641790800,"stop":1641794400},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"CNN Newsroom with Robyn Curnow","desc":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","categories":[],"season":null,"episode":null,"image":null,"start":1641794400,"stop":1641797100},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"World Sport","desc":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","categories":[],"season":null,"episode":null,"image":null,"start":1641797100,"stop":1641798000},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"CNN Newsroom with Rosemary Church","desc":"Свежая мировая информационная сводка от CNN. О политике, экономике, общественной жизни, культуре, спорте.","categories":[],"season":null,"episode":null,"image":null,"start":1641798000,"stop":1641805200},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"Early Start","desc":"Новости дня с Кристиной Романс и Дейвом Бриггсом.","categories":[],"season":null,"episode":null,"image":null,"start":1641805200,"stop":1641808800},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"New Day","desc":"Свежий обзор событий в стране и мире.","categories":[],"season":null,"episode":null,"image":null,"start":1641808800,"stop":1641817800},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"World Sport","desc":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","categories":[],"season":null,"episode":null,"image":null,"start":1641817800,"stop":1641819600},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"First Move with Julia Chatterley","desc":"Несколько больших историй, связанных с открытием рынков в США.","categories":[],"season":null,"episode":null,"image":null,"start":1641819600,"stop":1641823200},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"Connect the World","desc":"Актуальная мировая информация с разных континентов.","categories":[],"season":null,"episode":null,"image":null,"start":1641823200,"stop":1641825900},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"World Sport","desc":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","categories":[],"season":null,"episode":null,"image":null,"start":1641825900,"stop":1641826800},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"Connect the World","desc":"Актуальная мировая информация с разных континентов.","categories":[],"season":null,"episode":null,"image":null,"start":1641826800,"stop":1641830400},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"One World with Zain Asher","desc":"Освещаются важные новости с каждого континента, от политики и текущих дел до социальных вопросов и многого другого.","categories":[],"season":null,"episode":null,"image":null,"start":1641830400,"stop":1641833100},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"Marketplace Africa. 549-я серия","desc":"549-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","categories":[],"season":null,"episode":null,"image":null,"start":1641833100,"stop":1641834000},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"Amanpour","desc":"Сводка новостей от знаменитой ведущей канала CNN.","categories":[],"season":null,"episode":null,"image":null,"start":1641834000,"stop":1641837600},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"Hala Gorani Tonight","desc":"Используя свой 25-летний журналистский опыт, Хала Горани будет освещать ключевые события в картине дня посредством диалога с гостями и экспертами-аналитиками.","categories":[],"season":null,"episode":null,"image":null,"start":1641837600,"stop":1641841200},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"Quest Means Business","desc":"Ричард Квест возглавляет группу экспертов и корреспондентов, чтобы предоставить актуальные факты, цифры и анализ из делового мира.","categories":[],"season":null,"episode":null,"image":null,"start":1641841200,"stop":1641843900},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"Connecting Africa. 114-я серия","desc":"114-я серия. Проект, рассказывающий о людях и компаниях, которые совершают революцию в африканском бизнесе, и о тех, кто объединяет континент, выступая за свободную торговлю в Африке.","categories":[],"season":null,"episode":null,"image":null,"start":1641843900,"stop":1641844800},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"The Lead with Jake Tapper","desc":"Оперативная сводка новостей страны и мира.","categories":[],"season":null,"episode":null,"image":null,"start":1641844800,"stop":1641848400},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"The Global Brief with Bianca Nobilo","desc":"Global Brief с Бьянкой Нобило проницательно исследует меняющийся мир для меняющейся аудитории, обеспечивая непревзойденную глубину и качество для занятых зрителей в быстро меняющемся мире.","categories":[],"season":null,"episode":null,"image":null,"start":1641848400,"stop":1641850200},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"World Sport","desc":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","categories":[],"season":null,"episode":null,"image":null,"start":1641850200,"stop":1641852000},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"The Situation Room with Wolf Blitzer","desc":"Командный центр новостей, политики и неординарных репортажей со всего мира.","categories":[],"season":null,"episode":null,"image":null,"start":1641852000,"stop":1641855600},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"Erin Burnett OutFront","desc":"Обсуждение самых важных мировых тем в эфире канала CNN.","categories":[],"season":null,"episode":null,"image":null,"start":1641855600,"stop":1641859200},{"channel":"CNNInternationalEurope.us","site":"magticom.ge","lang":"ru","title":"Anderson Cooper 360","desc":"Уникальный взгляд Андерсона Купера на главные события мира.","categories":[],"season":null,"episode":null,"image":null,"start":1641859200,"stop":1641862800},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Fatman","desc":null,"categories":[],"season":9,"episode":257,"image":null,"start":1641761700,"stop":1641767700},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Motherless Brooklyn","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641767700,"stop":1641776100},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"The Water Diviner","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641776100,"stop":1641782700},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Outbreak","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641782700,"stop":1641790200},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Paranoia","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641790200,"stop":1641796500},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Beyond The Line","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641796500,"stop":1641801300},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Backdraft","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641801300,"stop":1641809400},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Mafia","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641809400,"stop":1641814500},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"12 Strong","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641814500,"stop":1641822300},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Robin Hood","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641822300,"stop":1641829200},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"The Scorpion King","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641829200,"stop":1641834780},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"The Last Witch Hunter","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641834780,"stop":1641841200},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Force Of Nature","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641841200,"stop":1641847200},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Bad Boys For Life","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641847200,"stop":1641850800}] \ No newline at end of file +[{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"CNN Newsroom Sunday","desc":"Свежая мировая информационная сводка от CNN. О политике, экономике, общественной жизни, культуре, спорте.","categories":["Category1","Category2"],"season":null,"episode":null,"image":null,"start":1641772800,"stop":1641776400},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"Fareed Zakaria GPS","desc":"Интервью с главными игроками мировой политики.","categories":["Category1"],"season":null,"episode":null,"image":null,"start":1641776400,"stop":1641780000},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"African Voices Changemakers. 114-я серия","desc":"114-я серия. Африка сегодня - люди, новости, события.","categories":[],"season":null,"episode":null,"image":null,"start":1641780000,"stop":1641781800},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"Marketplace Africa. 549-я серия","desc":"549-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","categories":[],"season":null,"episode":null,"image":null,"start":1641781800,"stop":1641782700},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"Marketplace Africa. 548-я серия","desc":"548-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","categories":[],"season":null,"episode":null,"image":null,"start":1641782700,"stop":1641783600},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"TBD","desc":"Информационно-познавательный проект CNN.","categories":[],"season":null,"episode":null,"image":null,"start":1641783600,"stop":1641785400},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"Inside Africa. 586-я серия","desc":"586-я серия. Своеобразное \"путешествие\" по Африке - почувствуйте все разнообразие культур различных стран и регионов континента.","categories":[],"season":null,"episode":null,"image":null,"start":1641785400,"stop":1641787200},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"CNN Newsroom with Michael Holmes","desc":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","categories":[],"season":null,"episode":null,"image":null,"start":1641787200,"stop":1641789900},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"World Sport","desc":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","categories":[],"season":null,"episode":null,"image":null,"start":1641789900,"stop":1641790800},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"CNN Newsroom with Michael Holmes","desc":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","categories":[],"season":null,"episode":null,"image":null,"start":1641790800,"stop":1641794400},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"CNN Newsroom with Robyn Curnow","desc":"Обзор самых важных и актуальных новостей и событий из жизни страны и мира.","categories":[],"season":null,"episode":null,"image":null,"start":1641794400,"stop":1641797100},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"World Sport","desc":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","categories":[],"season":null,"episode":null,"image":null,"start":1641797100,"stop":1641798000},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"CNN Newsroom with Rosemary Church","desc":"Свежая мировая информационная сводка от CNN. О политике, экономике, общественной жизни, культуре, спорте.","categories":[],"season":null,"episode":null,"image":null,"start":1641798000,"stop":1641805200},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"Early Start","desc":"Новости дня с Кристиной Романс и Дейвом Бриггсом.","categories":[],"season":null,"episode":null,"image":null,"start":1641805200,"stop":1641808800},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"New Day","desc":"Свежий обзор событий в стране и мире.","categories":[],"season":null,"episode":null,"image":null,"start":1641808800,"stop":1641817800},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"World Sport","desc":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","categories":[],"season":null,"episode":null,"image":null,"start":1641817800,"stop":1641819600},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"First Move with Julia Chatterley","desc":"Несколько больших историй, связанных с открытием рынков в США.","categories":[],"season":null,"episode":null,"image":null,"start":1641819600,"stop":1641823200},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"Connect the World","desc":"Актуальная мировая информация с разных континентов.","categories":[],"season":null,"episode":null,"image":null,"start":1641823200,"stop":1641825900},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"World Sport","desc":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","categories":[],"season":null,"episode":null,"image":null,"start":1641825900,"stop":1641826800},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"Connect the World","desc":"Актуальная мировая информация с разных континентов.","categories":[],"season":null,"episode":null,"image":null,"start":1641826800,"stop":1641830400},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"One World with Zain Asher","desc":"Освещаются важные новости с каждого континента, от политики и текущих дел до социальных вопросов и многого другого.","categories":[],"season":null,"episode":null,"image":null,"start":1641830400,"stop":1641833100},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"Marketplace Africa. 549-я серия","desc":"549-я серия. Информационная передача об экономических событиях африканского региона. Анализируются проблемы, даются экономические прогнозы.","categories":[],"season":null,"episode":null,"image":null,"start":1641833100,"stop":1641834000},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"Amanpour","desc":"Сводка новостей от знаменитой ведущей канала CNN.","categories":[],"season":null,"episode":null,"image":null,"start":1641834000,"stop":1641837600},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"Hala Gorani Tonight","desc":"Используя свой 25-летний журналистский опыт, Хала Горани будет освещать ключевые события в картине дня посредством диалога с гостями и экспертами-аналитиками.","categories":[],"season":null,"episode":null,"image":null,"start":1641837600,"stop":1641841200},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"Quest Means Business","desc":"Ричард Квест возглавляет группу экспертов и корреспондентов, чтобы предоставить актуальные факты, цифры и анализ из делового мира.","categories":[],"season":null,"episode":null,"image":null,"start":1641841200,"stop":1641843900},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"Connecting Africa. 114-я серия","desc":"114-я серия. Проект, рассказывающий о людях и компаниях, которые совершают революцию в африканском бизнесе, и о тех, кто объединяет континент, выступая за свободную торговлю в Африке.","categories":[],"season":null,"episode":null,"image":null,"start":1641843900,"stop":1641844800},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"The Lead with Jake Tapper","desc":"Оперативная сводка новостей страны и мира.","categories":[],"season":null,"episode":null,"image":null,"start":1641844800,"stop":1641848400},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"The Global Brief with Bianca Nobilo","desc":"Global Brief с Бьянкой Нобило проницательно исследует меняющийся мир для меняющейся аудитории, обеспечивая непревзойденную глубину и качество для занятых зрителей в быстро меняющемся мире.","categories":[],"season":null,"episode":null,"image":null,"start":1641848400,"stop":1641850200},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"World Sport","desc":"Все о главных спортивных событиях мира. Обзоры самых важных спортивных событий, аналитика, мнения экспертов.","categories":[],"season":null,"episode":null,"image":null,"start":1641850200,"stop":1641852000},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"The Situation Room with Wolf Blitzer","desc":"Командный центр новостей, политики и неординарных репортажей со всего мира.","categories":[],"season":null,"episode":null,"image":null,"start":1641852000,"stop":1641855600},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"Erin Burnett OutFront","desc":"Обсуждение самых важных мировых тем в эфире канала CNN.","categories":[],"season":null,"episode":null,"image":null,"start":1641855600,"stop":1641859200},{"channel":"CNNInternationalEurope.us","site":"chaines-tv.orange.fr","lang":"ru","title":"Anderson Cooper 360","desc":"Уникальный взгляд Андерсона Купера на главные события мира.","categories":[],"season":null,"episode":null,"image":null,"start":1641859200,"stop":1641862800},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Fatman","desc":null,"categories":[],"season":9,"episode":257,"image":null,"start":1641761700,"stop":1641767700},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Motherless Brooklyn","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641767700,"stop":1641776100},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"The Water Diviner","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641776100,"stop":1641782700},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Outbreak","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641782700,"stop":1641790200},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Paranoia","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641790200,"stop":1641796500},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Beyond The Line","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641796500,"stop":1641801300},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Backdraft","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641801300,"stop":1641809400},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Mafia","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641809400,"stop":1641814500},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"12 Strong","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641814500,"stop":1641822300},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Robin Hood","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641822300,"stop":1641829200},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"The Scorpion King","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641829200,"stop":1641834780},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"The Last Witch Hunter","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641834780,"stop":1641841200},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Force Of Nature","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641841200,"stop":1641847200},{"channel":"MNetMovies2.za","site":"dstv.com","lang":"en","title":"Bad Boys For Life","desc":null,"categories":[],"season":null,"episode":null,"image":null,"start":1641847200,"stop":1641850800}] \ No newline at end of file diff --git a/tests/commands/save-results.test.js b/tests/commands/save-results.test.js index 38cbb363..d9f8c76f 100644 --- a/tests/commands/save-results.test.js +++ b/tests/commands/save-results.test.js @@ -31,6 +31,7 @@ it('can save results', () => { 'icon', 'lang', 'season', + 'site', 'start', 'stop', 'title' From 93931a87edb3d1b99a557253e722b157d29928af Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sat, 22 Jan 2022 00:13:08 +0300 Subject: [PATCH 15/16] Update update-api.js --- scripts/commands/update-api.js | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/commands/update-api.js b/scripts/commands/update-api.js index 347c2500..41b5c5d9 100644 --- a/scripts/commands/update-api.js +++ b/scripts/commands/update-api.js @@ -71,7 +71,6 @@ async function loadPrograms() { } }) - logger.info('Sort programs...') programs = _.sortBy(programs, ['channel', 'site', 'start']) return programs From f7d94bc7a81fcef6eb09b1acec49147a76d30aa9 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sat, 22 Jan 2022 02:06:18 +0300 Subject: [PATCH 16/16] Update auto-update.yml --- .github/workflows/auto-update.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml index 79bcbf6d..4ca644b6 100644 --- a/.github/workflows/auto-update.yml +++ b/.github/workflows/auto-update.yml @@ -84,6 +84,10 @@ jobs: with: name: logs path: scripts/logs + - uses: actions/upload-artifact@v2 + with: + name: errors.log + path: scripts/logs/errors.log - uses: actions/upload-artifact@v2 with: name: channels.json @@ -119,13 +123,13 @@ jobs: [1]: https://github.com/iptv-org/epg/actions/runs/${{ github.run_id }} - uses: juliangruber/merge-pull-request-action@v1 - if: ${{ github.ref == 'refs/heads/master' }} + if: ${{ !env.ACT && github.ref == 'refs/heads/master' }} with: github-token: ${{ secrets.PAT }} number: ${{ steps.pull-request.outputs.pr_number }} method: squash - uses: JamesIves/github-pages-deploy-action@4.1.1 - if: ${{ github.ref == 'refs/heads/master' }} + if: ${{ !env.ACT && github.ref == 'refs/heads/master' }} with: branch: gh-pages folder: .gh-pages