From 2a0d9305f401993a66a2da4342df999f3c67d02a Mon Sep 17 00:00:00 2001 From: memo Date: Sat, 13 Mar 2021 11:58:07 +0100 Subject: [PATCH] [tagesschau] fix deprecation warning about inline regex flags The warning during test_download: DeprecationWarning: Flags not at the start of the expression '(?s)]+class="in' (truncated) --- youtube_dl/extractor/tagesschau.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/youtube_dl/extractor/tagesschau.py b/youtube_dl/extractor/tagesschau.py index 3e1608936..02871d349 100644 --- a/youtube_dl/extractor/tagesschau.py +++ b/youtube_dl/extractor/tagesschau.py @@ -380,13 +380,13 @@ class TagesschauIE(InfoExtractor): # Some old pages still use the old format, so we keep the previous # extractor for now. def _legacy_extract(self, webpage, display_id, title, webpage_type): - DOWNLOAD_REGEX = r'(?s)

Wir bieten dieses (?PVideo|Audio) in folgenden Formaten zum Download an:

\s*
(?P.*?)
\s*

' + DOWNLOAD_REGEX = r'

Wir bieten dieses (?PVideo|Audio) in folgenden Formaten zum Download an:

\s*
(?P.*?)
\s*

' if webpage_type == 'website': # Article entries = [] for num, (entry_title, media_kind, download_text) in enumerate(re.findall( - r'(?s)]+class="infotext"[^>]*>\s*(?:]+>)?\s*(.+?).*?

.*?%s' % DOWNLOAD_REGEX, - webpage), 1): + r']+class="infotext"[^>]*>\s*(?:]+>)?\s*(.+?).*?

.*?%s' % DOWNLOAD_REGEX, + webpage, flags=re.S), 1): entries.append({ 'id': '%s-%d' % (display_id, num), 'title': '%s' % entry_title, @@ -397,9 +397,9 @@ class TagesschauIE(InfoExtractor): formats = entries[0]['formats'] else: # Assume single video download_text = self._search_regex( - DOWNLOAD_REGEX, webpage, 'download links', group='links') + DOWNLOAD_REGEX, webpage, 'download links', flags=re.S, group='links') media_kind = self._search_regex( - DOWNLOAD_REGEX, webpage, 'media kind', default='Video', group='kind') + DOWNLOAD_REGEX, webpage, 'media kind', default='Video', flags=re.S, group='kind') formats = self._legacy_extract_formats(download_text, media_kind) thumbnail = self._og_search_thumbnail(webpage) description = self._html_search_regex(