kvaster / iptv-proxy

Simple iptv restreamer
Other
96 stars 22 forks source link
iptv

Overview

This project is a simple iptv restreamer. For now it supports only HLS (m3u8) streams. Some iptv providers allow to connect only one device per url and this is not really comfortable when you have 3+ tv. Iptv-proxy allocates such 'urls' dynamically. I.e. your iptv provider have two urls (playlists) and allows only one connection per url, but you have 4 tv in your house and you never watch more then 2 tv at the same time. In this case you can setup two playlists in iptv proxy and they will be dynamically allocated to active tv.

Also iptvproxy can combine different iptv providers. It will combine both - playlist and xmltv data (if available).

Configuration

host: 127.0.0.1
port: 8080
base_url: http://127.0.0.1:8080
forwarded_pass: password
token_salt: 6r8bt67ta5e87tg7afn
channels_timeout_sec: 5
channels_total_timeout_sec: 60
channels_retry_delay_ms: 1000
xmltv_timeout_sec: 30
xmltv_total_timeout_sec: 120
xmltv_retry_delay_ms: 1000
use_http2: false
servers:
  - name: someiptv-1
    connections:
      - url: https://someiptv.com/playlist.m3u
        max_connections: 1
  - name: someiptv-2
    connections:
      - url: https://iptv-proxy.example.com/playlist.m3u
        max_connections: 4
      - url: https://iptv-proxy.example.com/playlist2.m3u
        max_connections: 2
        login: mylogin
        password: mypassword
    xmltv_url: https://epg.example.com/epg.xml.gz
    xmltv_before: p5d
    xmltv_after: p1d
    send_user: true
    proxy_stream: true
    channel_failed_ms: 1000
    info_timeout_ms: 1000
    info_total_timeout_ms: 2000
    info_retry_delay_ms: 100
    catchup_timeout_ms: 1000
    catchup_total_timeout_ms: 2000
    catchup_retry_delay_ms: 100
    stream_start_timeout_ms: 1000
    stream_read_timeout_ms: 1000
    group_filters:
      - 'movies'
      - 'vid.*'
allow_anonymous: false
users:
  - 65182_login1
  - 97897_login2

iptv proxy will embed full urls in it's lists - it means we should know url from which service is accessed by user. Url is calculated in following way:

Device setup

On device you should use next url as dynamic playlist:

<base_url>/m3u/<user_name>

or

<base_url>/m3u

for anonymous access.

For xmltv you should use <base_url>/epg.xml.gz