From 9e167e1ee311b43dbe9c3911bd0a79f0db15efef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Fri, 9 Feb 2018 21:17:02 +0700 Subject: [PATCH] [newgrounds] Fix metadata extraction (closes #15531) --- youtube_dl/extractor/newgrounds.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/youtube_dl/extractor/newgrounds.py b/youtube_dl/extractor/newgrounds.py index 0e26f8399..82e7cf522 100644 --- a/youtube_dl/extractor/newgrounds.py +++ b/youtube_dl/extractor/newgrounds.py @@ -87,19 +87,21 @@ def _real_extract(self, url): self._check_formats(formats, media_id) self._sort_formats(formats) - uploader = self._search_regex( - r'(?:Author|Writer)\s*]+>([^<]+)', webpage, 'uploader', + uploader = self._html_search_regex( + (r'(?s)]*>(.+?).*?\s*Author\s*', + r'(?:Author|Writer)\s*]+>([^<]+)'), webpage, 'uploader', fatal=False) - timestamp = unified_timestamp(self._search_regex( - r'
Uploaded
\s*
([^<]+)', webpage, 'timestamp', + timestamp = unified_timestamp(self._html_search_regex( + (r'
\s*Uploaded\s*
\s*
([^<]+
\s*
[^<]+)', + r'
\s*Uploaded\s*
\s*
([^<]+)'), webpage, 'timestamp', default=None)) duration = parse_duration(self._search_regex( - r'
Song\s*
.+?
([^<]+)', webpage, 'duration', - default=None)) + r'(?s)
\s*Song\s*
\s*
.+?
\s*
([^<]+)', webpage, + 'duration', default=None)) filesize_approx = parse_filesize(self._html_search_regex( - r'
Song\s*
(.+?)
', webpage, 'filesize', + r'(?s)
\s*Song\s*
\s*
(.+?)
', webpage, 'filesize', default=None)) if len(formats) == 1: formats[0]['filesize_approx'] = filesize_approx