From 4aeb528c60d7a993ff3d2d46c2dc0f5d8b47c780 Mon Sep 17 00:00:00 2001 From: Contribucious <4764956+contribucious@users.noreply.github.com> Date: Thu, 4 Aug 2022 22:29:49 +0200 Subject: [PATCH] fix `$hls` syntax and examples --- .../02.how-to-create-your-own-ad-filters/docs.en.md | 8 ++++---- .../02.how-to-create-your-own-ad-filters/docs.ru.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/01.general/02.how-to-create-your-own-ad-filters/docs.en.md b/01.general/02.how-to-create-your-own-ad-filters/docs.en.md index b34f6af58..6c31579e1 100644 --- a/01.general/02.how-to-create-your-own-ad-filters/docs.en.md +++ b/01.general/02.how-to-create-your-own-ad-filters/docs.en.md @@ -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 diff --git a/01.general/02.how-to-create-your-own-ad-filters/docs.ru.md b/01.general/02.how-to-create-your-own-ad-filters/docs.ru.md index 4af52767e..6b7f60367 100644 --- a/01.general/02.how-to-create-your-own-ad-filters/docs.ru.md +++ b/01.general/02.how-to-create-your-own-ad-filters/docs.ru.md @@ -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`