config_sources_targets - euzu/tuliprox GitHub Wiki

targets

Has the following top level entries:

  • enabled optional default is true, if you disable the processing is skipped
  • name optional default is default, if not default it has to be unique, for running selective targets
  • sort optional
  • output mandatory list of output formats
  • processing_order optional default is frm
  • options optional
  • filter mandatory,
  • rename optional
  • mapping optional
  • watch optional

sort

Has three top level attributes

  • match_as_ascii optional default is false
  • groups
  • channels

groups

has one top level attribute order which can be set to ascor desc.

channels

is a list of sort configurations for groups. Each configuration has 3 top level entries.

  • field can be group, title, name or url.
  • group_pattern is a regular expression like '^TR.:\s?(.*)' which is matched against group title.
  • order can be asc or desc
  • sequence optional is a list of field values (based on field) which are used to sort based on index. The order is ignored for this entries.

The pattern should be selected taking into account the processing sequence.

sort:
  groups:
    order: asc
  channels:
    - { field: name,  group_pattern: '^DE.*',  order: asc }

output

Is a list of output format: Each format has 2 properties

  • type
  • filename

type is mandatory for m3u, strm and xtream.
filename is mandatory if type is strm. if type is m3u the plain m3u file is written but it is not used by m3u-filter.

output:
  - type: m3u
    filename: {}.m3u

processing_order

The processing order (Filter, Rename and Map) can be configured for each target with: processing_order: frm (valid values are: frm, fmr, rfm, rmf, mfr, mrf. default is frm)

options

Target options are:

  • ingore_logo logo attributes are ignored to avoid caching logo files on devices.
  • share_live_streams to share live stream connections in reverse proxy mode.
  • remove_duplicates to remove duplicate entries based on stream url compare.
  • xtream_resolve_series when you have xtream source and want to resolve series
  • xtream_resolve_series_delay delay between each url call in seconds
  • xtream_resolve_vod when you have xtream source and want to resolve vod
  • xtream_resolve_vod_delay delay between each url call in seconds

Because xtream api delivers only the metadata to series, we need to fetch the series and resolve them. But be aware, each series info entry needs to be fetched one by one.

  • xtream_resolve_series if is set to true and you have xtream input and m3u output, the series are fetched and resolved. This can cause a lot of requests to the provider. Be cautious when using this option.
  • xtream_resolve_series_delay to avoid a provider ban you can set the seconds between series_info_request's. Default is 2 seconds. But be aware that the more series entries there are, the longer the process takes.

For xtream_resolve_(vod|series) the files are only fetched one for each input and cached. Only new and modified ones are updated.

strm output has additional options

  • underscore_whitespace replaces all whitespaces with _ in the path.
  • cleanup deletes the directory given at filename.
  • kodi_style tries to rename filename with kodi style.
  • strm_props you can add properties like #KODIPROP:seekable=true|false, #KODIPROP:inputstream=inputstream.ffmpeg or "#KODIPROP:http-reconnect=true.

m3u output has additional options

  • m3u_include_type_in_url, default false, if true adds the stream type live, movie, series to the url of the stream.
  • m3u_mask_redirect_url, default false, if true uses urls from api_proxy.yml for user in proxy mode redirect.

xtream output has additional options

  • xtream_skip_live_direct_source if true the direct_source property from provider for live is ignored
  • xtream_skip_video_direct_source if true the direct_source property from provider for movies is ignored
  • xtream_skip_series_direct_source if true the direct_source property from provider for series is ignored

filter

The filter is a string with a filter statement. The filter can have UnaryExpression NOT, BinaryExpression AND OR, Regexp Comparison (Group|Title|Name|Url) ~ "regexp" and Type Comparsison Type = vod or Type = live or Type = series. Filter fields are Group, Title, Name, Url and Type. Example filter: ((Group ~ "^DE.*") AND (NOT Title ~ ".*Shopping.*")) OR (Group ~ "^AU.*")

If you use characters like + | [ ] ( ) in filters don't forget to escape them!!

The regular expression syntax is similar to Perl-style regular expressions, but lacks a few features like look around and backreferences.
To test the regular expression i use regex101.com. Don't forget to select Rust option which is under the FLAVOR section on the left.

rename

Is a List of rename configurations. Each configuration has 3 top level entries.

  • field can be group, title, name or url.
  • pattern is a regular expression like '^TR.:\s?(.*)'
  • new_name can contain capture groups variables addressed with $1,$2,...

rename supports capture groups. Each group can be addressed with $1, $2 .. in the new_name attribute.

This could be used for players which do not observe the order and sort themselves.

rename:
  - { field: group,  pattern: ^DE(.*),  new_name: 1. DE$1 }

In the above example each entry starting with DE will be prefixed with 1..

(Please be aware of the processing order. If you first map, you should match the mapped entries!)

mapping

mapping: <list of mapping id's> The mappings are defined in a file mapping.yml. The filename can be given as -m argument.

watch

For each target with a unique name, you can define a watched groups. It is a list of regular expression matching final group names from this target playlist. Final means in this case: the name in the resulting playlist after applying all steps of transformation.

For example given the following configuration:

watch:
  - 'FR - Movies \[ 202[34] \]'
  - 'FR - Series'

Changes from this groups will be printed as info on console and send to the configured messaging (f.e. telegram channel).