Skip to content

config_sources_targets

euzu edited this page May 13, 2024 · 5 revisions

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

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.

strm output has additional options

  • underscore_whitespace
  • cleanup
  • kodi_style.

xtream output has additional options

  • xtream_skip_live_direct_source
  • xtream_skip_video_direct_source

m3u output has additional options 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.
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

  • ignore_logo true or false
  • underscore_whitespace true or false
  • cleanup true or false
  • kodi_style true or false

underscore_whitespace, cleanup and kodi_style are only valid for strm output.

  • ingore_log logo attributes are ignored to avoid caching logo files on devices.
  • 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.

filter

The filter is a string with a filter statement. The filter can have UnaryExpression NOT, BinaryExpression AND OR, and Comparison (Group|Title|Name|Url) ~ "regexp". Filter fields are Group, Title, Name and Url. 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).

Clone this wiki locally