api proxy - euzu/m3u-filter GitHub Wiki

3. Api-Proxy Config

If you use the proxy functionality, you need to create a api-proxy.yml configuration.

You can specify the path for the file with the -a cli argument.

The configuration contains the server info for xtream accounts and user definitions. You can define multiple server with unique names, one should be named default.

Iptv player can act differently and use the direct-source attribute or can compose the url based on the server info. You should set xtream_skip_live_direct_source and xtream_skip_video_direct_source to true to avoid this problem.

  • username and passwordare mandatory for credentials. username is unique.
  • token is optional. If defined it should be unique. The tokencan be used instead of username+password
  • proxy is optional. If defined it can be reverse or redirect. Default is redirect.
  • server is optional. It should match one server definition, if not given the server with the name default is used or the first one.
  • max_connections, status, exp_date are optional fields. If they exist they are checked when config.yml user_access_control set to true., if you don't need them remove this fields from api-proxy.yml

To access the api for:

  • xtream use url like http://192.169.1.2/player_api.php?username={}&password={}
  • m3u use url http://192.169.1.2/get.php?username={}&password={} or with token
  • xtream use url like http://192.169.1.2/player_api.php?token={}
  • m3u use url http://192.169.1.2/get.php?token={}

To access the xmltv-api use url like http://192.169.1.2/xmltv.php?username={}&password={}

Do not forget to replace {} with credentials.

If you use the endpoints through rest calls, you can use, for the sake of simplicity:

  • m3u inplace of get.php
  • xtream inplace of player_api.php
  • epg inplace of xmltv.php
  • token inplace of username and password combination

When you define credentials for a target, ensure that this target has output format xtreamor m3u.

The proxy property can be reverseor redirect. reverse means the streams are going through m3u-filter, redirect means the streams are comming from your provider.

If you use https you need a ssl terminator. m3u-filter does not support https traffic.

server:
  - name: default 
    protocol: http
    host: 192.168.0.3
    port: 80
    timezone: Europe/Paris
    message: Welcome to m3u-filter
  - name: external
    protocol: https
    host: my_external_domain.com
    port: 443
    timezone: Europe/Paris
    message: Welcome to m3u-filter
user:
  - target: pl1
    credentials:
      - {username: x3452, password: ztrhgrGZ, token: 4342sd, proxy: reverse, server: external}
      - {username: x3451, password: secret, token: abcde, proxy: redirect}