@kv8n2oryk/tizeniptv
v1.2.3
Published
tizeniptv is an app bring https://iptvwebv2.vercel.app/ on your Tizen (Samsung) TVs.
Readme
TizenIPTV
An npm module that provides access to IPTV channels from https://iptvwebv2.vercel.app/ for Tizen (Samsung) TVs.
Installation
npm install @kv8n2oryk/tizeniptvUsage
const TizenIPTV = require('@kv8n2oryk/tizeniptv');
async function main() {
// Create IPTV instance
const iptv = new TizenIPTV({
baseURL: 'https://iptvwebv2.vercel.app', // optional, default
port: 8085 // optional, default
});
try {
// Initialize the service
await iptv.init();
console.log('IPTV service started on port', iptv.port);
// Get available channels
const channels = await iptv.getChannels();
console.log('Available channels:', channels);
// Play a channel
if (channels.length > 0) {
const channelUrl = iptv.getLocalPlaybackUrl(channels[0].url);
console.log('Playback URL:', channelUrl);
// Open channelUrl in browser or media player
}
} catch (error) {
console.error('Error:', error.message);
} finally {
// Stop the service
iptv.stop();
}
}
main();API
new TizenIPTV(options)
Creates a new TizenIPTV instance.
Options:
baseURL(string): Base URL of the IPTV website (default: 'https://iptvwebv2.vercel.app')port(number): Port for the local server (default: 8085)
async init()
Initializes the IPTV service and starts the local server.
async getChannels()
Fetches available IPTV channels from the website.
Returns: Array of channel objects with name and url properties.
getLocalPlaybackUrl(channelUrl)
Generates a local playback URL for a channel.
Parameters:
channelUrl(string): The HLS URL of the channel
Returns: Local URL that can be used to play the channel
playChannel(channelUrl)
Generates a direct playback URL for a channel on the remote website.
Parameters:
channelUrl(string): The HLS URL of the channel
Returns: Remote URL for direct playback
stop()
Stops the local server.
Endpoints
When the service is running, the following endpoints are available:
GET /play?url=<channel_url>- HLS video player for the specified channelGET /channels- JSON API returning available channels
Development
# Install dependencies
npm install
# Build the module
npm run build
# Run tests
node test.jsLicense
GPL-3.0-only
Repository
https://github.com/thichcode/tizeniptv
