iptv-checker 0.22.0 → 0.23.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.
package/.travis.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  language: node_js
2
2
 
3
3
  node_js:
4
- - "10"
4
+ - "12"
5
5
 
6
6
  script:
7
7
  - npm run lint
package/README.md CHANGED
@@ -1,19 +1,17 @@
1
- # IPTV Checker [![Build Status](https://travis-ci.com/freearhey/iptv-checker.svg?branch=master)](https://travis-ci.com/freearhey/iptv-checker)
1
+ # IPTV Checker [![Build Status](https://app.travis-ci.com/freearhey/iptv-checker.svg?branch=master)](https://app.travis-ci.com/freearhey/iptv-checker)
2
2
 
3
3
  Node.js CLI tool for checking links in IPTV playlists.
4
4
 
5
- ## Installation
6
-
7
5
  This tool is based on the `ffmpeg` library, so you need to install it on your computer first. You can find the right installer for your system here: https://www.ffmpeg.org/download.html
8
6
 
9
- After that you can install the tool itself via npm:
7
+ ## Usage
8
+
9
+ ### CLI
10
10
 
11
11
  ```sh
12
12
  npm install -g iptv-checker
13
13
  ```
14
14
 
15
- ## Usage
16
-
17
15
  #### Check local playlist file:
18
16
 
19
17
  ```sh
@@ -40,6 +38,197 @@ Arguments:
40
38
  - `-k, --insecure`: allow insecure connections when using SSL
41
39
  - `-p, --parallel`: Batch size of channels to check concurrently (default to 1)
42
40
 
41
+ ### Node.js
42
+
43
+ ```sh
44
+ npm install iptv-checker
45
+ ```
46
+
47
+ ```js
48
+ var checker = require('iptv-checker')
49
+
50
+ // using playlist url
51
+ checker.checkPlaylist('https://some-playlist.lol/list.m3u').then(results => {
52
+ console.log(results)
53
+ })
54
+
55
+ // using local path
56
+ checker.checkPlaylist('path/to/playlist.m3u').then(results => {
57
+ console.log(results)
58
+ })
59
+
60
+ // using playlist as string
61
+ checker.checkPlaylist(string).then(results => {
62
+ console.log(results)
63
+ })
64
+ ```
65
+
66
+ #### Results
67
+
68
+ On success:
69
+
70
+ ```jsonc
71
+ {
72
+ "header": {
73
+ "attrs": {},
74
+ "raw": "#EXTM3U x-tvg-url=\"\""
75
+ },
76
+ "items": [
77
+ {
78
+ "name": "KBSV/AssyriaSat (720p) [Not 24/7]",
79
+ "tvg": {
80
+ "id": "KBSVAssyriaSat.us",
81
+ "name": "",
82
+ "language": "Assyrian Neo-Aramaic;English",
83
+ "country": "US",
84
+ "logo": "https://i.imgur.com/zEWSSdf.jpg",
85
+ "url": "",
86
+ "rec": ""
87
+ },
88
+ "group": {
89
+ "title": "General"
90
+ },
91
+ "http": {
92
+ "referrer": "",
93
+ "user-agent": ""
94
+ },
95
+ "url": "http://66.242.170.53/hls/live/temp/index.m3u8",
96
+ "raw": "#EXTINF:-1 tvg-id=\"KBSVAssyriaSat.us\" tvg-country=\"US\" tvg-language=\"Assyrian Neo-Aramaic;English\" tvg-logo=\"https://i.imgur.com/zEWSSdf.jpg\" group-title=\"General\",KBSV/AssyriaSat (720p) [Not 24/7]\r\nhttp://66.242.170.53/hls/live/temp/index.m3u8",
97
+ "line": 2,
98
+ "catchup": {
99
+ "type": "",
100
+ "days": "",
101
+ "source": ""
102
+ },
103
+ "timeshift": "",
104
+ "status": {
105
+ "ok": true,
106
+ "metadata": {
107
+ "streams": [
108
+ {
109
+ "index": 0,
110
+ "codec_name": "h264",
111
+ "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
112
+ "profile": "High",
113
+ "codec_type": "video",
114
+ "codec_tag_string": "[27][0][0][0]",
115
+ "codec_tag": "0x001b",
116
+ "width": 1280,
117
+ "height": 720,
118
+ "coded_width": 1280,
119
+ "coded_height": 720,
120
+ "closed_captions": 0,
121
+ "has_b_frames": 2,
122
+ "pix_fmt": "yuv420p",
123
+ "level": 31,
124
+ "chroma_location": "left",
125
+ "refs": 1,
126
+ "is_avc": "false",
127
+ "nal_length_size": "0",
128
+ "r_frame_rate": "30/1",
129
+ "avg_frame_rate": "0/0",
130
+ "time_base": "1/90000",
131
+ "start_pts": 943358850,
132
+ "start_time": "10481.765000",
133
+ "bits_per_raw_sample": "8",
134
+ "disposition": {
135
+ "default": 0,
136
+ "dub": 0,
137
+ "original": 0,
138
+ "comment": 0,
139
+ "lyrics": 0,
140
+ "karaoke": 0,
141
+ "forced": 0,
142
+ "hearing_impaired": 0,
143
+ "visual_impaired": 0,
144
+ "clean_effects": 0,
145
+ "attached_pic": 0,
146
+ "timed_thumbnails": 0
147
+ },
148
+ "tags": {
149
+ "variant_bitrate": "400000"
150
+ }
151
+ }
152
+ //...
153
+ ],
154
+ "format": {
155
+ "filename": "http://66.242.170.53/hls/live/temp/index.m3u8",
156
+ "nb_streams": 2,
157
+ "nb_programs": 1,
158
+ "format_name": "hls",
159
+ "format_long_name": "Apple HTTP Live Streaming",
160
+ "start_time": "10481.560589",
161
+ "size": "214",
162
+ "probe_score": 100
163
+ },
164
+ "requests": [
165
+ {
166
+ "method": "GET",
167
+ "url": "http://66.242.170.53/hls/live/temp/index.m3u8",
168
+ "headers": {
169
+ "User-Agent": "Lavf/58.76.100",
170
+ "Accept": "*/*",
171
+ "Range": "bytes=0-",
172
+ "Connection": "close",
173
+ "Host": "66.242.170.53",
174
+ "Icy-MetaData": "1"
175
+ }
176
+ }
177
+ //...
178
+ ]
179
+ }
180
+ }
181
+ }
182
+ //...
183
+ ]
184
+ }
185
+ ```
186
+
187
+ On error:
188
+
189
+ ```jsonc
190
+ {
191
+ "header": {
192
+ "attrs": {},
193
+ "raw": "#EXTM3U x-tvg-url=\"\""
194
+ },
195
+ "items": [
196
+ {
197
+ "name": "Addis TV (720p)",
198
+ "tvg": {
199
+ "id": "AddisTV.et",
200
+ "name": "",
201
+ "language": "Amharic",
202
+ "country": "ET",
203
+ "logo": "https://i.imgur.com/KAg6MOI.png",
204
+ "url": "",
205
+ "rec": ""
206
+ },
207
+ "group": {
208
+ "title": ""
209
+ },
210
+ "http": {
211
+ "referrer": "",
212
+ "user-agent": ""
213
+ },
214
+ "url": "https://rrsatrtmp.tulix.tv/addis1/addis1multi.smil/playlist.m3u8",
215
+ "raw": "#EXTINF:-1 tvg-id=\"AddisTV.et\" tvg-country=\"ET\" tvg-language=\"Amharic\" tvg-logo=\"https://i.imgur.com/KAg6MOI.png\" group-title=\"Undefined\",Addis TV (720p)\r\nhttps://rrsatrtmp.tulix.tv/addis1/addis1multi.smil/playlist.m3u8",
216
+ "line": 2,
217
+ "catchup": {
218
+ "type": "",
219
+ "days": "",
220
+ "source": ""
221
+ },
222
+ "timeshift": "",
223
+ "status": {
224
+ "ok": false,
225
+ "reason": "Operation timed out"
226
+ }
227
+ }
228
+ ]
229
+ }
230
+ ```
231
+
43
232
  ## Contribution
44
233
 
45
234
  If you find a bug or want to contribute to the code or documentation, you can help by submitting an [issue](https://github.com/freearhey/iptv-checker/issues) or a [pull request](https://github.com/freearhey/iptv-checker/pulls).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iptv-checker",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "Node.js CLI tool for checking links in IPTV playlists",
5
5
  "main": "src/index.js",
6
6
  "preferGlobal": true,
@@ -36,7 +36,7 @@
36
36
  "commander": "^2.20.0",
37
37
  "dateformat": "^3.0.3",
38
38
  "get-stdin": "^7.0.0",
39
- "iptv-playlist-parser": "^0.5.4",
39
+ "iptv-playlist-parser": "^0.11.0",
40
40
  "jest": "^27.0.6",
41
41
  "lodash.chunk": "^4.2.0",
42
42
  "progress": "^2.0.3",
@@ -45,10 +45,10 @@
45
45
  "devDependencies": {
46
46
  "babel-eslint": "^10.1.0",
47
47
  "del": "^5.1.0",
48
- "eslint": "^6.8.0",
48
+ "eslint": "^8.10.0",
49
49
  "eslint-config-prettier": "^6.10.1",
50
50
  "eslint-plugin-babel": "^5.3.0",
51
- "eslint-plugin-jest": "^24.3.6",
51
+ "eslint-plugin-jest": "^26.1.1",
52
52
  "eslint-plugin-prettier": "^3.1.2",
53
53
  "mkdirp": "^1.0.4",
54
54
  "prettier": "^2.0.4"
package/src/helper.js CHANGED
@@ -137,18 +137,18 @@ function buildCommand(item, config) {
137
137
  ]
138
138
 
139
139
  if (config.timeout) {
140
- args.push(`-timeout`, `'${config.timeout * 1000}'`)
140
+ args.push(`-timeout`, `"${config.timeout * 1000}"`)
141
141
  }
142
142
 
143
143
  if (item.http.referrer) {
144
- args.push(`-headers`, `'Referer: ${item.http.referrer}'`)
144
+ args.push(`-headers`, `"Referer: ${item.http.referrer}"`)
145
145
  }
146
146
 
147
147
  if (userAgent) {
148
- args.push(`-user_agent`, `'${userAgent}'`)
148
+ args.push(`-user_agent`, `"${userAgent}"`)
149
149
  }
150
150
 
151
- args.push(`'${item.url}'`)
151
+ args.push(`"${item.url}"`)
152
152
 
153
153
  args = args.join(` `)
154
154
 
@@ -1,4 +1,3 @@
1
-
2
1
  #EXTM3U x-tvg-url="http://195.154.221.171/epg/guidealbania.xml.gz"
3
2
 
4
3
  #EXTINF:0,offline
@@ -1,3 +1,3 @@
1
1
  #EXTM3U
2
2
  #EXTINF:-1,Connection timed out
3
- https://5b464b69d264e.streamlock.net/Channels_live/ngrp:amordiscos_all/playlist.m3u8
3
+ https://streaming.3eeshalaan.net/AAAFinalFeed/AlAanFeed_live.m3u8