Repository: yt-dlp/yt-dlp

Issue:
[Bilibili] Unable to extract title
### Checklist

- [X] I'm reporting a bug unrelated to a specific site
- [X] I've verified that I'm running yt-dlp version **2021.11.10.1**. ([update instructions](https://github.com/yt-dlp/yt-dlp#update))
- [X] I've checked that all provided URLs are alive and playable in a browser
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/ytdl-org/youtube-dl#video-url-contains-an-ampersand-and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues including closed ones. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)

### Description

As the title said

### Verbose log

```shell
yt-dlp -F --verbose https://www.bilibili.com/s/video/BV1fx411b7pp
[debug] Command-line config: ['-F', '--verbose', 'https://www.bilibili.com/s/video/BV1fx411b7pp']
[debug] Home config file: yt-dlp.conf
[debug] Home config: ['-4', '--geo-bypass', '-N', '20', '-S', 'fps,tbr', '--downloader', 'aria2c', '--add-metadata', '--parse-metadata', ':(?P<meta_comment>)(?P<meta_description>)(?P<meta_synopsis>)', '--embed-subs', '--sub-lang', 'en,en-US', '--embed-thumbnail', '-o', 'E:/Data/ytdl/%(title)s.%(ext)s', '-f', 'bv*[height<=720]+ba/bv*[height<=720]/b', '--remux-video', 'mkv']
[debug] User config file: ...\yt-dlp.conf
[debug] User config: ['-4', '--geo-bypass', '-N', '20', '-S', 'fps,tbr', '--downloader', 'aria2c', '--add-metadata', '--parse-metadata', ':(?P<meta_comment>)(?P<meta_description>)(?P<meta_synopsis>)', '--embed-subs', '--sub-lang', 'en,en-US', '--embed-thumbnail', '-o', 'E:/Data/ytdl/%(title)s.%(ext)s', '-f', 'bv*[height<=720]+ba/bv*[height<=720]/b', '--remux-video', 'mkv']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, err utf-8, pref cp1252
[debug] yt-dlp version 2021.11.10.1
[debug] Lazy loading extractors is disabled
[debug] Python version 3.9.8 (CPython 64bit) - Windows-10-10.0.19044
[debug] exe versions: ffmpeg 2021-11-15-git-9e8cdb24cd-essentials_build-www.gyan.dev (setts), ffprobe 2021-11-15-git-9e8cdb24cd-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
[debug] [BiliBili] Extracting URL: https://www.bilibili.com/s/video/BV1fx411b7pp
[BiliBili] 1fx411b7pp: Grabbing original ID via API
[BiliBili] 13763293: Downloading webpage
ERROR: [BiliBili] Unable to extract title; please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; see  https://github.com/yt-dlp/yt-dlp  on how to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.; please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; see  https://github.com/yt-dlp/yt-dlp  on how to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "...\yt_dlp\extractor\common.py", line 596, in extract
    ie_result = self._real_extract(url)
  File "...\yt_dlp\extractor\bilibili.py", line 161, in _real_extract
    r = self._extract_anthology_entries(bv_id, video_id, webpage)
  File "...\yt_dlp\extractor\bilibili.py", line 347, in _extract_anthology_entries
    title = self._html_search_regex(
  File "...\yt_dlp\extractor\common.py", line 1176, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "...\yt_dlp\extractor\common.py", line 1167, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
yt_dlp.utils.RegexNotFoundError: Unable to extract title; please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; see  https://github.com/yt-dlp/yt-dlp  on how to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "...\yt_dlp\extractor\common.py", line 596, in extract
    ie_result = self._real_extract(url)
  File "...\yt_dlp\extractor\bilibili.py", line 161, in _real_extract
    r = self._extract_anthology_entries(bv_id, video_id, webpage)
  File "...\yt_dlp\extractor\bilibili.py", line 347, in _extract_anthology_entries
    title = self._html_search_regex(
  File "...\yt_dlp\extractor\common.py", line 1176, in _html_search_regex
    res = self._search_regex(pattern, string, name, default, fatal, flags, group)
  File "...\yt_dlp\extractor\common.py", line 1167, in _search_regex
    raise RegexNotFoundError('Unable to extract %s' % _name)
yt_dlp.utils.RegexNotFoundError: Unable to extract title; please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; see  https://github.com/yt-dlp/yt-dlp  on how to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "...\yt_dlp\YoutubeDL.py", line 1317, in wrapper
    return func(self, *args, **kwargs)
  File "...\yt_dlp\YoutubeDL.py", line 1342, in __extract_info
    ie_result = ie.extract(url)
  File "...\yt_dlp\extractor\common.py", line 622, in extract
    raise type(e)(e.msg, **kwargs)
yt_dlp.utils.RegexNotFoundError: [BiliBili] Unable to extract title; please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; see  https://github.com/yt-dlp/yt-dlp  on how to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.; please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; see  https://github.com/yt-dlp/yt-dlp  on how to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.
```



Discussion:

Resolving patch:
diff --git a/yt_dlp/extractor/bilibili.py b/yt_dlp/extractor/bilibili.py
--- a/yt_dlp/extractor/bilibili.py
+++ b/yt_dlp/extractor/bilibili.py
@@ -346,7 +346,8 @@ def _real_extract(self, url):
     def _extract_anthology_entries(self, bv_id, video_id, webpage):
         title = self._html_search_regex(
             (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')
         json_data = self._download_json(
             f'https://api.bilibili.com/x/player/pagelist?bvid={bv_id}&jsonp=jsonp',


Test patch: