From b1a0bcf4b9b6c07f328824744fb0381d8b148a80 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sat, 26 Feb 2022 23:21:44 +0300 Subject: [PATCH 01/49] Move scripts to subfolders --- .github/workflows/_check.yml | 6 +- .github/workflows/_load.yml | 8 +- .github/workflows/_update-api.yml | 2 +- package-lock.json | 74 +++++++++++++++++++ package.json | 14 +++- .../commands/{update-api.js => api/update.js} | 2 +- scripts/commands/{ => channels}/lint.js | 0 .../{parse-channels.js => channels/parse.js} | 0 scripts/commands/{ => channels}/validate.js | 0 .../{load-cluster.js => cluster/load.js} | 4 +- scripts/commands/create-matrix.js | 16 ---- .../{update-guides.js => guides/update.js} | 4 +- .../{save-results.js => programs/save.js} | 4 +- .../{create-queue.js => queue/create.js} | 2 +- .../{update-readme.js => readme/update.js} | 2 +- tests/__data__/database/queue.db | 0 .../expected/{readme.md => _readme.md} | 8 +- .../load}/cluster_1.log | 0 .../expected/logs/errors/ca/example.com.log | 1 - .../expected/logs/errors/ge/magticom.ge.log | 1 - .../expected/logs/errors/ru/yandex.ru.log | 1 - .../expected/logs/errors/us/directv.com.log | 1 - .../logs/{guides.log => guides/update.log} | 0 .../load}/cluster_1.log | 0 tests/__data__/input/logs/errors.log | 1 - .../logs/{guides.log => guides/update.log} | 0 .../input/{_readme.json => readme.json} | 0 .../update.test.js} | 16 ++-- tests/commands/cluster/load.test.js | 32 ++++++++ tests/commands/create-matrix.test.js | 25 ------- tests/commands/guides/update.test.js | 38 ++++++++++ tests/commands/load-cluster.test.js | 40 ---------- .../save.test.js} | 25 +++---- .../create.test.js} | 16 +--- .../update.test.js} | 16 ++-- tests/commands/update-guides.test.js | 67 ----------------- 36 files changed, 204 insertions(+), 222 deletions(-) rename scripts/commands/{update-api.js => api/update.js} (95%) rename scripts/commands/{ => channels}/lint.js (100%) rename scripts/commands/{parse-channels.js => channels/parse.js} (100%) rename scripts/commands/{ => channels}/validate.js (100%) rename scripts/commands/{load-cluster.js => cluster/load.js} (93%) delete mode 100644 scripts/commands/create-matrix.js rename scripts/commands/{update-guides.js => guides/update.js} (97%) rename scripts/commands/{save-results.js => programs/save.js} (90%) rename scripts/commands/{create-queue.js => queue/create.js} (98%) rename scripts/commands/{update-readme.js => readme/update.js} (99%) create mode 100644 tests/__data__/database/queue.db rename tests/__data__/expected/{readme.md => _readme.md} (85%) rename tests/__data__/expected/logs/{load-cluster => cluster/load}/cluster_1.log (100%) delete mode 100644 tests/__data__/expected/logs/errors/ca/example.com.log delete mode 100644 tests/__data__/expected/logs/errors/ge/magticom.ge.log delete mode 100644 tests/__data__/expected/logs/errors/ru/yandex.ru.log delete mode 100644 tests/__data__/expected/logs/errors/us/directv.com.log rename tests/__data__/expected/logs/{guides.log => guides/update.log} (100%) rename tests/__data__/input/logs/{load-cluster => cluster/load}/cluster_1.log (100%) delete mode 100644 tests/__data__/input/logs/errors.log rename tests/__data__/input/logs/{guides.log => guides/update.log} (100%) rename tests/__data__/input/{_readme.json => readme.json} (100%) rename tests/commands/{update-api.test.js => api/update.test.js} (52%) create mode 100644 tests/commands/cluster/load.test.js delete mode 100644 tests/commands/create-matrix.test.js create mode 100644 tests/commands/guides/update.test.js delete mode 100644 tests/commands/load-cluster.test.js rename tests/commands/{save-results.test.js => programs/save.test.js} (51%) rename tests/commands/{create-queue.test.js => queue/create.test.js} (69%) rename tests/commands/{update-readme.test.js => readme/update.test.js} (50%) delete mode 100644 tests/commands/update-guides.test.js diff --git a/.github/workflows/_check.yml b/.github/workflows/_check.yml index 341e0f8d..603bd294 100644 --- a/.github/workflows/_check.yml +++ b/.github/workflows/_check.yml @@ -8,12 +8,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Download channels from API + - name: Download data from API run: | mkdir -p scripts/data curl -L -o scripts/data/channels.json https://iptv-org.github.io/api/channels.json - id: files uses: jitterbit/get-changed-files@v1 - run: npm install - - run: npm run lint -- ${{ steps.files.outputs.added_modified }} - - run: npm run validate -- ${{ steps.files.outputs.added_modified }} + - run: npm run channels:lint -- ${{ steps.files.outputs.added_modified }} + - run: npm run channels:validate -- ${{ steps.files.outputs.added_modified }} diff --git a/.github/workflows/_load.yml b/.github/workflows/_load.yml index b1203259..14bae4d6 100644 --- a/.github/workflows/_load.yml +++ b/.github/workflows/_load.yml @@ -22,10 +22,10 @@ jobs: curl -L -o scripts/data/channels.json https://iptv-org.github.io/api/channels.json - uses: FedericoCarboni/setup-ffmpeg@v1 - run: npm install - - run: CHANNELS_PATH=sites/${{inputs.site}}/*.channels.xml node scripts/commands/create-queue.js --max-clusters=1 --days=2 - - run: NODE_OPTIONS=--insecure-http-parser node scripts/commands/load-cluster.js --timeout=30000 --cluster-id=1 - - run: node scripts/commands/save-results.js - - run: node scripts/commands/update-guides.js + - run: CHANNELS_PATH=sites/${{inputs.site}}/*.channels.xml npm run queue:create -- --max-clusters=1 --days=2 + - run: NODE_OPTIONS=--insecure-http-parser npm run cluster:load -- --timeout=30000 --cluster-id=1 + - run: npm run results:save + - run: npm run guides:update - uses: tibdex/github-app-token@v1 if: ${{ !env.ACT }} id: create-app-token diff --git a/.github/workflows/_update-api.yml b/.github/workflows/_update-api.yml index 38433931..369ed721 100644 --- a/.github/workflows/_update-api.yml +++ b/.github/workflows/_update-api.yml @@ -9,7 +9,7 @@ jobs: steps: - uses: actions/checkout@v2 - run: npm install - - run: node scripts/commands/update-api.js + - run: npm run api:update - uses: tibdex/github-app-token@v1 if: ${{ !env.ACT }} id: create-app-token diff --git a/package-lock.json b/package-lock.json index 3de27d75..74bb3b14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "epg-grabber": "^0.20.0", "epg-parser": "^0.1.6", "form-data": "^4.0.0", + "fs-extra": "^10.0.1", "glob": "^7.2.0", "iconv-lite": "^0.4.24", "jest": "^27.3.1", @@ -2377,6 +2378,27 @@ "node": ">= 6" } }, + "node_modules/fs-extra": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz", + "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fs-extra/node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/fs-minipass": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", @@ -3614,6 +3636,25 @@ "node": ">=6" } }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonfile/node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/keyv": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.4.tgz", @@ -7382,6 +7423,23 @@ "mime-types": "^2.1.12" } }, + "fs-extra": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz", + "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "dependencies": { + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" + } + } + }, "fs-minipass": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", @@ -8308,6 +8366,22 @@ "minimist": "^1.2.5" } }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + }, + "dependencies": { + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" + } + } + }, "keyv": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.4.tgz", diff --git a/package.json b/package.json index 856e4900..404bc68f 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,18 @@ { "name": "epg", "scripts": { - "lint": "node scripts/commands/lint.js", - "validate": "node scripts/commands/validate.js", + "channels:validate": "node scripts/commands/channels/validate.js", + "channels:lint": "node scripts/commands/channels/lint.js", + "queue:create": "node scripts/commands/queue/create.js", + "cluster:load": "node scripts/commands/cluster/load.js", + "programs:save": "node scripts/commands/programs/save.js", + "guides:update": "node scripts/commands/guides/update.js", + "api:update": "node scripts/commands/api/update.js", + "readme:update": "node scripts/commands/readme/update.js", "test": "npx jest --runInBand", "test:commands": "npx jest --runInBand -- commands", "test:sites": "npx jest --runInBand -- sites", - "act": "act workflow_dispatch", - "update-readme": "node scripts/commands/update-readme.js" + "act": "act workflow_dispatch" }, "private": true, "author": "Arhey", @@ -25,6 +30,7 @@ "epg-grabber": "^0.20.0", "epg-parser": "^0.1.6", "form-data": "^4.0.0", + "fs-extra": "^10.0.1", "glob": "^7.2.0", "iconv-lite": "^0.4.24", "jest": "^27.3.1", diff --git a/scripts/commands/update-api.js b/scripts/commands/api/update.js similarity index 95% rename from scripts/commands/update-api.js rename to scripts/commands/api/update.js index 67e454ec..9ac94b0a 100644 --- a/scripts/commands/update-api.js +++ b/scripts/commands/api/update.js @@ -1,4 +1,4 @@ -const { file, parser, logger } = require('../core') +const { file, parser, logger } = require('../../core') const { program } = require('commander') const _ = require('lodash') diff --git a/scripts/commands/lint.js b/scripts/commands/channels/lint.js similarity index 100% rename from scripts/commands/lint.js rename to scripts/commands/channels/lint.js diff --git a/scripts/commands/parse-channels.js b/scripts/commands/channels/parse.js similarity index 100% rename from scripts/commands/parse-channels.js rename to scripts/commands/channels/parse.js diff --git a/scripts/commands/validate.js b/scripts/commands/channels/validate.js similarity index 100% rename from scripts/commands/validate.js rename to scripts/commands/channels/validate.js diff --git a/scripts/commands/load-cluster.js b/scripts/commands/cluster/load.js similarity index 93% rename from scripts/commands/load-cluster.js rename to scripts/commands/cluster/load.js index ddfe5848..ce478689 100644 --- a/scripts/commands/load-cluster.js +++ b/scripts/commands/cluster/load.js @@ -1,7 +1,7 @@ const _ = require('lodash') const grabber = require('epg-grabber') const { program } = require('commander') -const { db, logger, timer, file, parser } = require('../core') +const { db, logger, timer, file, parser } = require('../../core') const options = program .requiredOption('-c, --cluster-id ', 'The ID of cluster to load', parser.parseNumber) @@ -16,7 +16,7 @@ const options = program .opts() const LOGS_DIR = process.env.LOGS_DIR || 'scripts/logs' -const CLUSTER_PATH = `${LOGS_DIR}/load-cluster/cluster_${options.clusterId}.log` +const CLUSTER_PATH = `${LOGS_DIR}/cluster/load/cluster_${options.clusterId}.log` async function main() { logger.info('Starting...') diff --git a/scripts/commands/create-matrix.js b/scripts/commands/create-matrix.js deleted file mode 100644 index 98780ada..00000000 --- a/scripts/commands/create-matrix.js +++ /dev/null @@ -1,16 +0,0 @@ -const { logger, db } = require('../core') - -async function main() { - await db.queue.load() - const docs = await db.queue.find({}).sort({ cluster_id: 1 }) - const cluster_id = docs.reduce((acc, curr) => { - if (!acc.includes(curr.cluster_id)) acc.push(curr.cluster_id) - return acc - }, []) - - const matrix = { cluster_id } - const output = `::set-output name=matrix::${JSON.stringify(matrix)}` - logger.info(output) -} - -main() diff --git a/scripts/commands/update-guides.js b/scripts/commands/guides/update.js similarity index 97% rename from scripts/commands/update-guides.js rename to scripts/commands/guides/update.js index 831548ab..d7af0924 100644 --- a/scripts/commands/update-guides.js +++ b/scripts/commands/guides/update.js @@ -1,10 +1,10 @@ -const { db, logger, file, api } = require('../core') +const { db, logger, file, api } = require('../../core') const grabber = require('epg-grabber') const _ = require('lodash') const LOGS_DIR = process.env.LOGS_DIR || 'scripts/logs' const PUBLIC_DIR = process.env.PUBLIC_DIR || '.gh-pages' -const GUIDES_PATH = `${LOGS_DIR}/guides.log` +const GUIDES_PATH = `${LOGS_DIR}/guides/update.log` async function main() { await setUp() diff --git a/scripts/commands/save-results.js b/scripts/commands/programs/save.js similarity index 90% rename from scripts/commands/save-results.js rename to scripts/commands/programs/save.js index 26a4bb55..f2ff7161 100644 --- a/scripts/commands/save-results.js +++ b/scripts/commands/programs/save.js @@ -1,4 +1,4 @@ -const { db, logger, file, parser } = require('../core') +const { db, logger, file, parser } = require('../../core') const _ = require('lodash') const LOGS_DIR = process.env.LOGS_DIR || 'scripts/logs' @@ -7,7 +7,7 @@ async function main() { await db.queue.load() await db.programs.load() await db.programs.reset() - const files = await file.list(`${LOGS_DIR}/load-cluster/cluster_*.log`) + const files = await file.list(`${LOGS_DIR}/cluster/load/cluster_*.log`) for (const filepath of files) { logger.info(`Parsing "${filepath}"...`) const results = await parser.parseLogs(filepath) diff --git a/scripts/commands/create-queue.js b/scripts/commands/queue/create.js similarity index 98% rename from scripts/commands/create-queue.js rename to scripts/commands/queue/create.js index e63d0778..262ff6eb 100644 --- a/scripts/commands/create-queue.js +++ b/scripts/commands/queue/create.js @@ -1,4 +1,4 @@ -const { db, file, parser, logger, date, api } = require('../core') +const { db, file, parser, logger, date, api } = require('../../core') const { program } = require('commander') const _ = require('lodash') diff --git a/scripts/commands/update-readme.js b/scripts/commands/readme/update.js similarity index 99% rename from scripts/commands/update-readme.js rename to scripts/commands/readme/update.js index e6ab084f..56735016 100644 --- a/scripts/commands/update-readme.js +++ b/scripts/commands/readme/update.js @@ -1,4 +1,4 @@ -const { file, markdown, parser, logger, api, table } = require('../core') +const { file, markdown, parser, logger, api, table } = require('../../core') const { program } = require('commander') const _ = require('lodash') diff --git a/tests/__data__/database/queue.db b/tests/__data__/database/queue.db new file mode 100644 index 00000000..e69de29b diff --git a/tests/__data__/expected/readme.md b/tests/__data__/expected/_readme.md similarity index 85% rename from tests/__data__/expected/readme.md rename to tests/__data__/expected/_readme.md index ad67cdb3..fac19160 100644 --- a/tests/__data__/expected/readme.md +++ b/tests/__data__/expected/_readme.md @@ -16,9 +16,13 @@ To load a program guide, all you need to do is copy the link to one or more of t -## EPG Codes +## API -๐Ÿ“‹  [iptv-org.github.io](https://iptv-org.github.io/) +The API documentation can be found in the [iptv-org/api](https://github.com/iptv-org/api) repository. + +## Resources + +Links to other useful IPTV-related resources can be found in the [iptv-org/awesome-iptv](https://github.com/iptv-org/awesome-iptv) repository. ## API diff --git a/tests/__data__/expected/logs/load-cluster/cluster_1.log b/tests/__data__/expected/logs/cluster/load/cluster_1.log similarity index 100% rename from tests/__data__/expected/logs/load-cluster/cluster_1.log rename to tests/__data__/expected/logs/cluster/load/cluster_1.log diff --git a/tests/__data__/expected/logs/errors/ca/example.com.log b/tests/__data__/expected/logs/errors/ca/example.com.log deleted file mode 100644 index eb0f2aac..00000000 --- a/tests/__data__/expected/logs/errors/ca/example.com.log +++ /dev/null @@ -1 +0,0 @@ -{"xmltv_id":"CNNInternationalEurope2.us","site":"example.com","site_id":"141","lang":"en","error":"The channel has the wrong xmltv_id"} diff --git a/tests/__data__/expected/logs/errors/ge/magticom.ge.log b/tests/__data__/expected/logs/errors/ge/magticom.ge.log deleted file mode 100644 index 4d8a3977..00000000 --- a/tests/__data__/expected/logs/errors/ge/magticom.ge.log +++ /dev/null @@ -1 +0,0 @@ -{"xmltv_id":"CNNInternationalEurope.us","site":"magticom.ge","site_id":"140","lang":"ru","date":"2022-01-21T00:00:00Z","error":"Programs not found"} diff --git a/tests/__data__/expected/logs/errors/ru/yandex.ru.log b/tests/__data__/expected/logs/errors/ru/yandex.ru.log deleted file mode 100644 index 4fd847ed..00000000 --- a/tests/__data__/expected/logs/errors/ru/yandex.ru.log +++ /dev/null @@ -1 +0,0 @@ -{"xmltv_id":"Perviykanal.ru","site":"yandex.ru","site_id":"1","lang":"ru","date":"2022-01-21T00:00:00Z","error":"Some error"} diff --git a/tests/__data__/expected/logs/errors/us/directv.com.log b/tests/__data__/expected/logs/errors/us/directv.com.log deleted file mode 100644 index 9fb73a9e..00000000 --- a/tests/__data__/expected/logs/errors/us/directv.com.log +++ /dev/null @@ -1 +0,0 @@ -{"xmltv_id":"BravoEast.us","site":"directv.com","site_id":"237","lang":"en","date":"2022-01-21T00:00:00Z","error":"Invalid header value char"} diff --git a/tests/__data__/expected/logs/guides.log b/tests/__data__/expected/logs/guides/update.log similarity index 100% rename from tests/__data__/expected/logs/guides.log rename to tests/__data__/expected/logs/guides/update.log diff --git a/tests/__data__/input/logs/load-cluster/cluster_1.log b/tests/__data__/input/logs/cluster/load/cluster_1.log similarity index 100% rename from tests/__data__/input/logs/load-cluster/cluster_1.log rename to tests/__data__/input/logs/cluster/load/cluster_1.log diff --git a/tests/__data__/input/logs/errors.log b/tests/__data__/input/logs/errors.log deleted file mode 100644 index 097e0e87..00000000 --- a/tests/__data__/input/logs/errors.log +++ /dev/null @@ -1 +0,0 @@ -{"lang":"en","xmltv_id":"BravoEast.us","site_id":"237","site":"directv.com","configPath":"sites/directv.com/directv.com.config.js","groups":["us/directv.com"],"cluster_id":84,"_id":"00AluKCrCnfgrl8W","date":"2022-01-21T00:00:00Z","error":"Invalid header value char"} diff --git a/tests/__data__/input/logs/guides.log b/tests/__data__/input/logs/guides/update.log similarity index 100% rename from tests/__data__/input/logs/guides.log rename to tests/__data__/input/logs/guides/update.log diff --git a/tests/__data__/input/_readme.json b/tests/__data__/input/readme.json similarity index 100% rename from tests/__data__/input/_readme.json rename to tests/__data__/input/readme.json diff --git a/tests/commands/update-api.test.js b/tests/commands/api/update.test.js similarity index 52% rename from tests/commands/update-api.test.js rename to tests/commands/api/update.test.js index db5eae3e..7c4d2355 100644 --- a/tests/commands/update-api.test.js +++ b/tests/commands/api/update.test.js @@ -1,22 +1,20 @@ -const fs = require('fs') -const path = require('path') const { execSync } = require('child_process') +const fs = require('fs-extra') +const path = require('path') beforeEach(() => { - fs.rmdirSync('tests/__data__/output', { recursive: true }) - fs.mkdirSync('tests/__data__/output') + fs.emptyDirSync('tests/__data__/output') const stdout = execSync( - 'CHANNELS_PATH=tests/__data__/input/sites/**.channels.xml OUTPUT_DIR=tests/__data__/output/api node scripts/commands/update-api.js', + 'CHANNELS_PATH=tests/__data__/input/sites/**.channels.xml OUTPUT_DIR=tests/__data__/output/api npm run api:update', { encoding: 'utf8' } ) }) it('can generate guides.json', () => { - const output = content('tests/__data__/output/api/guides.json') - const expected = content('tests/__data__/expected/api/guides.json') - - expect(output).toBe(expected) + expect(content('tests/__data__/output/api/guides.json')).toBe( + content('tests/__data__/expected/api/guides.json') + ) }) function content(filepath) { diff --git a/tests/commands/cluster/load.test.js b/tests/commands/cluster/load.test.js new file mode 100644 index 00000000..6b8af69a --- /dev/null +++ b/tests/commands/cluster/load.test.js @@ -0,0 +1,32 @@ +const { execSync } = require('child_process') +const fs = require('fs-extra') +const path = require('path') + +beforeEach(() => { + fs.emptyDirSync('tests/__data__/output') + fs.copyFileSync('tests/__data__/input/database/queue.db', 'tests/__data__/output/queue.db') + + execSync( + 'DB_DIR=tests/__data__/output LOGS_DIR=tests/__data__/output/logs npm run cluster:load -- --cluster-id=1 --timeout=10000', + { encoding: 'utf8' } + ) +}) + +it('can load cluster', () => { + expect(content('tests/__data__/output/logs/cluster/load/cluster_1.log')).toEqual( + content('tests/__data__/expected/logs/cluster/load/cluster_1.log') + ) +}) + +function content(filepath) { + const data = fs.readFileSync(path.resolve(filepath), { + encoding: 'utf8' + }) + + return data + .split('\n') + .filter(l => l) + .map(l => { + return JSON.parse(l) + }) +} diff --git a/tests/commands/create-matrix.test.js b/tests/commands/create-matrix.test.js deleted file mode 100644 index f06ae06d..00000000 --- a/tests/commands/create-matrix.test.js +++ /dev/null @@ -1,25 +0,0 @@ -const fs = require('fs') -const path = require('path') -const { execSync } = require('child_process') - -beforeEach(() => { - fs.rmdirSync('tests/__data__/output', { recursive: true }) - fs.mkdirSync('tests/__data__/output') - fs.mkdirSync('tests/__data__/temp/database', { recursive: true }) - fs.copyFileSync('tests/__data__/input/database/queue.db', 'tests/__data__/temp/database/queue.db') -}) - -afterEach(() => { - fs.rmdirSync('tests/__data__/temp', { recursive: true }) -}) - -it('can create valid matrix', () => { - const result = execSync( - 'DB_DIR=tests/__data__/temp/database node scripts/commands/create-matrix.js', - { - encoding: 'utf8' - } - ) - - expect(result).toBe('::set-output name=matrix::{"cluster_id":[1,4,84,120]}\n') -}) diff --git a/tests/commands/guides/update.test.js b/tests/commands/guides/update.test.js new file mode 100644 index 00000000..bf326424 --- /dev/null +++ b/tests/commands/guides/update.test.js @@ -0,0 +1,38 @@ +const { execSync } = require('child_process') +const fs = require('fs-extra') +const path = require('path') + +beforeEach(() => { + fs.emptyDirSync('tests/__data__/output') + fs.copyFileSync('tests/__data__/input/database/queue.db', 'tests/__data__/output/queue.db') + fs.copyFileSync('tests/__data__/input/database/programs.db', 'tests/__data__/output/programs.db') + + const stdout = execSync( + 'DB_DIR=tests/__data__/output DATA_DIR=tests/__data__/input/data PUBLIC_DIR=tests/__data__/output LOGS_DIR=tests/__data__/output/logs npm run guides:update', + { encoding: 'utf8' } + ) +}) + +it('can generate /guides', () => { + expect(content('tests/__data__/output/guides/fr/chaines-tv.orange.fr.epg.xml')).toBe( + content('tests/__data__/expected/guides/fr/chaines-tv.orange.fr.epg.xml') + ) + + expect(content('tests/__data__/output/guides/zw/dstv.com.epg.xml')).toBe( + content('tests/__data__/expected/guides/zw/dstv.com.epg.xml') + ) +}) + +it('can create guides.log', () => { + expect(content('tests/__data__/output/logs/guides/update.log')).toBe( + content('tests/__data__/expected/logs/guides/update.log') + ) +}) + +function content(filepath) { + const data = fs.readFileSync(path.resolve(filepath), { + encoding: 'utf8' + }) + + return JSON.stringify(data) +} diff --git a/tests/commands/load-cluster.test.js b/tests/commands/load-cluster.test.js deleted file mode 100644 index 41347eb2..00000000 --- a/tests/commands/load-cluster.test.js +++ /dev/null @@ -1,40 +0,0 @@ -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 }) - fs.mkdirSync('tests/__data__/output') - fs.mkdirSync('tests/__data__/temp/database', { recursive: true }) - fs.copyFileSync('tests/__data__/input/database/queue.db', 'tests/__data__/temp/database/queue.db') - - execSync( - 'DB_DIR=tests/__data__/temp/database LOGS_DIR=tests/__data__/output/logs node scripts/commands/load-cluster.js --cluster-id=1 --timeout=10000', - { encoding: 'utf8' } - ) -}) - -it('can load cluster', () => { - let output = content('tests/__data__/output/logs/load-cluster/cluster_1.log') - let expected = content('tests/__data__/expected/logs/load-cluster/cluster_1.log') - - expect(output).toEqual(expected) -}) - -function content(filepath) { - const data = fs.readFileSync(path.resolve(filepath), { - encoding: 'utf8' - }) - - return data - .split('\n') - .filter(l => l) - .map(l => { - return JSON.parse(l) - }) -} diff --git a/tests/commands/save-results.test.js b/tests/commands/programs/save.test.js similarity index 51% rename from tests/commands/save-results.test.js rename to tests/commands/programs/save.test.js index ff9a5db0..dad307c8 100644 --- a/tests/commands/save-results.test.js +++ b/tests/commands/programs/save.test.js @@ -1,25 +1,19 @@ -const fs = require('fs') -const path = require('path') const { execSync } = require('child_process') +const fs = require('fs-extra') +const path = require('path') beforeEach(() => { - fs.rmdirSync('tests/__data__/output', { recursive: true }) - fs.mkdirSync('tests/__data__/output') - fs.mkdirSync('tests/__data__/output/database', { recursive: true }) - - fs.copyFileSync( - 'tests/__data__/input/database/queue.db', - 'tests/__data__/output/database/queue.db' - ) + fs.emptyDirSync('tests/__data__/output') + fs.copyFileSync('tests/__data__/input/database/queue.db', 'tests/__data__/output/queue.db') const stdout = execSync( - 'DB_DIR=tests/__data__/output/database LOGS_DIR=tests/__data__/input/logs node scripts/commands/save-results.js', + 'DB_DIR=tests/__data__/output LOGS_DIR=tests/__data__/input/logs npm run programs:save', { encoding: 'utf8' } ) }) it('can save programs to database', () => { - let output = content('tests/__data__/output/database/programs.db') + let output = content('tests/__data__/output/programs.db') let expected = content('tests/__data__/expected/database/programs.db') output = output.map(i => { @@ -35,10 +29,9 @@ it('can save programs to database', () => { }) it('can update queue', () => { - const output = content('tests/__data__/output/database/queue.db') - const expected = content('tests/__data__/expected/database/queue-with-errors.db') - - expect(output).toEqual(expected) + expect(content('tests/__data__/output/queue.db')).toEqual( + content('tests/__data__/expected/database/queue-with-errors.db') + ) }) function content(filepath) { diff --git a/tests/commands/create-queue.test.js b/tests/commands/queue/create.test.js similarity index 69% rename from tests/commands/create-queue.test.js rename to tests/commands/queue/create.test.js index 80ed0508..32eb8d0d 100644 --- a/tests/commands/create-queue.test.js +++ b/tests/commands/queue/create.test.js @@ -1,13 +1,12 @@ -const fs = require('fs') -const path = require('path') const { execSync } = require('child_process') +const fs = require('fs-extra') +const path = require('path') beforeEach(() => { - fs.rmdirSync('tests/__data__/output', { recursive: true }) - fs.mkdirSync('tests/__data__/output') + fs.emptyDirSync('tests/__data__/output') const stdout = execSync( - 'DB_DIR=tests/__data__/output/database LOGS_DIR=tests/__data__/output/logs CHANNELS_PATH=tests/__data__/input/sites/*.channels.xml node scripts/commands/create-queue.js --max-clusters=1 --days=2', + 'DB_DIR=tests/__data__/output/database LOGS_DIR=tests/__data__/output/logs CHANNELS_PATH=tests/__data__/input/sites/*.channels.xml npm run queue:create -- --max-clusters=1 --days=2', { encoding: 'utf8' } ) }) @@ -35,13 +34,6 @@ it('can create queue', () => { ) }) -it('can log errors', () => { - let output = content('tests/__data__/output/logs/errors/ca/example.com.log') - let expected = content('tests/__data__/expected/logs/errors/ca/example.com.log') - - expect(output).toEqual(expected) -}) - function content(filepath) { const data = fs.readFileSync(path.resolve(filepath), { encoding: 'utf8' diff --git a/tests/commands/update-readme.test.js b/tests/commands/readme/update.test.js similarity index 50% rename from tests/commands/update-readme.test.js rename to tests/commands/readme/update.test.js index 108517c5..0faf804b 100644 --- a/tests/commands/update-readme.test.js +++ b/tests/commands/readme/update.test.js @@ -1,22 +1,20 @@ -const fs = require('fs') -const path = require('path') const { execSync } = require('child_process') +const fs = require('fs-extra') +const path = require('path') beforeEach(() => { - fs.rmdirSync('tests/__data__/output', { recursive: true }) - fs.mkdirSync('tests/__data__/output') + fs.emptyDirSync('tests/__data__/output') const stdout = execSync( - 'CHANNELS_PATH=tests/__data__/input/sites/*.channels.xml DATA_DIR=tests/__data__/input/data node scripts/commands/update-readme.js --config=tests/__data__/input/_readme.json', + 'CHANNELS_PATH=tests/__data__/input/sites/*.channels.xml DATA_DIR=tests/__data__/input/data npm run readme:update -- --config=tests/__data__/input/readme.json', { encoding: 'utf8' } ) }) it('can update readme.md', () => { - const output = content('tests/__data__/output/readme.md') - const expected = content('tests/__data__/expected/readme.md') - - expect(output).toBe(expected) + expect(content('tests/__data__/output/readme.md')).toBe( + content('tests/__data__/expected/_readme.md') + ) }) function content(filepath) { diff --git a/tests/commands/update-guides.test.js b/tests/commands/update-guides.test.js deleted file mode 100644 index 6d65f631..00000000 --- a/tests/commands/update-guides.test.js +++ /dev/null @@ -1,67 +0,0 @@ -const fs = require('fs') -const path = require('path') -const { execSync } = require('child_process') - -beforeEach(() => { - fs.rmdirSync('tests/__data__/output', { recursive: true }) - fs.mkdirSync('tests/__data__/output') - fs.mkdirSync('tests/__data__/temp/database', { recursive: true }) - fs.copyFileSync('tests/__data__/input/database/queue.db', 'tests/__data__/temp/database/queue.db') - fs.copyFileSync( - 'tests/__data__/input/database/programs.db', - 'tests/__data__/temp/database/programs.db' - ) - - const stdout = execSync( - 'DB_DIR=tests/__data__/temp/database DATA_DIR=tests/__data__/input/data PUBLIC_DIR=tests/__data__/output LOGS_DIR=tests/__data__/output/logs node scripts/commands/update-guides.js', - { encoding: 'utf8' } - ) -}) - -afterEach(() => { - fs.rmdirSync('tests/__data__/temp', { recursive: true }) -}) - -it('can generate /guides', () => { - 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/zw/dstv.com.epg.xml') - const expected2 = content('tests/__data__/expected/guides/zw/dstv.com.epg.xml') - - expect(output2).toBe(expected2) -}) - -it('can create guides.log', () => { - const output = content('tests/__data__/output/logs/guides.log') - const expected = content('tests/__data__/expected/logs/guides.log') - - expect(output).toBe(expected) -}) - -it('can log errors', () => { - const output1 = content('tests/__data__/output/logs/errors/ru/yandex.ru.log') - const expected1 = content('tests/__data__/expected/logs/errors/ru/yandex.ru.log') - - expect(output1).toBe(expected1) - - const output2 = content('tests/__data__/output/logs/errors/us/directv.com.log') - const expected2 = content('tests/__data__/expected/logs/errors/us/directv.com.log') - - expect(output2).toBe(expected2) - - const output3 = content('tests/__data__/output/logs/errors/ge/magticom.ge.log') - const expected3 = content('tests/__data__/expected/logs/errors/ge/magticom.ge.log') - - expect(output3).toBe(expected3) -}) - -function content(filepath) { - const data = fs.readFileSync(path.resolve(filepath), { - encoding: 'utf8' - }) - - return JSON.stringify(data) -} From 79bd19e78f85ef8bbdd91e9fae822891844e90c8 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 09:18:48 +0300 Subject: [PATCH 02/49] Update lint.js --- scripts/commands/channels/lint.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/commands/channels/lint.js b/scripts/commands/channels/lint.js index a970bb8c..c14453a9 100644 --- a/scripts/commands/channels/lint.js +++ b/scripts/commands/channels/lint.js @@ -1,7 +1,7 @@ const chalk = require('chalk') const libxml = require('libxmljs') const { program } = require('commander') -const { logger, file } = require('../core') +const { logger, file } = require('../../core') const xsd = ` From eb182362c3cddb3923005f2c00268158987d9b67 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 09:18:51 +0300 Subject: [PATCH 03/49] Update parse.js --- scripts/commands/channels/parse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/commands/channels/parse.js b/scripts/commands/channels/parse.js index 7cb6ec93..fdec2a61 100644 --- a/scripts/commands/channels/parse.js +++ b/scripts/commands/channels/parse.js @@ -1,5 +1,5 @@ +const { db, logger } = require('../../core') const { Command } = require('commander') -const { db, logger } = require('../core') const path = require('path') const _ = require('lodash') const fs = require('fs') From 260a104d66635074183f2ea6d351c3d4bcc36978 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 09:18:53 +0300 Subject: [PATCH 04/49] Update validate.js --- scripts/commands/channels/validate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/commands/channels/validate.js b/scripts/commands/channels/validate.js index 7ebdcce6..f841b598 100644 --- a/scripts/commands/channels/validate.js +++ b/scripts/commands/channels/validate.js @@ -1,4 +1,4 @@ -const { parser, logger, api } = require('../core') +const { parser, logger, api } = require('../../core') const { program } = require('commander') const chalk = require('chalk') From f25316ade050488ba24bfeae0d9acaed07d42f4f Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 14:38:04 +0300 Subject: [PATCH 05/49] Create _update-readme.yml --- .github/workflows/_update-readme.yml | 52 ++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/_update-readme.yml diff --git a/.github/workflows/_update-readme.yml b/.github/workflows/_update-readme.yml new file mode 100644 index 00000000..24a688da --- /dev/null +++ b/.github/workflows/_update-readme.yml @@ -0,0 +1,52 @@ +name: _update-readme +on: + workflow_dispatch: + schedule: + - cron: '0 12 * * *' +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: echo "::set-output name=branch_name::$(date +'bot/auto-update-%s')" + id: create-branch-name + - run: git config user.name 'iptv-bot[bot]' + - run: git config user.email '84861620+iptv-bot[bot]@users.noreply.github.com' + - run: git checkout -b ${{ steps.create-branch-name.outputs.branch_name }} + - name: Download data from API + run: | + mkdir -p scripts/data + curl -L -o scripts/data/countries.json https://iptv-org.github.io/api/countries.json + - run: npm install + - run: npm run readme:update + - name: Commit Changes + if: ${{ !env.ACT }} + run: | + git add README.md + git commit -m "[Bot] Update README.md" + git status + git push -u origin ${{ steps.create-branch-name.outputs.branch_name }} + - uses: tibdex/github-app-token@v1 + if: ${{ !env.ACT }} + id: create-app-token + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + - uses: repo-sync/pull-request@v2 + if: ${{ !env.ACT && github.ref == 'refs/heads/master' }} + id: pull-request + with: + github_token: ${{ steps.create-app-token.outputs.token }} + source_branch: ${{ steps.create-branch-name.outputs.branch_name }} + destination_branch: 'master' + pr_title: '[Bot] Daily update' + pr_body: | + This pull request is created via [update-readme][1] workflow. + + [1]: https://github.com/iptv-org/epg/actions/runs/${{ github.run_id }} + - uses: juliangruber/merge-pull-request-action@v1 + if: ${{ !env.ACT && github.ref == 'refs/heads/master' }} + with: + github-token: ${{ secrets.PAT }} + number: ${{ steps.pull-request.outputs.pr_number }} + method: squash From 32361febdb3dd8122ff7093cc8b65b9b96af2a63 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 14:38:06 +0300 Subject: [PATCH 06/49] Update template.md --- .readme/template.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.readme/template.md b/.readme/template.md index 1a98da9b..9dc85d98 100644 --- a/.readme/template.md +++ b/.readme/template.md @@ -17,10 +17,6 @@ The API documentation can be found in the [iptv-org/api](https://github.com/iptv Links to other useful IPTV-related resources can be found in the [iptv-org/awesome-iptv](https://github.com/iptv-org/awesome-iptv) repository. -## API - -The API documentation can be found in the [iptv-org/api](https://github.com/iptv-org/api) repository. - ## Contribution If you find a bug or want to contribute to the code or documentation, you can help by submitting an [issue](https://github.com/iptv-org/epg/issues) or a [pull request](https://github.com/iptv-org/epg/pulls). From dc6eca1c790e2a563e499f0fab3040e41ad9f254 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 14:38:10 +0300 Subject: [PATCH 07/49] Update _readme.md --- tests/__data__/expected/_readme.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/__data__/expected/_readme.md b/tests/__data__/expected/_readme.md index fac19160..4d640621 100644 --- a/tests/__data__/expected/_readme.md +++ b/tests/__data__/expected/_readme.md @@ -24,10 +24,6 @@ The API documentation can be found in the [iptv-org/api](https://github.com/iptv Links to other useful IPTV-related resources can be found in the [iptv-org/awesome-iptv](https://github.com/iptv-org/awesome-iptv) repository. -## API - -The API documentation can be found in the [iptv-org/api](https://github.com/iptv-org/api) repository. - ## Contribution If you find a bug or want to contribute to the code or documentation, you can help by submitting an [issue](https://github.com/iptv-org/epg/issues) or a [pull request](https://github.com/iptv-org/epg/pulls). From d5147e341eb33be86f5f7517b8e1855dc35c1ed0 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 15:46:50 +0300 Subject: [PATCH 08/49] Update package.json --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 404bc68f..475489f8 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,9 @@ "test": "npx jest --runInBand", "test:commands": "npx jest --runInBand -- commands", "test:sites": "npx jest --runInBand -- sites", - "act": "act workflow_dispatch" + "act:check": "act workflow_dispatch -W .github/workflows/_check.yml", + "act:update-readme": "act workflow_dispatch -W .github/workflows/_update-readme.yml", + "act:update-api": "act workflow_dispatch -W .github/workflows/_update-api.yml" }, "private": true, "author": "Arhey", From 7303fc9eca874368fd13c46029c676c3c077e9ac Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 16:26:32 +0300 Subject: [PATCH 09/49] Update _check.yml --- .github/workflows/_check.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/_check.yml b/.github/workflows/_check.yml index 603bd294..18790621 100644 --- a/.github/workflows/_check.yml +++ b/.github/workflows/_check.yml @@ -8,12 +8,24 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Download data from API + with: + fetch-depth: 2 + - name: download data from api run: | mkdir -p scripts/data curl -L -o scripts/data/channels.json https://iptv-org.github.io/api/channels.json - - id: files - uses: jitterbit/get-changed-files@v1 - - run: npm install - - run: npm run channels:lint -- ${{ steps.files.outputs.added_modified }} - - run: npm run channels:validate -- ${{ steps.files.outputs.added_modified }} + - uses: actions/setup-node@v2 + if: ${{ !env.ACT && steps.files.outputs.any_changed == 'true' }} + with: + node-version: '14' + cache: 'npm' + - uses: tj-actions/changed-files@v12.2 + id: files + with: + files: 'sites' + - name: validate + if: steps.files.outputs.any_changed == 'true' + run: | + npm install + npm run channels:lint -- ${{ steps.files.outputs.added_modified }} + npm run channels:validate -- ${{ steps.files.outputs.added_modified }} From e557e29f7e501e3de6742600460161d7940c564a Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 16:57:43 +0300 Subject: [PATCH 10/49] Update package.json --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 475489f8..fc8d8ebb 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "scripts": { "channels:validate": "node scripts/commands/channels/validate.js", "channels:lint": "node scripts/commands/channels/lint.js", + "channels:parse": "node scripts/commands/channels/parse.js", "queue:create": "node scripts/commands/queue/create.js", "cluster:load": "node scripts/commands/cluster/load.js", "programs:save": "node scripts/commands/programs/save.js", From 6a89e53a1de58f7628562c47405127119d94657f Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 16:57:47 +0300 Subject: [PATCH 11/49] Update _check.yml --- .github/workflows/_check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_check.yml b/.github/workflows/_check.yml index 18790621..dd655863 100644 --- a/.github/workflows/_check.yml +++ b/.github/workflows/_check.yml @@ -27,5 +27,5 @@ jobs: if: steps.files.outputs.any_changed == 'true' run: | npm install - npm run channels:lint -- ${{ steps.files.outputs.added_modified }} - npm run channels:validate -- ${{ steps.files.outputs.added_modified }} + npm run channels:lint -- ${{ steps.files.outputs.all_changed_files }} + npm run channels:validate -- ${{ steps.files.outputs.all_changed_files }} From 0de4ee66d1028317ed9405bbf5fbfe6535a25ad3 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 17:43:08 +0300 Subject: [PATCH 12/49] Update create.js --- scripts/commands/queue/create.js | 90 +++++++++++++++++--------------- 1 file changed, 47 insertions(+), 43 deletions(-) diff --git a/scripts/commands/queue/create.js b/scripts/commands/queue/create.js index 262ff6eb..bdba5f56 100644 --- a/scripts/commands/queue/create.js +++ b/scripts/commands/queue/create.js @@ -37,53 +37,57 @@ async function createQueue() { const utcDate = date.getUTC() const dates = Array.from({ length: options.days }, (_, i) => utcDate.add(i, 'd')) for (const filepath of files) { - const dir = file.dirname(filepath) - const { site, channels: items } = await parser.parseChannels(filepath) - if (!site) continue - const configPath = `${dir}/${site}.config.js` - const config = require(file.resolve(configPath)) - if (config.ignore) continue - const filename = file.basename(filepath) - const [__, region] = filename.match(/_([a-z-]+)\.channels\.xml/i) || [null, null] - const groupId = `${region}/${site}` - for (const item of items) { - if (!item.site || !item.site_id || !item.xmltv_id) continue - const channel = api.channels.find({ id: item.xmltv_id }) - if (!channel) { - await logError(groupId, { - xmltv_id: item.xmltv_id, - site: item.site, - site_id: item.site_id, - lang: item.lang, - date: undefined, - error: 'The channel has the wrong xmltv_id' - }) - continue - } + try { + const dir = file.dirname(filepath) + const { site, channels: items } = await parser.parseChannels(filepath) + if (!site) continue + const configPath = `${dir}/${site}.config.js` + const config = require(file.resolve(configPath)) + if (config.ignore) continue + const filename = file.basename(filepath) + const [__, region] = filename.match(/_([a-z-]+)\.channels\.xml/i) || [null, null] + const groupId = `${region}/${site}` + for (const item of items) { + if (!item.site || !item.site_id || !item.xmltv_id) continue + const channel = api.channels.find({ id: item.xmltv_id }) + if (!channel) { + await logError(groupId, { + xmltv_id: item.xmltv_id, + site: item.site, + site_id: item.site_id, + lang: item.lang, + date: undefined, + error: 'The channel has the wrong xmltv_id' + }) + continue + } - for (const d of dates) { - const dString = d.toJSON() - const key = `${item.site}:${item.lang}:${item.xmltv_id}:${dString}` - if (!queue[key]) { - queue[key] = { - channel: { - lang: item.lang, - xmltv_id: item.xmltv_id, - display_name: item.name, - site_id: item.site_id, - site: item.site - }, - date: dString, - configPath, - groups: [], - error: null + for (const d of dates) { + const dString = d.toJSON() + const key = `${item.site}:${item.lang}:${item.xmltv_id}:${dString}` + if (!queue[key]) { + queue[key] = { + channel: { + lang: item.lang, + xmltv_id: item.xmltv_id, + display_name: item.name, + site_id: item.site_id, + site: item.site + }, + date: dString, + configPath, + groups: [], + error: null + } + } + + if (!queue[key].groups.includes(groupId)) { + queue[key].groups.push(groupId) } } - - if (!queue[key].groups.includes(groupId)) { - queue[key].groups.push(groupId) - } } + } catch (err) { + console.error(err) } } From 4e792cbbcba91b9524b2534e12615bd7529511f0 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 18:04:17 +0300 Subject: [PATCH 13/49] Update update.js --- scripts/commands/api/update.js | 35 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/scripts/commands/api/update.js b/scripts/commands/api/update.js index 9ac94b0a..e83d219b 100644 --- a/scripts/commands/api/update.js +++ b/scripts/commands/api/update.js @@ -6,25 +6,30 @@ const CHANNELS_PATH = process.env.CHANNELS_PATH || 'sites/**/*.channels.xml' const OUTPUT_DIR = process.env.OUTPUT_DIR || '.gh-pages/api' async function main() { - const files = await file.list(CHANNELS_PATH) let guides = [] - for (const filepath of files) { - const { site, channels } = await parser.parseChannels(filepath) - const dir = file.dirname(filepath) - const config = require(file.resolve(`${dir}/${site}.config.js`)) - if (config.ignore) continue - const filename = file.basename(filepath) - const [__, suffix] = filename.match(/\_(.*)\.channels\.xml$/) || [null, null] + try { + const files = await file.list(CHANNELS_PATH) + for (const filepath of files) { + const { site, channels } = await parser.parseChannels(filepath) + const dir = file.dirname(filepath) + const config = require(file.resolve(`${dir}/${site}.config.js`)) + if (config.ignore) continue - for (const channel of channels) { - guides.push({ - channel: channel.xmltv_id, - site, - lang: channel.lang, - url: `https://iptv-org.github.io/epg/guides/${suffix}/${site}.epg.xml` - }) + const filename = file.basename(filepath) + const [__, suffix] = filename.match(/\_(.*)\.channels\.xml$/) || [null, null] + + for (const channel of channels) { + guides.push({ + channel: channel.xmltv_id, + site, + lang: channel.lang, + url: `https://iptv-org.github.io/epg/guides/${suffix}/${site}.epg.xml` + }) + } } + } catch (err) { + console.error(err) } guides = _.sortBy(guides, 'channel') From 84b83dd66153fc98a2e308cdc4df78350913a763 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 18:04:20 +0300 Subject: [PATCH 14/49] Update update.js --- scripts/commands/readme/update.js | 37 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/scripts/commands/readme/update.js b/scripts/commands/readme/update.js index 56735016..add0eb2d 100644 --- a/scripts/commands/readme/update.js +++ b/scripts/commands/readme/update.js @@ -10,25 +10,30 @@ const options = program .opts() async function main() { - await api.countries.load() - const files = await file.list(CHANNELS_PATH) const items = [] - for (const filepath of files) { - const { site, channels } = await parser.parseChannels(filepath) - const dir = file.dirname(filepath) - const config = require(file.resolve(`${dir}/${site}.config.js`)) - if (config.ignore) continue - const filename = file.basename(filepath) - const [__, suffix] = filename.match(/\_(.*)\.channels\.xml$/) || [null, null] - const [code] = suffix.split('-') + try { + await api.countries.load() + const files = await file.list(CHANNELS_PATH) + for (const filepath of files) { + const { site, channels } = await parser.parseChannels(filepath) + const dir = file.dirname(filepath) + const config = require(file.resolve(`${dir}/${site}.config.js`)) + if (config.ignore) continue - items.push({ - code, - site, - count: channels.length, - group: `${suffix}/${site}` - }) + const filename = file.basename(filepath) + const [__, suffix] = filename.match(/\_(.*)\.channels\.xml$/) || [null, null] + const [code] = suffix.split('-') + + items.push({ + code, + site, + count: channels.length, + group: `${suffix}/${site}` + }) + } + } catch (err) { + console.error(err) } await generateCountriesTable(items) From d867a3130423df35cde64fd643a0f0beb719e19a Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 18:04:27 +0300 Subject: [PATCH 15/49] Update update.test.js --- tests/commands/api/update.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/commands/api/update.test.js b/tests/commands/api/update.test.js index 7c4d2355..75cffd04 100644 --- a/tests/commands/api/update.test.js +++ b/tests/commands/api/update.test.js @@ -6,7 +6,7 @@ beforeEach(() => { fs.emptyDirSync('tests/__data__/output') const stdout = execSync( - 'CHANNELS_PATH=tests/__data__/input/sites/**.channels.xml OUTPUT_DIR=tests/__data__/output/api npm run api:update', + 'CHANNELS_PATH=tests/__data__/input/sites/example.com_ca.channels.xml OUTPUT_DIR=tests/__data__/output/api npm run api:update', { encoding: 'utf8' } ) }) From 8644c188fb9a886f4b71885597b45a32a071cec0 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 18:04:30 +0300 Subject: [PATCH 16/49] Update create.test.js --- tests/commands/queue/create.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/commands/queue/create.test.js b/tests/commands/queue/create.test.js index 32eb8d0d..52862108 100644 --- a/tests/commands/queue/create.test.js +++ b/tests/commands/queue/create.test.js @@ -6,7 +6,7 @@ beforeEach(() => { fs.emptyDirSync('tests/__data__/output') const stdout = execSync( - 'DB_DIR=tests/__data__/output/database LOGS_DIR=tests/__data__/output/logs CHANNELS_PATH=tests/__data__/input/sites/*.channels.xml npm run queue:create -- --max-clusters=1 --days=2', + 'DB_DIR=tests/__data__/output/database LOGS_DIR=tests/__data__/output/logs CHANNELS_PATH=tests/__data__/input/sites/example.com_ca.channels.xml npm run queue:create -- --max-clusters=1 --days=2', { encoding: 'utf8' } ) }) From 6552f1282a07a00c73ba3edd973643dbe90bb106 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 18:04:33 +0300 Subject: [PATCH 17/49] Update update.test.js --- tests/commands/readme/update.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/commands/readme/update.test.js b/tests/commands/readme/update.test.js index 0faf804b..f298e9f6 100644 --- a/tests/commands/readme/update.test.js +++ b/tests/commands/readme/update.test.js @@ -6,7 +6,7 @@ beforeEach(() => { fs.emptyDirSync('tests/__data__/output') const stdout = execSync( - 'CHANNELS_PATH=tests/__data__/input/sites/*.channels.xml DATA_DIR=tests/__data__/input/data npm run readme:update -- --config=tests/__data__/input/readme.json', + 'CHANNELS_PATH=tests/__data__/input/sites/example.com_ca.channels.xml DATA_DIR=tests/__data__/input/data npm run readme:update -- --config=tests/__data__/input/readme.json', { encoding: 'utf8' } ) }) From fda8020fae7d1791131ca43a2496c6443121d037 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 18:04:53 +0300 Subject: [PATCH 18/49] Create lint.channels.xml --- tests/__data__/input/sites/lint.channels.xml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/__data__/input/sites/lint.channels.xml diff --git a/tests/__data__/input/sites/lint.channels.xml b/tests/__data__/input/sites/lint.channels.xml new file mode 100644 index 00000000..b85e8b8d --- /dev/null +++ b/tests/__data__/input/sites/lint.channels.xml @@ -0,0 +1,6 @@ + + + + CNN International + + \ No newline at end of file From 6df18ad468af78dc14e8782cb004a826acacef77 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 27 Feb 2022 18:04:56 +0300 Subject: [PATCH 19/49] Create lint.test.js --- tests/commands/channels/lint.test.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/commands/channels/lint.test.js diff --git a/tests/commands/channels/lint.test.js b/tests/commands/channels/lint.test.js new file mode 100644 index 00000000..b35728d0 --- /dev/null +++ b/tests/commands/channels/lint.test.js @@ -0,0 +1,19 @@ +const { execSync } = require('child_process') + +fit('will show a message if the file contains a syntax error', () => { + try { + const stdout = execSync( + 'npm run channels:lint -- tests/__data__/input/sites/lint.channels.xml', + { + encoding: 'utf8' + } + ) + console.log(stdout) + process.exit(1) + } catch (err) { + expect(err.status).toBe(1) + expect(err.stdout).toBe( + `\n> channels:lint\n> node scripts/commands/channels/lint.js "tests/__data__/input/sites/lint.channels.xml"\n\n\ntests/__data__/input/sites/lint.channels.xml\n 4:0 Element 'channel': The attribute 'lang' is required but missing.\n\n1 error(s)\n` + ) + } +}) From ead1e444ec49c29eea81fddf8be2cc9a416cd417 Mon Sep 17 00:00:00 2001 From: RevGear <95308545+RevGear@users.noreply.github.com> Date: Sun, 27 Feb 2022 23:02:10 +0000 Subject: [PATCH 20/49] sky.de --- sites/sky.de/sky.de.config.js | 46 +++++++++++ sites/sky.de/sky.de.test.js | 55 +++++++++++++ sites/sky.de/sky.de_de.channels.xml | 123 ++++++++++++++++++++++++++++ 3 files changed, 224 insertions(+) create mode 100644 sites/sky.de/sky.de.config.js create mode 100644 sites/sky.de/sky.de.test.js create mode 100644 sites/sky.de/sky.de_de.channels.xml diff --git a/sites/sky.de/sky.de.config.js b/sites/sky.de/sky.de.config.js new file mode 100644 index 00000000..65c15cd2 --- /dev/null +++ b/sites/sky.de/sky.de.config.js @@ -0,0 +1,46 @@ +const dayjs = require('dayjs') + +module.exports = { + site: 'sky.de', + url: 'https://www.sky.de/sgtvg/service/getBroadcastsForGrid', + request: { + method: 'POST', + data: function ({ channel, date }) { + return { + cil: [channel.site_id], + d: date.valueOf() + } + } + }, + parser: function ({ content, channel }) { + const programs = [] + const items = parseItems(content, channel) + items.forEach(item => { + if (item.showId == -1) return + programs.push({ + title: item.et, + description: item.epit, + category: item.ec, + start: dayjs.valueOf(item.bsdt), + stop: dayjs.valueOf(item.bedt), + season: item.sn, + episode: item.en, + icon: item.pu ? `http://sky.de${item.pu}` : null + }) + }) + + return programs + } +} + + +function parseContent(content, channel) { + const json = JSON.parse(content) + if (!Array.isArray(json.cl)) return null + return json.cl.find(i => i.ci == channel.site_id) + } + +function parseItems(content, channel) { + const data = parseContent(content, channel) + return data && Array.isArray(data.el) ? data.el : [] + } \ No newline at end of file diff --git a/sites/sky.de/sky.de.test.js b/sites/sky.de/sky.de.test.js new file mode 100644 index 00000000..adb4cd60 --- /dev/null +++ b/sites/sky.de/sky.de.test.js @@ -0,0 +1,55 @@ +const { parser, url } = require('./sky.de.config.js') +const dayjs = require('dayjs') +const utc = require('dayjs/plugin/utc') +dayjs.extend(utc) + +const date = dayjs.utc('2022-02-28', 'YYYY-MM-DD').startOf('d') +const channel = { + site_id: '522', + xmltv_id: 'WarnerTVComedyDeutschlandHD.us' +} + +const content = `{"cl":[{"ci":522,"el":[{"ei":122309300,"bsdt":1645916700000,"bst":"00:05","bedt":1645918200000,"len":25,"et":"King of Queens","ec":"Comedyserie","cop":"USA","yop":2001,"fsk":"ab 0 Jahre","epit":"Der Experte","sn":"4","en":"11","pu":"/static/img/program_guide/1522936_s.jpg"},{"ei":122309301,"bsdt":1645918200000,"bst":"00:30","bedt":1645919700000,"len":25,"et":"King of Queens","ec":"Comedyserie","cop":"USA","yop":2001,"fsk":"ab 0 Jahre","epit":"Speedy Gonzales","sn":"4","en":"12","pu":"/static/img/program_guide/1522937_s.jpg"}]}]}` + + +it('can generate valid url', () => { + expect(url()).toBe('https://www.sky.de/sgtvg/service/getBroadcastsForGrid') +}) + +it('can parse response', () => { + const result = parser({ content, channel }).map(p => { + p.start = p.start.toJSON() + p.stop = p.stop.toJSON() + return p + }) + + expect(result).toMatchObject([ + { + title: 'King of Queens', + description: 'Der Experte', + category: 'Comedyserie', + start: '2022-02-26T23:05:00.000Z', + stop: '2022-02-26T23:30:00.000Z', + season: '4', + episode: '11', + icon: 'http://sky.de/static/img/program_guide/1522936_s.jpg' + }, + { + title: 'King of Queens', + description: 'Speedy Gonzales', + category: 'Comedyserie', + start: '2022-02-26T23:30:00.000Z', + stop: '2022-02-26T23:55:00.000Z', + season: '4', + episode: '12', + icon: 'http://sky.de/static/img/program_guide/1522937_s.jpg' + } + ]) +}) + +it('can handle empty guide', () => { + const result = parser({ + content: `[]` + }) + expect(result).toMatchObject([]) + }) diff --git a/sites/sky.de/sky.de_de.channels.xml b/sites/sky.de/sky.de_de.channels.xml new file mode 100644 index 00000000..0bfcfa8f --- /dev/null +++ b/sites/sky.de/sky.de_de.channels.xml @@ -0,0 +1,123 @@ + + + + 13th Street Deutschland + Beate Uhse TV + Boomerang Deutschland + Cartoon Network Deutschland + Classica HD + Crime + Investigation Deutschland + DAZN 1 Deutschland + DAZN 2 Deutschland + Discovery Channel Deutschland + E! Europe + Eurosport 1 Germany + Eurosport 2 Germany + Eurosport360 HD 1 + Eurosport360 HD 2 + Eurosport360 HD 3 + Eurosport360 HD 4 + Eurosport360 HD 5 + Eurosport360 HD 6 + Eurosport360 HD 7 + Eurosport360 HD 8 + Eurosport360 HD 9 + Heimatkanal + History Deutschland + Jukebox + Junior + Kinowelt TV + Motorvision TV + National Geographic Deutschland + National Geographic Wild Deutschland + Nick Jr Deutschland + Nicktoons Deutschland + Romance TV Deutschland + Sky Atlantic + Sky Cinema Action + Sky Cinema Action HD + Sky Cinema Best Of + Sky Cinema Best Of HD + Sky Cinema Classics + Sky Cinema Family + Sky Cinema Family HD + Sky Cinema Fun + Sky Cinema Premieren + Sky Cinema Premieren +24 + Sky Cinema Premieren +24 HD + Sky Cinema Premieren HD + Sky Cinema Special + Sky Cinema Thriller + Sky Comedy + Sky Crime + Sky Documentaries Deutschland + Sky Krimi HD + Sky Nature Deutschland + Sky One + Sky Replay Deutschland + Sky Sport 1 + Sky Sport 10 + Sky Sport 11 + Sky Sport 2 + Sky Sport 3 + Sky Sport 4 + Sky Sport 5 + Sky Sport 6 + Sky Sport 7 + Sky Sport 8 + Sky Sport 9 + Sky Sport 1 HD + Sky Sport 10 HD + Sky Sport 11 HD + Sky Sport 2 HD + Sky Sport 3 HD + Sky Sport 4 HD + Sky Sport 5 HD + Sky Sport 6 HD + Sky Sport 7 HD + Sky Sport 8 HD + Sky Sport 9 HD + Sky Sport Austria 1 + Sky Sport Austria 2 + Sky Sport Austria 3 + Sky Sport Austria 4 + Sky Sport Austria 5 + Sky Sport Austria 6 + Sky Sport Austria 7 + Sky Sport Bundesliga 1 + Sky Sport Bundesliga 1 HD + Sky Sport Bundesliga 10 + Sky Sport Bundesliga 10 HD + Sky Sport Bundesliga 2 + Sky Sport Bundesliga 2 HD + Sky Sport Bundesliga 3 + Sky Sport Bundesliga 3 HD + Sky Sport Bundesliga 4 + Sky Sport Bundesliga 4 HD + Sky Sport Bundesliga 5 + Sky Sport Bundesliga 5 HD + Sky Sport Bundesliga 6 + Sky Sport Bundesliga 6 HD + Sky Sport Bundesliga 7 + Sky Sport Bundesliga 7 HD + Sky Sport Bundesliga 8 + Sky Sport Bundesliga 8 HD + Sky Sport Bundesliga 9 + Sky Sport Bundesliga 9 HD + Sky Sport Bundesliga UHD + Sky Sport F1 + Sky Sport News + Sky Sport UHD + Spiegel Geschichte + Spiegel Geschichte HD + Spiegel TV Wissen + Sportdigital Fussball + Syfy Deutschland + Universal TV Deutschland + Warner TV Comedy Deutschland + Warner TV Comedy Deutschland HD + Warner TV Film Deutschland + Warner TV Film Deutschland HD + Warner TV Serie Deutschland + + \ No newline at end of file From 064eb66b970fa0a7d80b8237bd82765a936ff60d Mon Sep 17 00:00:00 2001 From: RevGear <95308545+RevGear@users.noreply.github.com> Date: Mon, 28 Feb 2022 08:22:56 +0000 Subject: [PATCH 21/49] Update sky.de.config.js --- sites/sky.de/sky.de.config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sites/sky.de/sky.de.config.js b/sites/sky.de/sky.de.config.js index 65c15cd2..3970a262 100644 --- a/sites/sky.de/sky.de.config.js +++ b/sites/sky.de/sky.de.config.js @@ -16,7 +16,6 @@ module.exports = { const programs = [] const items = parseItems(content, channel) items.forEach(item => { - if (item.showId == -1) return programs.push({ title: item.et, description: item.epit, @@ -43,4 +42,4 @@ function parseContent(content, channel) { function parseItems(content, channel) { const data = parseContent(content, channel) return data && Array.isArray(data.el) ? data.el : [] - } \ No newline at end of file + } From f8562cd7c2a5a6c8d862edd900aab3a2cb368d9e Mon Sep 17 00:00:00 2001 From: RevGear <95308545+RevGear@users.noreply.github.com> Date: Mon, 28 Feb 2022 08:23:25 +0000 Subject: [PATCH 22/49] Update sky.de.test.js --- sites/sky.de/sky.de.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sites/sky.de/sky.de.test.js b/sites/sky.de/sky.de.test.js index adb4cd60..c2f85fb0 100644 --- a/sites/sky.de/sky.de.test.js +++ b/sites/sky.de/sky.de.test.js @@ -13,7 +13,7 @@ const content = `{"cl":[{"ci":522,"el":[{"ei":122309300,"bsdt":1645916700000,"bs it('can generate valid url', () => { - expect(url()).toBe('https://www.sky.de/sgtvg/service/getBroadcastsForGrid') + expect(url).toBe('https://www.sky.de/sgtvg/service/getBroadcastsForGrid') }) it('can parse response', () => { From 1df9826c2c419e5c8dd0d0bdb746c309436b68e0 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 12:29:27 +0300 Subject: [PATCH 23/49] Update lint.test.js --- tests/commands/channels/lint.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/commands/channels/lint.test.js b/tests/commands/channels/lint.test.js index b35728d0..f504efd6 100644 --- a/tests/commands/channels/lint.test.js +++ b/tests/commands/channels/lint.test.js @@ -1,6 +1,6 @@ const { execSync } = require('child_process') -fit('will show a message if the file contains a syntax error', () => { +it('will show a message if the file contains a syntax error', () => { try { const stdout = execSync( 'npm run channels:lint -- tests/__data__/input/sites/lint.channels.xml', From dc568aee838306d427c3e47285ad7a2222e54a0b Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 12:30:38 +0300 Subject: [PATCH 24/49] Create channels/validate.test.js --- .../input/sites/duplicate.channels.xml | 7 +++ .../input/sites/wrong_xmltv_id.channels.xml | 6 +++ tests/commands/channels/validate.test.js | 49 +++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 tests/__data__/input/sites/duplicate.channels.xml create mode 100644 tests/__data__/input/sites/wrong_xmltv_id.channels.xml create mode 100644 tests/commands/channels/validate.test.js diff --git a/tests/__data__/input/sites/duplicate.channels.xml b/tests/__data__/input/sites/duplicate.channels.xml new file mode 100644 index 00000000..000cd700 --- /dev/null +++ b/tests/__data__/input/sites/duplicate.channels.xml @@ -0,0 +1,7 @@ + + + + CNN International + CNN International + + \ No newline at end of file diff --git a/tests/__data__/input/sites/wrong_xmltv_id.channels.xml b/tests/__data__/input/sites/wrong_xmltv_id.channels.xml new file mode 100644 index 00000000..638ab301 --- /dev/null +++ b/tests/__data__/input/sites/wrong_xmltv_id.channels.xml @@ -0,0 +1,6 @@ + + + + CNN International + + \ No newline at end of file diff --git a/tests/commands/channels/validate.test.js b/tests/commands/channels/validate.test.js new file mode 100644 index 00000000..0c7e6026 --- /dev/null +++ b/tests/commands/channels/validate.test.js @@ -0,0 +1,49 @@ +const { execSync } = require('child_process') + +it('will show a message if the file contains a duplicate', () => { + try { + const stdout = execSync( + 'npm run channels:validate -- tests/__data__/input/sites/duplicate.channels.xml', + { + encoding: 'utf8' + } + ) + console.log(stdout) + process.exit(1) + } catch (err) { + expect(err.status).toBe(1) + expect(err.stdout).toBe( + `\n> channels:validate\n> node scripts/commands/channels/validate.js "tests/__data__/input/sites/duplicate.channels.xml"\n\ntests/__data__/input/sites/duplicate.channels.xml +โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ (index) โ”‚ type โ”‚ lang โ”‚ xmltv_id โ”‚ site_id โ”‚ name โ”‚ +โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค +โ”‚ 0 โ”‚ 'duplicate' โ”‚ 'en' โ”‚ 'CNNInternationalEurope.us' โ”‚ '140' โ”‚ 'CNN International' โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ +\n1 error(s) in 1 file(s)\n` + ) + } +}) + +it('will show a message if the file contains a channel with wrong xmltv_id', () => { + try { + const stdout = execSync( + 'npm run channels:validate -- tests/__data__/input/sites/wrong_xmltv_id.channels.xml', + { + encoding: 'utf8' + } + ) + console.log(stdout) + process.exit(1) + } catch (err) { + expect(err.status).toBe(1) + expect(err.stdout).toBe( + `\n> channels:validate\n> node scripts/commands/channels/validate.js "tests/__data__/input/sites/wrong_xmltv_id.channels.xml"\n\ntests/__data__/input/sites/wrong_xmltv_id.channels.xml +โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ (index) โ”‚ type โ”‚ lang โ”‚ xmltv_id โ”‚ site_id โ”‚ name โ”‚ +โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค +โ”‚ 0 โ”‚ 'wrong_xmltv_id' โ”‚ 'en' โ”‚ 'CNNInternational' โ”‚ '140' โ”‚ 'CNN International' โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ +\n1 error(s) in 1 file(s)\n` + ) + } +}) From 3d8b199c13864ef341ab26d2fd00bc4e673ea730 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 13:31:53 +0300 Subject: [PATCH 25/49] Create xml.js --- scripts/core/xml.js | 49 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 scripts/core/xml.js diff --git a/scripts/core/xml.js b/scripts/core/xml.js new file mode 100644 index 00000000..5cd6c3f6 --- /dev/null +++ b/scripts/core/xml.js @@ -0,0 +1,49 @@ +const xml = {} + +xml.create = function (items, site) { + let output = `\r\n\r\n \r\n` + + items.forEach(channel => { + const logo = channel.logo ? ` logo="${channel.logo}"` : '' + const xmltv_id = channel.xmltv_id || '' + const lang = channel.lang || '' + const site_id = channel.site_id || '' + output += ` ${escapeString(channel.name)}\r\n` + }) + + output += ` \r\n\r\n` + + return output +} + +function escapeString(string, defaultValue = '') { + if (!string) return defaultValue + + const regex = new RegExp( + '((?:[\0-\x08\x0B\f\x0E-\x1F\uFFFD\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))|([\\x7F-\\x84]|[\\x86-\\x9F]|[\\uFDD0-\\uFDEF]|(?:\\uD83F[\\uDFFE\\uDFFF])|(?:\\uD87F[\\uDF' + + 'FE\\uDFFF])|(?:\\uD8BF[\\uDFFE\\uDFFF])|(?:\\uD8FF[\\uDFFE\\uDFFF])|(?:\\uD93F[\\uDFFE\\uD' + + 'FFF])|(?:\\uD97F[\\uDFFE\\uDFFF])|(?:\\uD9BF[\\uDFFE\\uDFFF])|(?:\\uD9FF[\\uDFFE\\uDFFF])' + + '|(?:\\uDA3F[\\uDFFE\\uDFFF])|(?:\\uDA7F[\\uDFFE\\uDFFF])|(?:\\uDABF[\\uDFFE\\uDFFF])|(?:\\' + + 'uDAFF[\\uDFFE\\uDFFF])|(?:\\uDB3F[\\uDFFE\\uDFFF])|(?:\\uDB7F[\\uDFFE\\uDFFF])|(?:\\uDBBF' + + '[\\uDFFE\\uDFFF])|(?:\\uDBFF[\\uDFFE\\uDFFF])(?:[\\0-\\t\\x0B\\f\\x0E-\\u2027\\u202A-\\uD7FF\\' + + 'uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|' + + '(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]))', + 'g' + ) + + string = String(string || '').replace(regex, '') + + return string + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, ''') + .replace(/\n|\r/g, ' ') + .replace(/ +/g, ' ') + .trim() +} + +module.exports = xml From 4cfbdaac3e951c0ba8d6e464c724f5f6f8a275b6 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 13:31:56 +0300 Subject: [PATCH 26/49] Update index.js --- scripts/core/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/core/index.js b/scripts/core/index.js index ccbdd057..807edaad 100644 --- a/scripts/core/index.js +++ b/scripts/core/index.js @@ -7,3 +7,4 @@ exports.markdown = require('./markdown') exports.api = require('./api') exports.date = require('./date') exports.table = require('./table') +exports.xml = require('./xml') From c86d32c98d274b965910f1c04cd5e13cc39cd790 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 13:32:26 +0300 Subject: [PATCH 27/49] Create channels/parse.test.js --- scripts/commands/channels/parse.js | 73 ++----------------- .../sites/parse-channels.channels.xml | 6 ++ .../input/sites/parse-channels.config.js | 19 +++++ tests/commands/channels/parse.test.js | 24 ++++++ 4 files changed, 55 insertions(+), 67 deletions(-) create mode 100644 tests/__data__/expected/sites/parse-channels.channels.xml create mode 100644 tests/__data__/input/sites/parse-channels.config.js create mode 100644 tests/commands/channels/parse.test.js diff --git a/scripts/commands/channels/parse.js b/scripts/commands/channels/parse.js index fdec2a61..11b76958 100644 --- a/scripts/commands/channels/parse.js +++ b/scripts/commands/channels/parse.js @@ -1,8 +1,7 @@ -const { db, logger } = require('../../core') +const { logger, file, xml } = require('../../core') const { Command } = require('commander') const path = require('path') const _ = require('lodash') -const fs = require('fs') const program = new Command() program @@ -14,37 +13,25 @@ program const options = program.opts() async function main() { - await db.channels.load() const config = require(path.resolve(options.config)) const args = {} options.set.forEach(arg => { const [key, value] = arg.split(':') args[key] = value }) + let channels = config.channels(args) if (isPromise(channels)) { channels = await channels } - channels = _.uniqBy(channels, 'site_id') - - const siteChannels = await db.channels.find({ site: config.site }) - for (const channel of channels) { - if (channel.xmltv_id) continue - const data = siteChannels.find(c => c.site_id === channel.site_id.toString()) - if (data) { - channel.xmltv_id = data.xmltv_id - channel.name = data.name - } - } - channels = _.sortBy(channels, 'xmltv_id') - const xml = json2xml(channels, config.site) + const dir = file.dirname(options.config) + const outputFilepath = options.output || `${dir}/${config.site}.channels.xml` - const dir = path.parse(options.config).dir - const output = options.output || `${dir}/${config.site}.channels.xml` + const output = xml.create(channels, config.site) - fs.writeFileSync(path.resolve(output), xml) + await file.write(outputFilepath, output) logger.info(`File '${output}' successfully saved`) } @@ -54,51 +41,3 @@ main() function isPromise(promise) { return !!promise && typeof promise.then === 'function' } - -function json2xml(items, site) { - let output = `\r\n\r\n \r\n` - - items.forEach(channel => { - const logo = channel.logo ? ` logo="${channel.logo}"` : '' - const xmltv_id = channel.xmltv_id || '' - const lang = channel.lang || '' - const site_id = channel.site_id || '' - output += ` ${escapeString(channel.name)}\r\n` - }) - - output += ` \r\n\r\n` - - return output -} - -function escapeString(string, defaultValue = '') { - if (!string) return defaultValue - - const regex = new RegExp( - '((?:[\0-\x08\x0B\f\x0E-\x1F\uFFFD\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))|([\\x7F-\\x84]|[\\x86-\\x9F]|[\\uFDD0-\\uFDEF]|(?:\\uD83F[\\uDFFE\\uDFFF])|(?:\\uD87F[\\uDF' + - 'FE\\uDFFF])|(?:\\uD8BF[\\uDFFE\\uDFFF])|(?:\\uD8FF[\\uDFFE\\uDFFF])|(?:\\uD93F[\\uDFFE\\uD' + - 'FFF])|(?:\\uD97F[\\uDFFE\\uDFFF])|(?:\\uD9BF[\\uDFFE\\uDFFF])|(?:\\uD9FF[\\uDFFE\\uDFFF])' + - '|(?:\\uDA3F[\\uDFFE\\uDFFF])|(?:\\uDA7F[\\uDFFE\\uDFFF])|(?:\\uDABF[\\uDFFE\\uDFFF])|(?:\\' + - 'uDAFF[\\uDFFE\\uDFFF])|(?:\\uDB3F[\\uDFFE\\uDFFF])|(?:\\uDB7F[\\uDFFE\\uDFFF])|(?:\\uDBBF' + - '[\\uDFFE\\uDFFF])|(?:\\uDBFF[\\uDFFE\\uDFFF])(?:[\\0-\\t\\x0B\\f\\x0E-\\u2027\\u202A-\\uD7FF\\' + - 'uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|' + - '(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]))', - 'g' - ) - - string = String(string || '').replace(regex, '') - - return string - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(/\n|\r/g, ' ') - .replace(/ +/g, ' ') - .trim() -} - -module.exports = { json2xml } diff --git a/tests/__data__/expected/sites/parse-channels.channels.xml b/tests/__data__/expected/sites/parse-channels.channels.xml new file mode 100644 index 00000000..82cbe2a7 --- /dev/null +++ b/tests/__data__/expected/sites/parse-channels.channels.xml @@ -0,0 +1,6 @@ + + + + CNN International + + diff --git a/tests/__data__/input/sites/parse-channels.config.js b/tests/__data__/input/sites/parse-channels.config.js new file mode 100644 index 00000000..9db10dc2 --- /dev/null +++ b/tests/__data__/input/sites/parse-channels.config.js @@ -0,0 +1,19 @@ +module.exports = { + site: 'parse-channels.com', + url() { + return `https://parse-channels.com` + }, + parser() { + return [] + }, + channels() { + return [ + { + lang: 'en', + xmltv_id: 'CNNInternational.us', + site_id: 140, + name: 'CNN International' + } + ] + } +} diff --git a/tests/commands/channels/parse.test.js b/tests/commands/channels/parse.test.js new file mode 100644 index 00000000..bc82251c --- /dev/null +++ b/tests/commands/channels/parse.test.js @@ -0,0 +1,24 @@ +const { execSync } = require('child_process') +const fs = require('fs-extra') +const path = require('path') + +beforeEach(() => { + fs.emptyDirSync('tests/__data__/output') + + const stdout = execSync( + 'npm run channels:parse -- --config=tests/__data__/input/sites/parse-channels.config.js --output=tests/__data__/output/channels.xml', + { encoding: 'utf8' } + ) +}) + +it('can parse channels', () => { + expect(content('tests/__data__/output/channels.xml')).toEqual( + content('tests/__data__/expected/sites/parse-channels.channels.xml') + ) +}) + +function content(filepath) { + return fs.readFileSync(path.resolve(filepath), { + encoding: 'utf8' + }) +} From 42bdeb5db8cfd305468d12d2033777d7aac6c3e9 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 14:53:35 +0300 Subject: [PATCH 28/49] Stop generate extra logs --- scripts/commands/guides/update.js | 87 +++------------------------- tests/commands/guides/update.test.js | 8 +-- 2 files changed, 8 insertions(+), 87 deletions(-) diff --git a/scripts/commands/guides/update.js b/scripts/commands/guides/update.js index d7af0924..d40a28aa 100644 --- a/scripts/commands/guides/update.js +++ b/scripts/commands/guides/update.js @@ -2,18 +2,9 @@ const { db, logger, file, api } = require('../../core') const grabber = require('epg-grabber') const _ = require('lodash') -const LOGS_DIR = process.env.LOGS_DIR || 'scripts/logs' const PUBLIC_DIR = process.env.PUBLIC_DIR || '.gh-pages' -const GUIDES_PATH = `${LOGS_DIR}/guides/update.log` async function main() { - await setUp() - await generateGuides() -} - -main() - -async function generateGuides() { logger.info(`Generating guides/...`) logger.info('Loading "database/programs.db"...') @@ -22,53 +13,17 @@ async function generateGuides() { const grouped = groupByGroup(await loadQueue()) for (const key in grouped) { - const filepath = `${PUBLIC_DIR}/guides/${key}.epg.xml` - const criticalErrors = [] let channels = {} let programs = [] for (const item of grouped[key]) { + if (item.error) continue + const itemPrograms = await loadProgramsForItem(item) programs = programs.concat(itemPrograms) if (channels[item.channel.xmltv_id]) continue - - if (item.error) { - const error = { - xmltv_id: item.channel.xmltv_id, - site: item.channel.site, - site_id: item.channel.site_id, - lang: item.channel.lang, - date: item.date, - error: item.error - } - criticalErrors.push(error) - await logError(key, error) - } else { - if (!itemPrograms.length) { - await logError(key, { - xmltv_id: item.channel.xmltv_id, - site: item.channel.site, - site_id: item.channel.site_id, - lang: item.channel.lang, - date: item.date, - error: 'Programs not found' - }) - continue - } - - const channel = api.channels.find({ id: item.channel.xmltv_id }) - if (!channel) { - await logError(key, { - xmltv_id: item.channel.xmltv_id, - site: item.channel.site, - site_id: item.channel.site_id, - lang: item.channel.lang, - date: item.date, - error: 'The channel has the wrong xmltv_id' - }) - continue - } - + const channel = api.channels.find({ id: item.channel.xmltv_id }) + if (channel) { channels[channel.id] = { xmltv_id: channel.id, name: item.channel.display_name, @@ -77,30 +32,21 @@ async function generateGuides() { } } } - channels = Object.values(channels) channels = _.sortBy(channels, 'xmltv_id') programs = _.sortBy(programs, ['channel', 'start']) + const filepath = `${PUBLIC_DIR}/guides/${key}.epg.xml` logger.info(`Creating "${filepath}"...`) const output = grabber.convertToXMLTV({ channels, programs }) await file.create(filepath, output) - - let status = 0 - if (criticalErrors.length > 0 || !channels.length) { - status = 1 - } - - await logGuide({ - group: key, - count: channels.length, - status - }) } logger.info(`Done`) } +main() + function groupByGroup(items = []) { const groups = {} @@ -128,22 +74,3 @@ async function loadQueue() { async function loadProgramsForItem(item) { return await db.programs.find({ _qid: item._id }).sort({ channel: 1, start: 1 }) } - -async function setUp() { - logger.info(`Creating '${GUIDES_PATH}'...`) - await file.create(GUIDES_PATH) - await file.createDir(`${LOGS_DIR}/errors`) -} - -async function logGuide(data) { - await file.append(GUIDES_PATH, JSON.stringify(data) + '\r\n') -} - -async function logError(key, data) { - const filepath = `${LOGS_DIR}/errors/${key}.log` - if (!(await file.exists(filepath))) { - await file.create(filepath) - } - - await file.append(filepath, JSON.stringify(data) + '\r\n') -} diff --git a/tests/commands/guides/update.test.js b/tests/commands/guides/update.test.js index bf326424..98c8455a 100644 --- a/tests/commands/guides/update.test.js +++ b/tests/commands/guides/update.test.js @@ -8,7 +8,7 @@ beforeEach(() => { fs.copyFileSync('tests/__data__/input/database/programs.db', 'tests/__data__/output/programs.db') const stdout = execSync( - 'DB_DIR=tests/__data__/output DATA_DIR=tests/__data__/input/data PUBLIC_DIR=tests/__data__/output LOGS_DIR=tests/__data__/output/logs npm run guides:update', + 'DB_DIR=tests/__data__/output DATA_DIR=tests/__data__/input/data PUBLIC_DIR=tests/__data__/output npm run guides:update', { encoding: 'utf8' } ) }) @@ -23,12 +23,6 @@ it('can generate /guides', () => { ) }) -it('can create guides.log', () => { - expect(content('tests/__data__/output/logs/guides/update.log')).toBe( - content('tests/__data__/expected/logs/guides/update.log') - ) -}) - function content(filepath) { const data = fs.readFileSync(path.resolve(filepath), { encoding: 'utf8' From 0b816fcfe4088e5ce104150c6c4f81096c9a9637 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 15:00:35 +0300 Subject: [PATCH 29/49] Update _load.yml --- .github/workflows/_load.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/_load.yml b/.github/workflows/_load.yml index 14bae4d6..977d81f6 100644 --- a/.github/workflows/_load.yml +++ b/.github/workflows/_load.yml @@ -14,7 +14,6 @@ jobs: load: runs-on: ubuntu-latest steps: - - run: echo running on branch ${GITHUB_REF##*/} - uses: actions/checkout@v2 - name: Download data from API run: | @@ -24,7 +23,7 @@ jobs: - run: npm install - run: CHANNELS_PATH=sites/${{inputs.site}}/*.channels.xml npm run queue:create -- --max-clusters=1 --days=2 - run: NODE_OPTIONS=--insecure-http-parser npm run cluster:load -- --timeout=30000 --cluster-id=1 - - run: npm run results:save + - run: npm run programs:save - run: npm run guides:update - uses: tibdex/github-app-token@v1 if: ${{ !env.ACT }} From da3cdc8f44a67cee11cb0b7acdf32d99e45e5f11 Mon Sep 17 00:00:00 2001 From: "iptv-bot[bot]" <84861620+iptv-bot[bot]@users.noreply.github.com> Date: Mon, 28 Feb 2022 21:34:05 +0300 Subject: [PATCH 30/49] [Bot] Update README.md (#553) Co-authored-by: iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com> --- README.md | 60 +++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 52223afb..60866fc4 100644 --- a/README.md +++ b/README.md @@ -38,15 +38,15 @@ To load a program guide, all you need to do is copy the link to one or more of t ๐Ÿ‡ง๐Ÿ‡ฆ Bosnia and Herzegovina178https://iptv-org.github.io/epg/guides/ba/mtel.ba.epg.xmlmtel.ba 4https://iptv-org.github.io/epg/guides/ba/tvarenasport.com.epg.xmltvarenasport.com ๐Ÿ‡ง๐Ÿ‡ผ Botswana130https://iptv-org.github.io/epg/guides/bw/dstv.com.epg.xmldstv.com - ๐Ÿ‡ง๐Ÿ‡ท Brazil248https://iptv-org.github.io/epg/guides/br/mi.tv.epg.xmlmi.tv - ๐Ÿ‡ง๐Ÿ‡ฌ Bulgaria105https://iptv-org.github.io/epg/guides/bg/tv.dir.bg.epg.xmltv.dir.bg + ๐Ÿ‡ง๐Ÿ‡ท Brazil251https://iptv-org.github.io/epg/guides/br/mi.tv.epg.xmlmi.tv + ๐Ÿ‡ง๐Ÿ‡ฌ Bulgaria103https://iptv-org.github.io/epg/guides/bg/tv.dir.bg.epg.xmltv.dir.bg ๐Ÿ‡ง๐Ÿ‡ซ Burkina Faso242https://iptv-org.github.io/epg/guides/bf/canalplus-afrique.com.epg.xmlcanalplus-afrique.com 128https://iptv-org.github.io/epg/guides/bf/dstv.com.epg.xmldstv.com ๐Ÿ‡ง๐Ÿ‡ฎ Burundi242https://iptv-org.github.io/epg/guides/bi/canalplus-afrique.com.epg.xmlcanalplus-afrique.com 128https://iptv-org.github.io/epg/guides/bi/dstv.com.epg.xmldstv.com ๐Ÿ‡จ๐Ÿ‡ฒ Cameroon242https://iptv-org.github.io/epg/guides/cm/canalplus-afrique.com.epg.xmlcanalplus-afrique.com 128https://iptv-org.github.io/epg/guides/cm/dstv.com.epg.xmldstv.com - ๐Ÿ‡จ๐Ÿ‡ฆ Canada62https://iptv-org.github.io/epg/guides/ca/tvtv.us.epg.xmltvtv.us + ๐Ÿ‡จ๐Ÿ‡ฆ Canada76https://iptv-org.github.io/epg/guides/ca/tvtv.us.epg.xmltvtv.us ๐Ÿ‡จ๐Ÿ‡ป Cape Verde242https://iptv-org.github.io/epg/guides/cv/canalplus-afrique.com.epg.xmlcanalplus-afrique.com 125https://iptv-org.github.io/epg/guides/cv/dstv.com.epg.xmldstv.com ๐Ÿ‡จ๐Ÿ‡ซ Central African Republic242https://iptv-org.github.io/epg/guides/cf/canalplus-afrique.com.epg.xmlcanalplus-afrique.com @@ -57,17 +57,17 @@ To load a program guide, all you need to do is copy the link to one or more of t 98https://iptv-org.github.io/epg/guides/td-en/osn.com.epg.xmlosn.com ๐Ÿ‡จ๐Ÿ‡ฑ Chile79https://iptv-org.github.io/epg/guides/cl/mi.tv.epg.xmlmi.tv 52https://iptv-org.github.io/epg/guides/cl/gatotv.com.epg.xmlgatotv.com - ๐Ÿ‡จ๐Ÿ‡ณ China98https://iptv-org.github.io/epg/guides/cn/tv.cctv.com.epg.xmltv.cctv.com + ๐Ÿ‡จ๐Ÿ‡ณ China97https://iptv-org.github.io/epg/guides/cn/tv.cctv.com.epg.xmltv.cctv.com ๐Ÿ‡จ๐Ÿ‡ด Colombia103https://iptv-org.github.io/epg/guides/co/siba.com.co.epg.xmlsiba.com.co 56https://iptv-org.github.io/epg/guides/co/gatotv.com.epg.xmlgatotv.com 42https://iptv-org.github.io/epg/guides/co/mi.tv.epg.xmlmi.tv ๐Ÿ‡ฐ๐Ÿ‡ฒ Comoros119https://iptv-org.github.io/epg/guides/km/canalplus-reunion.com.epg.xmlcanalplus-reunion.com ๐Ÿ‡จ๐Ÿ‡ท Costa Rica49https://iptv-org.github.io/epg/guides/cr/gatotv.com.epg.xmlgatotv.com - ๐Ÿ‡ญ๐Ÿ‡ท Croatia169https://iptv-org.github.io/epg/guides/hr/maxtv.hrvatskitelekom.hr.epg.xmlmaxtv.hrvatskitelekom.hr + ๐Ÿ‡ญ๐Ÿ‡ท Croatia168https://iptv-org.github.io/epg/guides/hr/maxtv.hrvatskitelekom.hr.epg.xmlmaxtv.hrvatskitelekom.hr 10https://iptv-org.github.io/epg/guides/hr/tvarenasport.hr.epg.xmltvarenasport.hr ๐Ÿ‡จ๐Ÿ‡บ Cuba10https://iptv-org.github.io/epg/guides/cu/tvcubana.icrt.cu.epg.xmltvcubana.icrt.cu ๐Ÿ‡จ๐Ÿ‡พ Cyprus30https://iptv-org.github.io/epg/guides/cy/novacyprus.com.epg.xmlnovacyprus.com - ๐Ÿ‡จ๐Ÿ‡ฟ Czech Republic512https://iptv-org.github.io/epg/guides/cz/m.tv.sms.cz.epg.xmlm.tv.sms.cz + ๐Ÿ‡จ๐Ÿ‡ฟ Czech Republic519https://iptv-org.github.io/epg/guides/cz/m.tv.sms.cz.epg.xmlm.tv.sms.cz ๐Ÿ‡จ๐Ÿ‡ฉ Democratic Republic of the Congo242https://iptv-org.github.io/epg/guides/cd/canalplus-afrique.com.epg.xmlcanalplus-afrique.com 126https://iptv-org.github.io/epg/guides/cd/dstv.com.epg.xmldstv.com ๐Ÿ‡ฉ๐Ÿ‡ฐ Denmark61https://iptv-org.github.io/epg/guides/dk/allente.se.epg.xmlallente.se @@ -75,8 +75,8 @@ To load a program guide, all you need to do is copy the link to one or more of t 121https://iptv-org.github.io/epg/guides/dj/dstv.com.epg.xmldstv.com ๐Ÿ‡ฉ๐Ÿ‡ด Dominican Republic60https://iptv-org.github.io/epg/guides/do/gatotv.com.epg.xmlgatotv.com ๐Ÿ‡ช๐Ÿ‡จ Ecuador45https://iptv-org.github.io/epg/guides/ec/gatotv.com.epg.xmlgatotv.com - ๐Ÿ‡ช๐Ÿ‡ฌ Egypt108https://iptv-org.github.io/epg/guides/eg-ar/elcinema.com.epg.xmlelcinema.com - 108https://iptv-org.github.io/epg/guides/eg-en/elcinema.com.epg.xmlelcinema.com + ๐Ÿ‡ช๐Ÿ‡ฌ Egypt106https://iptv-org.github.io/epg/guides/eg-ar/elcinema.com.epg.xmlelcinema.com + 106https://iptv-org.github.io/epg/guides/eg-en/elcinema.com.epg.xmlelcinema.com 99https://iptv-org.github.io/epg/guides/eg-ar/osn.com.epg.xmlosn.com 99https://iptv-org.github.io/epg/guides/eg-en/osn.com.epg.xmlosn.com ๐Ÿ‡ธ๐Ÿ‡ป El Salvador52https://iptv-org.github.io/epg/guides/sv/gatotv.com.epg.xmlgatotv.com @@ -100,7 +100,7 @@ To load a program guide, all you need to do is copy the link to one or more of t 125https://iptv-org.github.io/epg/guides/ga/dstv.com.epg.xmldstv.com ๐Ÿ‡ฌ๐Ÿ‡ฒ Gambia242https://iptv-org.github.io/epg/guides/gm/canalplus-afrique.com.epg.xmlcanalplus-afrique.com 124https://iptv-org.github.io/epg/guides/gm/dstv.com.epg.xmldstv.com - ๐Ÿ‡ฌ๐Ÿ‡ช Georgia117https://iptv-org.github.io/epg/guides/ge/magticom.ge.epg.xmlmagticom.ge + ๐Ÿ‡ฌ๐Ÿ‡ช Georgia116https://iptv-org.github.io/epg/guides/ge/magticom.ge.epg.xmlmagticom.ge ๐Ÿ‡ฉ๐Ÿ‡ช Germany122https://iptv-org.github.io/epg/guides/de/hd-plus.de.epg.xmlhd-plus.de ๐Ÿ‡ฌ๐Ÿ‡ญ Ghana242https://iptv-org.github.io/epg/guides/gh/canalplus-afrique.com.epg.xmlcanalplus-afrique.com 139https://iptv-org.github.io/epg/guides/gh/dstv.com.epg.xmldstv.com @@ -122,13 +122,13 @@ To load a program guide, all you need to do is copy the link to one or more of t ๐Ÿ‡ญ๐Ÿ‡บ Hungary91https://iptv-org.github.io/epg/guides/hu/tvmusor.hu.epg.xmltvmusor.hu ๐Ÿ‡ฎ๐Ÿ‡ธ Iceland2https://iptv-org.github.io/epg/guides/is/ruv.is.epg.xmlruv.is ๐Ÿ‡ฎ๐Ÿ‡ณ India364https://iptv-org.github.io/epg/guides/in/dishtv.in.epg.xmldishtv.in - ๐Ÿ‡ฎ๐Ÿ‡ฉ Indonesia90https://iptv-org.github.io/epg/guides/id/mncvision.id.epg.xmlmncvision.id - 29https://iptv-org.github.io/epg/guides/id/vidio.com.epg.xmlvidio.com + ๐Ÿ‡ฎ๐Ÿ‡ฉ Indonesia98https://iptv-org.github.io/epg/guides/id/mncvision.id.epg.xmlmncvision.id + 53https://iptv-org.github.io/epg/guides/id/vidio.com.epg.xmlvidio.com ๐Ÿ‡ฎ๐Ÿ‡ท Iran29https://iptv-org.github.io/epg/guides/ir/tva.tv.epg.xmltva.tv ๐Ÿ‡ฎ๐Ÿ‡ถ Iraq99https://iptv-org.github.io/epg/guides/iq-ar/osn.com.epg.xmlosn.com 99https://iptv-org.github.io/epg/guides/iq-en/osn.com.epg.xmlosn.com ๐Ÿ‡ฎ๐Ÿ‡ช Ireland3https://iptv-org.github.io/epg/guides/ie/ontvtonight.com.epg.xmlontvtonight.com - ๐Ÿ‡ฎ๐Ÿ‡น Italy145https://iptv-org.github.io/epg/guides/it/guidatv.sky.it.epg.xmlguidatv.sky.it + ๐Ÿ‡ฎ๐Ÿ‡น Italy142https://iptv-org.github.io/epg/guides/it/guidatv.sky.it.epg.xmlguidatv.sky.it 15https://iptv-org.github.io/epg/guides/it/mediaset.it.epg.xmlmediaset.it ๐Ÿ‡จ๐Ÿ‡ฎ Ivory Coast242https://iptv-org.github.io/epg/guides/ci/canalplus-afrique.com.epg.xmlcanalplus-afrique.com 128https://iptv-org.github.io/epg/guides/ci/dstv.com.epg.xmldstv.com @@ -143,13 +143,13 @@ To load a program guide, all you need to do is copy the link to one or more of t ๐Ÿ‡ฑ๐Ÿ‡ป Latvia21https://iptv-org.github.io/epg/guides/lv/tv.lv.epg.xmltv.lv ๐Ÿ‡ฑ๐Ÿ‡ง Lebanon99https://iptv-org.github.io/epg/guides/lb-ar/osn.com.epg.xmlosn.com 99https://iptv-org.github.io/epg/guides/lb-en/osn.com.epg.xmlosn.com - ๐Ÿ‡ฑ๐Ÿ‡ธ Lesotho146https://iptv-org.github.io/epg/guides/ls/dstv.com.epg.xmldstv.com + ๐Ÿ‡ฑ๐Ÿ‡ธ Lesotho145https://iptv-org.github.io/epg/guides/ls/dstv.com.epg.xmldstv.com ๐Ÿ‡ฑ๐Ÿ‡ท Liberia125https://iptv-org.github.io/epg/guides/lr/dstv.com.epg.xmldstv.com ๐Ÿ‡ฑ๐Ÿ‡พ Libya99https://iptv-org.github.io/epg/guides/ly-ar/osn.com.epg.xmlosn.com 99https://iptv-org.github.io/epg/guides/ly-en/osn.com.epg.xmlosn.com ๐Ÿ‡ฒ๐Ÿ‡ฌ Madagascar125https://iptv-org.github.io/epg/guides/mg/dstv.com.epg.xmldstv.com - ๐Ÿ‡ฒ๐Ÿ‡ผ Malawi132https://iptv-org.github.io/epg/guides/mw/dstv.com.epg.xmldstv.com - ๐Ÿ‡ฒ๐Ÿ‡พ Malaysia123https://iptv-org.github.io/epg/guides/my/astro.com.my.epg.xmlastro.com.my + ๐Ÿ‡ฒ๐Ÿ‡ผ Malawi131https://iptv-org.github.io/epg/guides/mw/dstv.com.epg.xmldstv.com + ๐Ÿ‡ฒ๐Ÿ‡พ Malaysia141https://iptv-org.github.io/epg/guides/my/astro.com.my.epg.xmlastro.com.my ๐Ÿ‡ฒ๐Ÿ‡ฑ Mali242https://iptv-org.github.io/epg/guides/ml/canalplus-afrique.com.epg.xmlcanalplus-afrique.com 125https://iptv-org.github.io/epg/guides/ml/dstv.com.epg.xmldstv.com ๐Ÿ‡ฒ๐Ÿ‡ถ Martinique128https://iptv-org.github.io/epg/guides/mq/canalplus-caraibes.com.epg.xmlcanalplus-caraibes.com @@ -170,7 +170,7 @@ To load a program guide, all you need to do is copy the link to one or more of t ๐Ÿ‡ณ๐Ÿ‡ฎ Nicaragua50https://iptv-org.github.io/epg/guides/ni/gatotv.com.epg.xmlgatotv.com ๐Ÿ‡ณ๐Ÿ‡ช Niger242https://iptv-org.github.io/epg/guides/ne/canalplus-afrique.com.epg.xmlcanalplus-afrique.com 128https://iptv-org.github.io/epg/guides/ne/dstv.com.epg.xmldstv.com - ๐Ÿ‡ณ๐Ÿ‡ฌ Nigeria147https://iptv-org.github.io/epg/guides/ng/dstv.com.epg.xmldstv.com + ๐Ÿ‡ณ๐Ÿ‡ฌ Nigeria146https://iptv-org.github.io/epg/guides/ng/dstv.com.epg.xmldstv.com ๐Ÿ‡ฒ๐Ÿ‡ฐ North Macedonia52https://iptv-org.github.io/epg/guides/mk/maxtvgo.mk.epg.xmlmaxtvgo.mk 4https://iptv-org.github.io/epg/guides/mk/tvarenasport.com.epg.xmltvarenasport.com ๐Ÿ‡ณ๐Ÿ‡ด Norway71https://iptv-org.github.io/epg/guides/no/allente.se.epg.xmlallente.se @@ -183,15 +183,15 @@ To load a program guide, all you need to do is copy the link to one or more of t ๐Ÿ‡ต๐Ÿ‡พ Paraguay39https://iptv-org.github.io/epg/guides/py/gatotv.com.epg.xmlgatotv.com ๐Ÿ‡ต๐Ÿ‡ช Peru48https://iptv-org.github.io/epg/guides/pe/gatotv.com.epg.xmlgatotv.com 21https://iptv-org.github.io/epg/guides/pe/mi.tv.epg.xmlmi.tv - ๐Ÿ‡ต๐Ÿ‡ฑ Poland341https://iptv-org.github.io/epg/guides/pl/programtv.onet.pl.epg.xmlprogramtv.onet.pl - ๐Ÿ‡ต๐Ÿ‡น Portugal110https://iptv-org.github.io/epg/guides/pt/meo.pt.epg.xmlmeo.pt + ๐Ÿ‡ต๐Ÿ‡ฑ Poland340https://iptv-org.github.io/epg/guides/pl/programtv.onet.pl.epg.xmlprogramtv.onet.pl + ๐Ÿ‡ต๐Ÿ‡น Portugal203https://iptv-org.github.io/epg/guides/pt/meo.pt.epg.xmlmeo.pt ๐Ÿ‡ถ๐Ÿ‡ฆ Qatar99https://iptv-org.github.io/epg/guides/qa-ar/osn.com.epg.xmlosn.com 99https://iptv-org.github.io/epg/guides/qa-en/osn.com.epg.xmlosn.com 22https://iptv-org.github.io/epg/guides/qa/beinsports.com.epg.xmlbeinsports.com ๐Ÿ‡จ๐Ÿ‡ฌ Republic of the Congo242https://iptv-org.github.io/epg/guides/cg/canalplus-afrique.com.epg.xmlcanalplus-afrique.com 125https://iptv-org.github.io/epg/guides/cg/dstv.com.epg.xmldstv.com ๐Ÿ‡ท๐Ÿ‡ด Romania224https://iptv-org.github.io/epg/guides/ro/programetv.ro.epg.xmlprogrametv.ro - ๐Ÿ‡ท๐Ÿ‡บ Russia285https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xmltv.yandex.ru + ๐Ÿ‡ท๐Ÿ‡บ Russia283https://iptv-org.github.io/epg/guides/ru/tv.yandex.ru.epg.xmltv.yandex.ru ๐Ÿ‡ท๐Ÿ‡ผ Rwanda242https://iptv-org.github.io/epg/guides/rw/canalplus-afrique.com.epg.xmlcanalplus-afrique.com 132https://iptv-org.github.io/epg/guides/rw/dstv.com.epg.xmldstv.com ๐Ÿ‡ท๐Ÿ‡ช Rรฉunion119https://iptv-org.github.io/epg/guides/re/canalplus-reunion.com.epg.xmlcanalplus-reunion.com @@ -208,13 +208,13 @@ To load a program guide, all you need to do is copy the link to one or more of t 125https://iptv-org.github.io/epg/guides/sl/dstv.com.epg.xmldstv.com ๐Ÿ‡ธ๐Ÿ‡ฎ Slovenia277https://iptv-org.github.io/epg/guides/si/tv2go.t-2.net.epg.xmltv2go.t-2.net ๐Ÿ‡ธ๐Ÿ‡ด Somalia120https://iptv-org.github.io/epg/guides/so/dstv.com.epg.xmldstv.com - ๐Ÿ‡ฟ๐Ÿ‡ฆ South Africa160https://iptv-org.github.io/epg/guides/za/dstv.com.epg.xmldstv.com + ๐Ÿ‡ฟ๐Ÿ‡ฆ South Africa159https://iptv-org.github.io/epg/guides/za/dstv.com.epg.xmldstv.com ๐Ÿ‡ธ๐Ÿ‡ธ South Sudan125https://iptv-org.github.io/epg/guides/ss/dstv.com.epg.xmldstv.com - ๐Ÿ‡ช๐Ÿ‡ธ Spain112https://iptv-org.github.io/epg/guides/es/programacion-tv.elpais.com.epg.xmlprogramacion-tv.elpais.com + ๐Ÿ‡ช๐Ÿ‡ธ Spain110https://iptv-org.github.io/epg/guides/es/programacion-tv.elpais.com.epg.xmlprogramacion-tv.elpais.com 58https://iptv-org.github.io/epg/guides/es/gatotv.com.epg.xmlgatotv.com ๐Ÿ‡ธ๐Ÿ‡ฉ Sudan118https://iptv-org.github.io/epg/guides/sd/dstv.com.epg.xmldstv.com ๐Ÿ‡ธ๐Ÿ‡ฟ Swaziland127https://iptv-org.github.io/epg/guides/sz/dstv.com.epg.xmldstv.com - ๐Ÿ‡ธ๐Ÿ‡ช Sweden89https://iptv-org.github.io/epg/guides/se/allente.se.epg.xmlallente.se + ๐Ÿ‡ธ๐Ÿ‡ช Sweden94https://iptv-org.github.io/epg/guides/se/allente.se.epg.xmlallente.se ๐Ÿ‡จ๐Ÿ‡ญ Switzerland598https://iptv-org.github.io/epg/guides/ch/tv.blue.ch.epg.xmltv.blue.ch ๐Ÿ‡ธ๐Ÿ‡น Sรฃo Tomรฉ and Prรญncipe128https://iptv-org.github.io/epg/guides/st/dstv.com.epg.xmldstv.com ๐Ÿ‡น๐Ÿ‡ฟ Tanzania30https://iptv-org.github.io/epg/guides/tz/dstv.com.epg.xmldstv.com @@ -222,15 +222,15 @@ To load a program guide, all you need to do is copy the link to one or more of t ๐Ÿ‡น๐Ÿ‡ฌ Togo242https://iptv-org.github.io/epg/guides/tg/canalplus-afrique.com.epg.xmlcanalplus-afrique.com 137https://iptv-org.github.io/epg/guides/tg/dstv.com.epg.xmldstv.com ๐Ÿ‡น๐Ÿ‡ท Turkey145https://iptv-org.github.io/epg/guides/tr/tvplus.com.tr.epg.xmltvplus.com.tr - 118https://iptv-org.github.io/epg/guides/tr/digiturk.com.tr.epg.xmldigiturk.com.tr - 105https://iptv-org.github.io/epg/guides/tr/dsmart.com.tr.epg.xmldsmart.com.tr + 117https://iptv-org.github.io/epg/guides/tr/digiturk.com.tr.epg.xmldigiturk.com.tr + 106https://iptv-org.github.io/epg/guides/tr/dsmart.com.tr.epg.xmldsmart.com.tr ๐Ÿ‡บ๐Ÿ‡ฌ Uganda151https://iptv-org.github.io/epg/guides/ug/dstv.com.epg.xmldstv.com ๐Ÿ‡บ๐Ÿ‡ฆ Ukraine114https://iptv-org.github.io/epg/guides/ua/tvgid.ua.epg.xmltvgid.ua ๐Ÿ‡ฆ๐Ÿ‡ช United Arab Emirates99https://iptv-org.github.io/epg/guides/ae-ar/osn.com.epg.xmlosn.com 99https://iptv-org.github.io/epg/guides/ae-en/osn.com.epg.xmlosn.com - ๐Ÿ‡ฌ๐Ÿ‡ง United Kingdom190https://iptv-org.github.io/epg/guides/uk/sky.com.epg.xmlsky.com + ๐Ÿ‡ฌ๐Ÿ‡ง United Kingdom258https://iptv-org.github.io/epg/guides/uk/sky.com.epg.xmlsky.com 97https://iptv-org.github.io/epg/guides/uk/ontvtonight.com.epg.xmlontvtonight.com - ๐Ÿ‡บ๐Ÿ‡ธ United States1298https://iptv-org.github.io/epg/guides/us/tvtv.us.epg.xmltvtv.us + ๐Ÿ‡บ๐Ÿ‡ธ United States1683https://iptv-org.github.io/epg/guides/us/tvtv.us.epg.xmltvtv.us 410https://iptv-org.github.io/epg/guides/us/directv.com.epg.xmldirectv.com 88https://iptv-org.github.io/epg/guides/us/tvguide.com.epg.xmltvguide.com 22https://iptv-org.github.io/epg/guides/us/gatotv.com.epg.xmlgatotv.com @@ -244,14 +244,14 @@ To load a program guide, all you need to do is copy the link to one or more of t -## EPG Codes - -๐Ÿ“‹  [iptv-org.github.io](https://iptv-org.github.io/) - ## API The API documentation can be found in the [iptv-org/api](https://github.com/iptv-org/api) repository. +## Resources + +Links to other useful IPTV-related resources can be found in the [iptv-org/awesome-iptv](https://github.com/iptv-org/awesome-iptv) repository. + ## Contribution If you find a bug or want to contribute to the code or documentation, you can help by submitting an [issue](https://github.com/iptv-org/epg/issues) or a [pull request](https://github.com/iptv-org/epg/pulls). From 19007781d75c7f0d56a23c2ba2392a495e5d6f67 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 21:40:01 +0300 Subject: [PATCH 31/49] Update _load.yml --- .github/workflows/_load.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/_load.yml b/.github/workflows/_load.yml index 977d81f6..17e58f35 100644 --- a/.github/workflows/_load.yml +++ b/.github/workflows/_load.yml @@ -20,6 +20,11 @@ jobs: mkdir -p scripts/data curl -L -o scripts/data/channels.json https://iptv-org.github.io/api/channels.json - uses: FedericoCarboni/setup-ffmpeg@v1 + - uses: actions/setup-node@v2 + if: ${{ !env.ACT }} + with: + node-version: '14' + cache: 'npm' - run: npm install - run: CHANNELS_PATH=sites/${{inputs.site}}/*.channels.xml npm run queue:create -- --max-clusters=1 --days=2 - run: NODE_OPTIONS=--insecure-http-parser npm run cluster:load -- --timeout=30000 --cluster-id=1 From 0f572210c1c5c3851a2285db24281f412aa5c910 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 21:40:12 +0300 Subject: [PATCH 32/49] Update _update-api.yml --- .github/workflows/_update-api.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_update-api.yml b/.github/workflows/_update-api.yml index 369ed721..2aed84f6 100644 --- a/.github/workflows/_update-api.yml +++ b/.github/workflows/_update-api.yml @@ -4,10 +4,15 @@ on: schedule: - cron: '0 12 * * *' jobs: - check: + update: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + if: ${{ !env.ACT }} + with: + node-version: '14' + cache: 'npm' - run: npm install - run: npm run api:update - uses: tibdex/github-app-token@v1 From bc793d070aedb4ea032ccb254245f930f3cc121b Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 21:40:16 +0300 Subject: [PATCH 33/49] Update _update-readme.yml --- .github/workflows/_update-readme.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_update-readme.yml b/.github/workflows/_update-readme.yml index 24a688da..1a1e1132 100644 --- a/.github/workflows/_update-readme.yml +++ b/.github/workflows/_update-readme.yml @@ -4,7 +4,7 @@ on: schedule: - cron: '0 12 * * *' jobs: - check: + update: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -17,6 +17,11 @@ jobs: run: | mkdir -p scripts/data curl -L -o scripts/data/countries.json https://iptv-org.github.io/api/countries.json + - uses: actions/setup-node@v2 + if: ${{ !env.ACT }} + with: + node-version: '14' + cache: 'npm' - run: npm install - run: npm run readme:update - name: Commit Changes From 1afeed402eb2d5308397b9206d4e9ec3d6b724a6 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 21:48:17 +0300 Subject: [PATCH 34/49] Remove extra package --- package-lock.json | 78 ++++---------------------------------------- package.json | 1 - scripts/core/file.js | 2 +- 3 files changed, 7 insertions(+), 74 deletions(-) diff --git a/package-lock.json b/package-lock.json index 74bb3b14..690e3bbb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,6 @@ "lodash": "^4.17.21", "markdown-include": "^0.4.3", "mockdate": "^3.0.5", - "mz": "^2.7.0", "nedb-promises": "^5.0.3", "parse-duration": "^1.0.0", "pdf-parse": "^1.1.1", @@ -1180,11 +1179,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" - }, "node_modules/anymatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", @@ -2347,9 +2341,9 @@ "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, "node_modules/follow-redirects": { - "version": "1.14.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz", - "integrity": "sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==", + "version": "1.14.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", + "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", "funding": [ { "type": "individual", @@ -3954,16 +3948,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "node_modules/mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dependencies": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, "node_modules/nan": { "version": "2.14.2", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", @@ -5107,25 +5091,6 @@ "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" }, - "node_modules/thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "dependencies": { - "any-promise": "^1.0.0" - } - }, - "node_modules/thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", - "dependencies": { - "thenify": ">= 3.1.0 < 4" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/throat": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/throat/-/throat-6.0.1.tgz", @@ -6501,11 +6466,6 @@ "color-convert": "^2.0.1" } }, - "any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" - }, "anymatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", @@ -7409,9 +7369,9 @@ "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, "follow-redirects": { - "version": "1.14.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz", - "integrity": "sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==" + "version": "1.14.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", + "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==" }, "form-data": { "version": "4.0.0", @@ -8624,16 +8584,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "requires": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, "nan": { "version": "2.14.2", "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", @@ -9496,22 +9446,6 @@ "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" }, - "thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "requires": { - "any-promise": "^1.0.0" - } - }, - "thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", - "requires": { - "thenify": ">= 3.1.0 < 4" - } - }, "throat": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/throat/-/throat-6.0.1.tgz", diff --git a/package.json b/package.json index fc8d8ebb..57ad993f 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,6 @@ "lodash": "^4.17.21", "markdown-include": "^0.4.3", "mockdate": "^3.0.5", - "mz": "^2.7.0", "nedb-promises": "^5.0.3", "parse-duration": "^1.0.0", "pdf-parse": "^1.1.1", diff --git a/scripts/core/file.js b/scripts/core/file.js index ecb4a040..d191cc84 100644 --- a/scripts/core/file.js +++ b/scripts/core/file.js @@ -1,6 +1,6 @@ const path = require('path') const glob = require('glob') -const fs = require('mz/fs') +const fs = require('fs-extra') const file = {} From b817951fef7429fd6d9bae3018c8252c193b81e2 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 21:56:51 +0300 Subject: [PATCH 35/49] Update _update-readme.yml --- .github/workflows/_update-readme.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/_update-readme.yml b/.github/workflows/_update-readme.yml index 1a1e1132..553749a1 100644 --- a/.github/workflows/_update-readme.yml +++ b/.github/workflows/_update-readme.yml @@ -8,6 +8,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 2 - run: echo "::set-output name=branch_name::$(date +'bot/auto-update-%s')" id: create-branch-name - run: git config user.name 'iptv-bot[bot]' From 50072a3b44dc3ce9b2ba5be275ef2384d47a42af Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 21:56:54 +0300 Subject: [PATCH 36/49] Update _update-api.yml --- .github/workflows/_update-api.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/_update-api.yml b/.github/workflows/_update-api.yml index 2aed84f6..88a2e84e 100644 --- a/.github/workflows/_update-api.yml +++ b/.github/workflows/_update-api.yml @@ -8,6 +8,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 2 - uses: actions/setup-node@v2 if: ${{ !env.ACT }} with: From ad2a76b4689d98fe442dd6b37a421c98a290eab8 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 22:08:29 +0300 Subject: [PATCH 37/49] Update _update-api.yml --- .github/workflows/_update-api.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/_update-api.yml b/.github/workflows/_update-api.yml index 88a2e84e..2aed84f6 100644 --- a/.github/workflows/_update-api.yml +++ b/.github/workflows/_update-api.yml @@ -8,8 +8,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - with: - fetch-depth: 2 - uses: actions/setup-node@v2 if: ${{ !env.ACT }} with: From 3a3e38c12dd29c063445f0447ae97dcef152600b Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 22:08:31 +0300 Subject: [PATCH 38/49] Update _update-readme.yml --- .github/workflows/_update-readme.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/_update-readme.yml b/.github/workflows/_update-readme.yml index 553749a1..1a1e1132 100644 --- a/.github/workflows/_update-readme.yml +++ b/.github/workflows/_update-readme.yml @@ -8,8 +8,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - with: - fetch-depth: 2 - run: echo "::set-output name=branch_name::$(date +'bot/auto-update-%s')" id: create-branch-name - run: git config user.name 'iptv-bot[bot]' From a4dd677f1b3e024f912e2df2fcebdc70746ddc50 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 22:13:05 +0300 Subject: [PATCH 39/49] Update update.js --- scripts/commands/api/update.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/commands/api/update.js b/scripts/commands/api/update.js index e83d219b..d69e26ce 100644 --- a/scripts/commands/api/update.js +++ b/scripts/commands/api/update.js @@ -3,7 +3,7 @@ const { program } = require('commander') const _ = require('lodash') const CHANNELS_PATH = process.env.CHANNELS_PATH || 'sites/**/*.channels.xml' -const OUTPUT_DIR = process.env.OUTPUT_DIR || '.gh-pages/api' +const OUTPUT_DIR = process.env.OUTPUT_DIR || '.api' async function main() { let guides = [] From 477b756cf261839225d4e7e088856de4c868cb69 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 22:13:08 +0300 Subject: [PATCH 40/49] Update _update-api.yml --- .github/workflows/_update-api.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_update-api.yml b/.github/workflows/_update-api.yml index 2aed84f6..927ed780 100644 --- a/.github/workflows/_update-api.yml +++ b/.github/workflows/_update-api.yml @@ -26,7 +26,7 @@ jobs: with: repository-name: iptv-org/api branch: gh-pages - folder: .gh-pages/api + folder: .api token: ${{ steps.create-app-token.outputs.token }} git-config-name: iptv-bot[bot] git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com From 7d0a78e50b4bafc4d734b9384a3953a8b0282d0e Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 22:17:21 +0300 Subject: [PATCH 41/49] Update _update-readme.yml --- .github/workflows/_update-readme.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_update-readme.yml b/.github/workflows/_update-readme.yml index 1a1e1132..184b14b4 100644 --- a/.github/workflows/_update-readme.yml +++ b/.github/workflows/_update-readme.yml @@ -28,7 +28,7 @@ jobs: if: ${{ !env.ACT }} run: | git add README.md - git commit -m "[Bot] Update README.md" + git diff-index --quiet HEAD || git commit -m "[Bot] Update README.md" git status git push -u origin ${{ steps.create-branch-name.outputs.branch_name }} - uses: tibdex/github-app-token@v1 From 6361e15687e38a1eafa1e05163ffc30825d9dcf5 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 22:23:14 +0300 Subject: [PATCH 42/49] Update _update-readme.yml --- .github/workflows/_update-readme.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_update-readme.yml b/.github/workflows/_update-readme.yml index 184b14b4..808618de 100644 --- a/.github/workflows/_update-readme.yml +++ b/.github/workflows/_update-readme.yml @@ -30,7 +30,7 @@ jobs: git add README.md git diff-index --quiet HEAD || git commit -m "[Bot] Update README.md" git status - git push -u origin ${{ steps.create-branch-name.outputs.branch_name }} + git diff-index --quiet HEAD || git push -u origin ${{ steps.create-branch-name.outputs.branch_name }} - uses: tibdex/github-app-token@v1 if: ${{ !env.ACT }} id: create-app-token From 9f3c2efc9c1c5cbddfa1499ed7d1caea652aef15 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 28 Feb 2022 22:31:01 +0300 Subject: [PATCH 43/49] Update _update-readme.yml --- .github/workflows/_update-readme.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_update-readme.yml b/.github/workflows/_update-readme.yml index 808618de..1a1e1132 100644 --- a/.github/workflows/_update-readme.yml +++ b/.github/workflows/_update-readme.yml @@ -28,9 +28,9 @@ jobs: if: ${{ !env.ACT }} run: | git add README.md - git diff-index --quiet HEAD || git commit -m "[Bot] Update README.md" + git commit -m "[Bot] Update README.md" git status - git diff-index --quiet HEAD || git push -u origin ${{ steps.create-branch-name.outputs.branch_name }} + git push -u origin ${{ steps.create-branch-name.outputs.branch_name }} - uses: tibdex/github-app-token@v1 if: ${{ !env.ACT }} id: create-app-token From 67a5d14c72819a6271bc164283670381299532dc Mon Sep 17 00:00:00 2001 From: RevGear <95308545+RevGear@users.noreply.github.com> Date: Mon, 28 Feb 2022 21:20:00 +0000 Subject: [PATCH 44/49] Update programme-tv.net_fr.channels.xml BeInSports#.qa called BeInSports#France.qa in other French language sites --- sites/programme-tv.net/programme-tv.net_fr.channels.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sites/programme-tv.net/programme-tv.net_fr.channels.xml b/sites/programme-tv.net/programme-tv.net_fr.channels.xml index 77184856..a1d6ca70 100644 --- a/sites/programme-tv.net/programme-tv.net_fr.channels.xml +++ b/sites/programme-tv.net/programme-tv.net_fr.channels.xml @@ -17,9 +17,9 @@ BBC Four BBC One BBC Two - BeIn Sports 1 - BeIn Sports 2 - BeIn Sports 3 + BeIn Sports 1 France + BeIn Sports 2 France + BeIn Sports 3 France BeIn Sports Max 10 France BeIn Sports Max 4 France BeIn Sports Max 5 France @@ -206,4 +206,4 @@ XXL ZDF - \ No newline at end of file + From f193749a28caae02972c1fa60ccf069f333c8c12 Mon Sep 17 00:00:00 2001 From: RevGear <95308545+RevGear@users.noreply.github.com> Date: Tue, 1 Mar 2022 08:51:42 +0000 Subject: [PATCH 45/49] Update sky.de.config.js --- sites/sky.de/sky.de.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sites/sky.de/sky.de.config.js b/sites/sky.de/sky.de.config.js index 3970a262..728b2ced 100644 --- a/sites/sky.de/sky.de.config.js +++ b/sites/sky.de/sky.de.config.js @@ -2,7 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'sky.de', - url: 'https://www.sky.de/sgtvg/service/getBroadcastsForGrid', + url: `https://www.sky.de/sgtvg/service/getBroadcastsForGrid`, request: { method: 'POST', data: function ({ channel, date }) { From 1ab05246ee3db21710bac19ff26a929c8ed47b32 Mon Sep 17 00:00:00 2001 From: RevGear <95308545+RevGear@users.noreply.github.com> Date: Tue, 1 Mar 2022 12:48:16 +0000 Subject: [PATCH 46/49] Update sky.de.config.js --- sites/sky.de/sky.de.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sites/sky.de/sky.de.config.js b/sites/sky.de/sky.de.config.js index 728b2ced..37576f4f 100644 --- a/sites/sky.de/sky.de.config.js +++ b/sites/sky.de/sky.de.config.js @@ -2,7 +2,7 @@ const dayjs = require('dayjs') module.exports = { site: 'sky.de', - url: `https://www.sky.de/sgtvg/service/getBroadcastsForGrid`, + url: `https://www.sky.de/sgtvg/service/getBroadcastsForGrid`, request: { method: 'POST', data: function ({ channel, date }) { @@ -20,8 +20,8 @@ module.exports = { title: item.et, description: item.epit, category: item.ec, - start: dayjs.valueOf(item.bsdt), - stop: dayjs.valueOf(item.bedt), + start: dayjs(item.bsdt), + stop: dayjs(item.bedt), season: item.sn, episode: item.en, icon: item.pu ? `http://sky.de${item.pu}` : null From 6778247bb0704163b7c7d0b052aa9c63b94c5000 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 1 Mar 2022 15:49:21 +0300 Subject: [PATCH 47/49] Fix validation errors --- sites/directv.com/directv.com_us.channels.xml | 2 +- sites/m.tv.sms.cz/m.tv.sms.cz_cz.channels.xml | 2 +- sites/magticom.ge/magticom.ge_ge.channels.xml | 2 +- sites/meo.pt/meo.pt_pt.channels.xml | 2 +- sites/programtv.onet.pl/programtv.onet.pl_pl.channels.xml | 2 +- sites/teliatv.ee/teliatv.ee_ee-en.channels.xml | 2 +- sites/teliatv.ee/teliatv.ee_ee-et.channels.xml | 2 +- sites/teliatv.ee/teliatv.ee_ee-ru.channels.xml | 2 +- sites/tv.blue.ch/tv.blue.ch_ch.channels.xml | 2 +- sites/tv.dir.bg/tv.dir.bg_bg.channels.xml | 2 +- sites/tv.lv/tv.lv_lv.channels.xml | 2 +- sites/tv.yandex.ru/tv.yandex.ru_kz.channels.xml | 2 +- sites/tv.yandex.ru/tv.yandex.ru_ru.channels.xml | 2 +- sites/tv2go.t-2.net/tv2go.t-2.net_si.channels.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sites/directv.com/directv.com_us.channels.xml b/sites/directv.com/directv.com_us.channels.xml index 3a6b60cb..22d182f2 100644 --- a/sites/directv.com/directv.com_us.channels.xml +++ b/sites/directv.com/directv.com_us.channels.xml @@ -252,7 +252,7 @@ Penthouse TV Penthouse TV Monthly Offer Perรบ Mรกgico - Perviy kanal America + Pervyy kanal America Phoenix Hong Kong Phoenix InfoNews Channel Phoenix North America Chinese Channel diff --git a/sites/m.tv.sms.cz/m.tv.sms.cz_cz.channels.xml b/sites/m.tv.sms.cz/m.tv.sms.cz_cz.channels.xml index 74703238..aa5867a1 100644 --- a/sites/m.tv.sms.cz/m.tv.sms.cz_cz.channels.xml +++ b/sites/m.tv.sms.cz/m.tv.sms.cz_cz.channels.xml @@ -296,7 +296,7 @@ Park TV Passion XXX Pax TV - Perviy kanal + Perviy kanal Phoenix Pick UK Playboy TV Europe diff --git a/sites/magticom.ge/magticom.ge_ge.channels.xml b/sites/magticom.ge/magticom.ge_ge.channels.xml index b0110273..dd87a7c7 100644 --- a/sites/magticom.ge/magticom.ge_ge.channels.xml +++ b/sites/magticom.ge/magticom.ge_ge.channels.xml @@ -80,7 +80,7 @@ Paramount Channel Russia Paramount Comedy Russia Peretz International - Perviy kanal CIS + Perviy kanal CIS Pos TV Pyatnitsa! International Qartuli Arkhi diff --git a/sites/meo.pt/meo.pt_pt.channels.xml b/sites/meo.pt/meo.pt_pt.channels.xml index d248ed81..5b39c989 100644 --- a/sites/meo.pt/meo.pt_pt.channels.xml +++ b/sites/meo.pt/meo.pt_pt.channels.xml @@ -120,7 +120,7 @@ PFC Internacional Panda Kids Penthouse Gold - Perviy kanal Europa + Perviy kanal Europa Phoenix CNE Playboy TV Europe Porto Canal diff --git a/sites/programtv.onet.pl/programtv.onet.pl_pl.channels.xml b/sites/programtv.onet.pl/programtv.onet.pl_pl.channels.xml index 2cc1e13c..8d399a47 100644 --- a/sites/programtv.onet.pl/programtv.onet.pl_pl.channels.xml +++ b/sites/programtv.onet.pl/programtv.onet.pl_pl.channels.xml @@ -198,7 +198,7 @@ ORF 1 ORF 2 Paramount Channel Polska - Perviy kanal Europa + Perviy kanal Europa Phoenix Planete + Polska Playboy TV Europe diff --git a/sites/teliatv.ee/teliatv.ee_ee-en.channels.xml b/sites/teliatv.ee/teliatv.ee_ee-en.channels.xml index b7f3e8f5..39a2bab7 100644 --- a/sites/teliatv.ee/teliatv.ee_ee-en.channels.xml +++ b/sites/teliatv.ee/teliatv.ee_ee-en.channels.xml @@ -84,7 +84,7 @@ NTV Serial Okhota i Rybalka Orsent TV - Perviy Baltijskyi Kanal + Perviy Baltijskyi Kanal Private TV ProSieben Deutschland Pyatnitsa! International diff --git a/sites/teliatv.ee/teliatv.ee_ee-et.channels.xml b/sites/teliatv.ee/teliatv.ee_ee-et.channels.xml index 48894a76..cb81083e 100644 --- a/sites/teliatv.ee/teliatv.ee_ee-et.channels.xml +++ b/sites/teliatv.ee/teliatv.ee_ee-et.channels.xml @@ -84,7 +84,7 @@ NTV Serial Okhota i Rybalka Orsent TV - Perviy Baltijskyi Kanal + Perviy Baltijskyi Kanal Private TV ProSieben Deutschland Pyatnitsa! International diff --git a/sites/teliatv.ee/teliatv.ee_ee-ru.channels.xml b/sites/teliatv.ee/teliatv.ee_ee-ru.channels.xml index ffd71775..f9b572c6 100644 --- a/sites/teliatv.ee/teliatv.ee_ee-ru.channels.xml +++ b/sites/teliatv.ee/teliatv.ee_ee-ru.channels.xml @@ -84,7 +84,7 @@ NTV Serial Okhota i Rybalka Orsent TV - Perviy Baltijskyi Kanal + Perviy Baltijskyi Kanal Private TV ProSieben Deutschland Pyatnitsa! International diff --git a/sites/tv.blue.ch/tv.blue.ch_ch.channels.xml b/sites/tv.blue.ch/tv.blue.ch_ch.channels.xml index 0fe97a76..71c3a54e 100644 --- a/sites/tv.blue.ch/tv.blue.ch_ch.channels.xml +++ b/sites/tv.blue.ch/tv.blue.ch_ch.channels.xml @@ -546,7 +546,7 @@ Karusel International Nash Kinomir Ost West - Perviy kanal Europa + Perviy kanal Europa RTR Planeta Telebom & Teledom ABC News diff --git a/sites/tv.dir.bg/tv.dir.bg_bg.channels.xml b/sites/tv.dir.bg/tv.dir.bg_bg.channels.xml index 3bb8b47c..892a36f1 100644 --- a/sites/tv.dir.bg/tv.dir.bg_bg.channels.xml +++ b/sites/tv.dir.bg/tv.dir.bg_bg.channels.xml @@ -83,7 +83,7 @@ Nova TV NTV Mir Okhota i Rybalka - Perviy kanal + Perviy kanal Planeta Folk Planeta HD POTV diff --git a/sites/tv.lv/tv.lv_lv.channels.xml b/sites/tv.lv/tv.lv_lv.channels.xml index 9125bb91..b8694944 100644 --- a/sites/tv.lv/tv.lv_lv.channels.xml +++ b/sites/tv.lv/tv.lv_lv.channels.xml @@ -8,7 +8,7 @@ History Europe LTV 1 LTV 7 - Perviy kanal Europa + Perviy kanal Europa REN TV Baltic TV 1000 East TV 1000 Russkoe Kino diff --git a/sites/tv.yandex.ru/tv.yandex.ru_kz.channels.xml b/sites/tv.yandex.ru/tv.yandex.ru_kz.channels.xml index 1ee13ddc..7a10b1ca 100644 --- a/sites/tv.yandex.ru/tv.yandex.ru_kz.channels.xml +++ b/sites/tv.yandex.ru/tv.yandex.ru_kz.channels.xml @@ -4,7 +4,7 @@ 31 Kanal Almaty TV Atameken Business - Perviy kanal Evrasia + Perviy kanal Evrasia RTR Planeta Setanta Sports Ukraine STS International diff --git a/sites/tv.yandex.ru/tv.yandex.ru_ru.channels.xml b/sites/tv.yandex.ru/tv.yandex.ru_ru.channels.xml index 4616f0ee..62c91fab 100644 --- a/sites/tv.yandex.ru/tv.yandex.ru_ru.channels.xml +++ b/sites/tv.yandex.ru/tv.yandex.ru_ru.channels.xml @@ -171,7 +171,7 @@ OTR Paramount Channel Russia Paramount Comedy Russia - Perviy kanal + Perviy kanal Pobeda Poehali! Priklyucheniya diff --git a/sites/tv2go.t-2.net/tv2go.t-2.net_si.channels.xml b/sites/tv2go.t-2.net/tv2go.t-2.net_si.channels.xml index 70eea474..ca437601 100644 --- a/sites/tv2go.t-2.net/tv2go.t-2.net_si.channels.xml +++ b/sites/tv2go.t-2.net/tv2go.t-2.net_si.channels.xml @@ -168,7 +168,7 @@ Oto OTV OTV Valentino - Perviy kanal Europa + Perviy kanal Europa PeTV Pink Extra Pink Film From f9185eae490a38bd25d96c24b3c2ddcf42d202e2 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 1 Mar 2022 21:08:03 +0300 Subject: [PATCH 48/49] Create sky.de.yml --- .github/workflows/sky.de.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/sky.de.yml diff --git a/.github/workflows/sky.de.yml b/.github/workflows/sky.de.yml new file mode 100644 index 00000000..0e2c6e97 --- /dev/null +++ b/.github/workflows/sky.de.yml @@ -0,0 +1,17 @@ +name: sky.de +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + workflow_run: + workflows: [_trigger] + types: + - completed +jobs: + load: + uses: ./.github/workflows/_load.yml + with: + site: ${{github.workflow}} + secrets: + APP_ID: ${{ secrets.APP_ID }} + APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }} From 607ca8a742111d230e4dc20baf37d68c3fba18d5 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 1 Mar 2022 21:09:09 +0300 Subject: [PATCH 49/49] Update sky.de_de.channels.xml --- sites/sky.de/sky.de_de.channels.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sites/sky.de/sky.de_de.channels.xml b/sites/sky.de/sky.de_de.channels.xml index 0bfcfa8f..a0256a7a 100644 --- a/sites/sky.de/sky.de_de.channels.xml +++ b/sites/sky.de/sky.de_de.channels.xml @@ -1,5 +1,5 @@ - + 13th Street Deutschland Beate Uhse TV