@iptv-org/sdk
v1.1.3
Published
JavaScript library to query data from iptv-org/api
Readme
SDK 
JavaScript library to query data from iptv-org/api.
Installation
npm install @iptv-org/sdkQuick Start
import sdk from '@iptv-org/sdk'
const client = new sdk.Client()
await client.load()
const data = client.getData()
console.log(data.streams.all())Results:
[
{
"channel": null,
"feed": null,
"title": "Iman TV",
"url": "https://live.relentlessinnovations.net:1936/imantv/imantv/playlist.m3u8",
"referrer": null,
"user_agent": null,
"quality": "480p"
}
//...
]Usage
Get entities
import sdk from '@iptv-org/sdk'
const client = new sdk.Client()
await client.load()
const data = client.getData()
const {
channels,
feeds,
logos,
streams,
guides,
categories,
languages,
countries,
subdivisions,
cities,
regions,
timezones,
blocklist
} = dataAll data is contained in the helper class Collection, which makes it easy to filter and sort items:
const filtered = channels
.filter(channel => channel.country === 'FR')
.sortBy(channel => channel.name)
.all()
console.log(filtered)Each element of the collection also has a set of useful methods:
const channels = countries.first().getChannels()
console.log(channels)A complete list of available methods can be found in the documentation.
Search channels
import sdk from '@iptv-org/sdk'
const client = new sdk.Client()
await client.load()
const results = client.searchChannels('cat')
console.log(results)Testing
npm testContribution
If you find a bug or want to contribute to the code or documentation, you can help by submitting an issue or a pull request.
And thank you to everyone who has already contributed!
