From a91d9e1084ca87472b952d189eb897dc8a52fec5 Mon Sep 17 00:00:00 2001 From: flashdagger Date: Mon, 13 Nov 2023 07:14:14 +0100 Subject: [PATCH] [parsing] support comment end tag '--!>' as suggested by github-advanced-security bot --- test/test_parsing.py | 2 +- yt_dlp/parsing.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_parsing.py b/test/test_parsing.py index 0e006298f..9641df91d 100644 --- a/test/test_parsing.py +++ b/test/test_parsing.py @@ -343,7 +343,7 @@ class TestParsing(unittest.TestCase): -----------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------- this is a leftover comment --> and end + here is and end ----------------^^^^^^^^^^^----------------^^^^^^^^^^^^^^^^^--------- --------^^^^^^^^^^^^^-----------------------------^^^^^^^^^^--------- diff --git a/yt_dlp/parsing.py b/yt_dlp/parsing.py index f4aaf1ac4..72d7e448b 100644 --- a/yt_dlp/parsing.py +++ b/yt_dlp/parsing.py @@ -20,7 +20,7 @@ class HTMLIgnoreRanges: if offset in ranges: ... """ - REGEX = re.compile(r'|]*>', flags=re.IGNORECASE) + REGEX = re.compile(r'': + if match_string.startswith('', '--!>'): return offset < self._last_match.start() return offset >= self._last_match.end()