[Bilibili] Fix title extraction (#1716)

Closes #1714
Authored by: u-spec-png
This commit is contained in:
u-spec-png 2021-11-30 16:18:46 +00:00 committed by GitHub
parent 73f035e1fe
commit ac0efabf12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -346,7 +346,8 @@ def _real_extract(self, url):
def _extract_anthology_entries(self, bv_id, video_id, webpage): def _extract_anthology_entries(self, bv_id, video_id, webpage):
title = self._html_search_regex( title = self._html_search_regex(
(r'<h1[^>]+\btitle=(["\'])(?P<title>(?:(?!\1).)+)\1', (r'<h1[^>]+\btitle=(["\'])(?P<title>(?:(?!\1).)+)\1',
r'(?s)<h1[^>]*>(?P<title>.+?)</h1>'), webpage, 'title', r'(?s)<h1[^>]*>(?P<title>.+?)</h1>',
r'<title>(?P<title>.+?)</title>'), webpage, 'title',
group='title') group='title')
json_data = self._download_json( json_data = self._download_json(
f'https://api.bilibili.com/x/player/pagelist?bvid={bv_id}&jsonp=jsonp', f'https://api.bilibili.com/x/player/pagelist?bvid={bv_id}&jsonp=jsonp',