1.0.2 • Published 5 years ago
iptv-list-to-json v1.0.2
About
Transform a IPTV List in a Array with the channels as Objects
Installation
npm install iptv-list-to-json -s
or
yarn add iptv-list-to-json
How to import to your project
const { getJsonList, getJsonListFromUrlAsync } = require('iptv-list-to-json')
Usage
getJsonList()
array getJsonList( string RAWLIST )
Example
console.log(getJsonList(`#EXTM3U #EXTINF.........`))
Returns
It'll return an Array containing all channels as Objects like:
[
{
"channel_name": " www.listaiptv.gratis",
"img": "https://listaiptv.gratis/logos/imagens/info.png",
"group": "Variedades",
"video_url": "https://listaiptv.gratis/site.mp4"
},
{
"channel_name": " SBT - TV Jornal (PE)",
"img": "https://listaiptv.gratis/logos/imagens/sbt.png",
"group": "Variedades",
"video_url": "http://evpp.mm.uol.com.br/ne10/ne10.smil/playlist.m3u8"
},
{
"channel_name": " SBT Interior SP",
"img": "https://listaiptv.gratis/logos/imagens/sbt.png",
"group": "Variedades",
"video_url": "https://5a1c76baf08c0.streamlock.net/z343-live/z343/playlist.m3u8"
},
]
getJsonListFromUrlAsync()
getJsonListFromUrlAsync(string URL, function CALLBACK)
Example
getJsonListFromUrlAsync('http://lib.bz', function (error,list_in_json) {
if(error) return console.log('Error: '+error.code); // If there is an error return a warning
console.log(list_in_json); // If there is no an error show the list
})
Returns
It'll return the List normaly
[
{
"channel_name": " www.listaiptv.gratis",
"img": "https://listaiptv.gratis/logos/imagens/info.png",
"group": "Variedades",
"video_url": "https://listaiptv.gratis/site.mp4"
},
{
"channel_name": " SBT - TV Jornal (PE)",
"img": "https://listaiptv.gratis/logos/imagens/sbt.png",
"group": "Variedades",
"video_url": "http://evpp.mm.uol.com.br/ne10/ne10.smil/playlist.m3u8"
},
{
"channel_name": " SBT Interior SP",
"img": "https://listaiptv.gratis/logos/imagens/sbt.png",
"group": "Variedades",
"video_url": "https://5a1c76baf08c0.streamlock.net/z343-live/z343/playlist.m3u8"
},
]