From 0205c8ee28dc92232e8494fd4e61c749d03a7d53 Mon Sep 17 00:00:00 2001 From: gamer191 <83270075+gamer191@users.noreply.github.com> Date: Fri, 28 Jun 2024 22:45:40 +1000 Subject: [PATCH] FURB167 --- yt_dlp/extractor/mit.py | 2 +- yt_dlp/extractor/myvideoge.py | 2 +- yt_dlp/extractor/neteasemusic.py | 2 +- yt_dlp/jsinterp.py | 8 ++++---- yt_dlp/utils/_utils.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/yt_dlp/extractor/mit.py b/yt_dlp/extractor/mit.py index e75c540a23e5..ab068a2c2265 100644 --- a/yt_dlp/extractor/mit.py +++ b/yt_dlp/extractor/mit.py @@ -29,7 +29,7 @@ def _real_extract(self, url): video_id = self._match_id(url) raw_page = self._download_webpage( f'http://techtv.mit.edu/videos/{video_id}', video_id) - clean_page = re.compile(r'', re.S).sub('', raw_page) + clean_page = re.compile(r'', re.DOTALL).sub('', raw_page) base_url = self._proto_relative_url(self._search_regex( r'ipadUrl: \'(.+?cloudfront.net/)', raw_page, 'base url'), 'http:') diff --git a/yt_dlp/extractor/myvideoge.py b/yt_dlp/extractor/myvideoge.py index 3e0bb249957f..a4d322afcbe5 100644 --- a/yt_dlp/extractor/myvideoge.py +++ b/yt_dlp/extractor/myvideoge.py @@ -64,7 +64,7 @@ def _real_extract(self, url): # translate any ka month to an en one re.sub('|'.join(self._MONTH_NAMES_KA), lambda m: MONTH_NAMES['en'][self._MONTH_NAMES_KA.index(m.group(0))], - upload_date, flags=re.I)) + upload_date, flags=re.IGNORECASE)) if upload_date else None) return { diff --git a/yt_dlp/extractor/neteasemusic.py b/yt_dlp/extractor/neteasemusic.py index a759da2147d4..1b525001c3d3 100644 --- a/yt_dlp/extractor/neteasemusic.py +++ b/yt_dlp/extractor/neteasemusic.py @@ -328,7 +328,7 @@ def _real_extract(self, url): 'title': self._og_search_property('title', webpage, 'title', fatal=False), 'description': self._html_search_regex( (rf']+\bid="album-desc-{suffix}"[^>]*>(.*?)' for suffix in ('more', 'dot')), - webpage, 'description', flags=re.S, fatal=False), + webpage, 'description', flags=re.DOTALL, fatal=False), 'thumbnail': self._og_search_property('image', webpage, 'thumbnail', fatal=False), 'upload_date': unified_strdate(self._html_search_meta('music:release_date', webpage, 'date', fatal=False)), } diff --git a/yt_dlp/jsinterp.py b/yt_dlp/jsinterp.py index a0f32892fd68..55ad913f5756 100644 --- a/yt_dlp/jsinterp.py +++ b/yt_dlp/jsinterp.py @@ -205,10 +205,10 @@ class JSInterpreter: # TODO: new pattern class to execute matches with these flags 'd': 1024, # Generate indices for substring matches 'g': 2048, # Global search - 'i': re.I, # Case-insensitive search - 'm': re.M, # Multi-line search - 's': re.S, # Allows . to match newline characters - 'u': re.U, # Treat a pattern as a sequence of unicode code points + 'i': re.IGNORECASE, # Case-insensitive search + 'm': re.MULTILINE, # Multi-line search + 's': re.DOTALL, # Allows . to match newline characters + 'u': re.UNICODE, # Treat a pattern as a sequence of unicode code points 'y': 4096, # Perform a "sticky" search that matches starting at the current position in the target string } diff --git a/yt_dlp/utils/_utils.py b/yt_dlp/utils/_utils.py index 664675a09908..6fbc0f8b0afe 100644 --- a/yt_dlp/utils/_utils.py +++ b/yt_dlp/utils/_utils.py @@ -5118,7 +5118,7 @@ def orderedSet_from_options(options, alias_dict, *, use_regex=False, start=None) requested = orderedSet_from_options(val, alias_dict, start=requested) continue - current = (filter(re.compile(val, re.I).fullmatch, alias_dict['all']) if use_regex + current = (filter(re.compile(val, re.IGNORECASE).fullmatch, alias_dict['all']) if use_regex else [val] if val in alias_dict['all'] else None) if current is None: raise ValueError(val)