Skip to content

CorruptedBytes/IPTV-Server

Repository files navigation

IPTV-Server using HLS-Protocol

This is an IPTV-Server that I coded in NodeJS using the HLS-Protocol.


Installation

Clone the repository

git clone https://github.com/CorruptedBytes/IPTV-Server

Install Dependency Packages

npm install

Create MySQL Table

CREATE TABLE `keys` (`key` varchar(255) NOT NULL);

Configuration

Please configure the settings in the .env file


Run the server

Normal Mode

npm run start

Developer Mode

npm run dev

Use

Master Playlist: http://127.0.0.1:3360/iptv/<KEY>/playlist.m3u8

Channels: http://127.0.0.1:3360/iptv/<KEY>/<ChannelID>/index.m3u8

If the Key is invalid instead of the channel the server will respond with a 403 Channel which says that the Key is invalid.

If the Channel does not exisit then the server will respond with a 404 Channel which says that the Channel can't be found.

Do NOT delete the segments folder manually in the channels folders.


Create a Channel

The Channel 100 is a example channel.

You can create your own channel by creating a new folder in the /iptv directory.
The Name of the folder is your Channel ID and it's recommended to use only numbers for that. Then you have to create a channel.json file in the folder with this JSON content:

{
	"name": "Example Channel",
	"group": "Test",
	"requireKey": true,
	"listed": true,
	"inputType": "OTHER",
	"input": "rtp://127.0.0.1:1234"
}

Input Types: FILE, DEVICE, OTHER, STATIC

Channel Icon: icon.png - Should be 48x48px

To list all input devices enter this command in the command line:

Windows:

ffmpeg -f dshow -list_devices true -i ""

Linux:

ffmpeg -f v4l2 -list_devices true -i ""

MacOS:

ffmpeg -f avfoundation -list_devices true -i ""

API

Usage http://127.0.0.1:3360/api/<API_KEY>/<PARAMETERS>


Parameters:

Reload Server: reload

Restart Server: restart

Show all keys: key

Show all Channels: channel?action=list

Create Channel: channel?action=add&id=<CHANNEL_ID>&name=<CHANNEL_NAME>&group=<CHANNEL_GROUP>

CleanUp Channel: channel?action=cleanup | channel?action=cleanup&id=<CHANNEL_ID>