epg-grabber 0.28.0 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/epg-grabber.js +3 -3
- package/package.json +1 -1
- package/src/index.js +4 -4
- package/tests/index.test.js +1 -1
package/bin/epg-grabber.js
CHANGED
|
@@ -5,7 +5,7 @@ const program = new Command()
|
|
|
5
5
|
const { merge } = require('lodash')
|
|
6
6
|
const { gzip } = require('node-gzip')
|
|
7
7
|
const file = require('../src/file')
|
|
8
|
-
const EPGGrabber = require('../src/index')
|
|
8
|
+
const { EPGGrabber, parseChannels, generateXMLTV, loadLogo } = require('../src/index')
|
|
9
9
|
const { create: createLogger } = require('../src/logger')
|
|
10
10
|
const { parseInteger, getUTCDate } = require('../src/utils')
|
|
11
11
|
const { name, version, description } = require('../package.json')
|
|
@@ -63,7 +63,7 @@ async function main() {
|
|
|
63
63
|
const grabber = new EPGGrabber(config)
|
|
64
64
|
|
|
65
65
|
const channelsXML = file.read(config.channels)
|
|
66
|
-
const { channels } =
|
|
66
|
+
const { channels } = parseChannels(channelsXML)
|
|
67
67
|
|
|
68
68
|
let programs = []
|
|
69
69
|
let i = 1
|
|
@@ -95,7 +95,7 @@ async function main() {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
const xml =
|
|
98
|
+
const xml = generateXMLTV({ channels, programs })
|
|
99
99
|
let outputPath = options.output || config.output
|
|
100
100
|
if (options.gzip) {
|
|
101
101
|
outputPath = outputPath || 'guide.xml.gz'
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -6,6 +6,9 @@ const { parse: parsePrograms } = require('./programs')
|
|
|
6
6
|
const { load: loadConfig } = require('./config')
|
|
7
7
|
const { sleep, isPromise } = require('./utils')
|
|
8
8
|
|
|
9
|
+
module.exports.generateXMLTV = generateXMLTV
|
|
10
|
+
module.exports.parseChannels = parseChannels
|
|
11
|
+
|
|
9
12
|
class EPGGrabber {
|
|
10
13
|
constructor(config = {}) {
|
|
11
14
|
this.config = loadConfig(config)
|
|
@@ -42,7 +45,4 @@ class EPGGrabber {
|
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
47
|
|
|
45
|
-
|
|
46
|
-
EPGGrabber.prototype.parseChannels = parseChannels
|
|
47
|
-
|
|
48
|
-
module.exports = EPGGrabber
|
|
48
|
+
module.exports.EPGGrabber = EPGGrabber
|