iptv-checker 0.27.0 → 0.28.0

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.
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iptv-checker",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "description": "Node.js CLI tool for checking links in IPTV playlists",
5
5
  "main": "src/index.js",
6
6
  "preferGlobal": true,
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "scripts": {
12
12
  "start": "node src/index.js",
13
- "lint": "npx eslint ./src/**/*.js ./test/*.js",
13
+ "lint": "npx eslint \"./{src,test}/**/*.js\"",
14
14
  "test": "npx jest",
15
15
  "prePush": "npm-run-all -p lint test"
16
16
  },
@@ -30,6 +30,7 @@
30
30
  "checker"
31
31
  ],
32
32
  "dependencies": {
33
+ "async": "^3.2.4",
33
34
  "axios": "^0.21.1",
34
35
  "axios-curlirize": "^1.3.7",
35
36
  "colors": "^1.4.0",
@@ -39,7 +40,6 @@
39
40
  "get-stdin": "^7.0.0",
40
41
  "iptv-playlist-parser": "^0.12.0",
41
42
  "jest": "^27.0.6",
42
- "lodash.chunk": "^4.2.0",
43
43
  "progress": "^2.0.3",
44
44
  "valid-url": "^1.0.9"
45
45
  },
package/src/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  require('colors')
2
- const chunk = require('lodash.chunk')
3
2
  const { isUri } = require('valid-url')
4
3
  const commandExists = require('command-exists')
4
+ const eachLimit = require('async/eachLimit')
5
5
  const { parsePlaylist } = require('./parser')
6
6
  const cache = require('./cache')
7
7
  const Logger = require('./Logger')
@@ -82,14 +82,10 @@ class IPTVChecker {
82
82
  results.push(checkedItem)
83
83
  }
84
84
  } else {
85
- const chunkedItems = chunk(items, +config.parallel)
86
-
87
- for (let [...chunk] of chunkedItems) {
88
- const chunkResults = await Promise.all(
89
- chunk.map(item => this.checkStream(item))
90
- )
91
- results.push(...chunkResults)
92
- }
85
+ await eachLimit(items, +config.parallel, async item => {
86
+ const result = await this.checkStream(item)
87
+ results.push(result)
88
+ })
93
89
  }
94
90
 
95
91
  return playlist
@@ -29,7 +29,7 @@ test(`Should process a playlist URL`, done => {
29
29
  })
30
30
 
31
31
  test(`Should process a stream URL`, done => {
32
- const url = 'https://live-hls-web-aja.getaj.net/AJA/index.m3u8'
32
+ const url = 'https://live-hls-v3-aja.getaj.net/AJA-V3/index.m3u8'
33
33
  checker
34
34
  .checkStream({ url, timeout: 50000 })
35
35
  .then(results => {