fix regular search pattern for title

_html_search_regex() has default fatal=True: add a default to fall back to _og_search_title()

allow line break in .*

Co-authored-by: dirkf <fieldhouse@gmx.net>
This commit is contained in:
changren-wcr 2022-06-16 19:12:26 +08:00 committed by GitHub
parent 87706c5ec8
commit 9a421b4e7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,7 @@ class QingTingIE(InfoExtractor):
def _real_extract(self, url):
video_id = re.search(self._VALID_URL, url).group('id')
webpage = self._download_webpage(url, video_id)
title = self._html_search_regex(r'<title.*>(.*)</title>', webpage, 'title') or self._og_search_title(webpage)
title = self._html_search_regex(r'(?s)<title\b[^>]*>(.*)</title>', webpage, 'title', default=None) or self._og_search_title(webpage)
url = self._search_regex(
r'''("|')audioUrl\1\s*:\s*("|')(?P<url>(?:(?!\2).)*)\2''',
webpage, 'audio URL')