Merge pull request #1111 from contribucious/contribucious-fix/hls-syntax-and-examples-fixes

fix `$hls` syntax and examples
This commit is contained in:
Andrey Meshkov 2022-08-07 18:08:53 +03:00 committed by GitHub
commit ac56f46719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -1223,13 +1223,13 @@ Note that the word "segment" in this document means either a "Media Segment" or
##### Syntax
* `||example.org^$hls=urlpattern` remove segments whose URL matches the URL pattern `urlpattern`. The pattern works just like the one in basic URL rules, however, the characters `/`, `$` and `,` must be escaped with `\` inside `urlpattern`.
* `||example.org^$hls=/regex/options` remove segments where the URL, or, if a certain option is present, one of the tags, matches the regular expression `regex`. `options` modify the behaviour of the rule as described below.
* `||example.org^$hls=/regexp/[options]` remove segments where the URL, or, if a certain option is present, one of the tags, matches the regular expression `regexp`. `[options]` modify the behaviour of the rule as described below.
Available `options` are:
* `t` instead of testing the segment's URL, test each of the segment's tags against the regex. A segment with a matching tag is removed.
* `t` instead of testing the segment's URL, test each of the segment's tags against the regular expression. A segment with a matching tag is removed.
* `i` make the regular expression case-insensitive.
The characters `/`, `$` and `,` must be escaped with `\` inside `regex`.
The characters `/`, `$` and `,` must be escaped with `\` inside `regexp`.
##### Exceptions
@ -1250,7 +1250,7 @@ When multiple `$hls` rules match the same request, their effect is cumulative.
##### Examples
* `||example.org^$hls=\/videoplayback^?*&source=dclk_video_ads` — removes all segments with the matching URL.
* `||example.org^$hls=/\/videoplayback\/?\?.*\&source=dclk_video_ads/i` — achieves more or less the same with
a regex instead of a URL pattern.
a regular expression instead of a URL pattern.
* `||example.org^$hls=/#UPLYNK-SEGMENT:.*\,ad/t` — removes all segments which have the matching tag.
##### Anatomy of an HLS playlist

View File

@ -1214,13 +1214,13 @@ $removeparam=/^(utm_content|utm_campaign|utm_referrer)=/
##### Синтаксис
* `||example.org^$hls=urlpattern` удалить сегменты, URL которых соответствует паттерну `urlpattern`. Паттерн работает так же, как в базовых URL правилах, однако символы `/`, `$` и `,` в составе `urlpattern` необходимо экранировать с помощью `\`.
* `||example.org^$hls=/regex/options` удалить сегменты, URL которых, или, в зависимости от опций, один из тегов, соответствует регулярному выражению `regex`. Опции `options` изменяют поведение правила как описано ниже.
* `||example.org^$hls=/regexp/[options]` удалить сегменты, URL которых, или, в зависимости от опций, один из тегов, соответствует регулярному выражению `regexp`. Опции `[options]` изменяют поведение правила как описано ниже.
Доступные значения `options`:
* `t` вместо URL, тестировать теги сегмента на соответствие регулярному выражению. Сегмент с соответствующим тегом будет удален.
* `i` сделать регулярное выражение нечувствительным к регистру символов.
Как и в случае с паттерном, символы `/`, `$` и `,` в `regex` необходимо экранировать с помощью `\`.
Как и в случае с паттерном, символы `/`, `$` и `,` в `regexp` необходимо экранировать с помощью `\`.
##### Отключение правил `$hls`