From a5ec30e106eda4a4a39e671a3f0c1e82656d260e Mon Sep 17 00:00:00 2001 From: Zenon Mousmoulas Date: Sat, 13 Nov 2021 08:41:23 +0200 Subject: [PATCH] Address PR comments about escapes --- youtube_dl/extractor/megatvcom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/megatvcom.py b/youtube_dl/extractor/megatvcom.py index 119ae5d57..f3faeb78b 100644 --- a/youtube_dl/extractor/megatvcom.py +++ b/youtube_dl/extractor/megatvcom.py @@ -28,7 +28,7 @@ class MegaTVComBaseIE(InfoExtractor): def _extract_player_attrs(self, webpage): PLAYER_DIV_RE = r'''(?x) [\"\'])(?P<%(pdi)s>%(pdi)s)(?P=_q1)| + id=(?P<_q1>["'])(?P<%(pdi)s>%(pdi)s)(?P=_q1)| [^>]*? )+> ''' % {'pdi': self._PLAYER_DIV_ID} @@ -78,7 +78,7 @@ class MegaTVComIE(MegaTVComBaseIE): def _match_article_id(self, webpage): ART_RE = r'''(?x) [\"\'])Article_(?P
\d+)(?P=_q2)| + id=(?P<_q2>["'])Article_(?P
\d+)(?P=_q2)| [^>]*? )+> ''' @@ -124,7 +124,7 @@ class MegaTVComIE(MegaTVComBaseIE): class MegaTVComEmbedIE(MegaTVComBaseIE): IE_NAME = 'megatvcom:embed' IE_DESC = 'megatv.com embedded videos' - _VALID_URL = r'https?://(?:www\.)?megatv.com/embed/?\?p=\d+' + _VALID_URL = r'https?://(?:www\.)?megatv\.com/embed/?\?p=\d+' _TESTS = [{ 'url': 'https://www.megatv.com/embed/?p=2020520979', @@ -157,7 +157,7 @@ class MegaTVComEmbedIE(MegaTVComBaseIE): EMBED_RE = r'''(?x) ]+?src=(?P<_q1>%(quot_re)s) (?P%(url_re)s)(?P=_q1) - ''' % {'quot_re': r'[\"\']', 'url_re': _URL_RE} + ''' % {'quot_re': r'["\']', 'url_re': _URL_RE} for mobj in re.finditer(EMBED_RE, webpage): if url.startswith('//'): scheme = compat_urllib_parse_urlparse(origin_url).scheme \