mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-03 09:23:47 -04:00
[cleanup] Use _html_extract_title
This commit is contained in:
@@ -534,13 +534,13 @@ Extracting variables is acceptable for reducing code duplication and improving r
|
||||
Correct:
|
||||
|
||||
```python
|
||||
title = self._html_search_regex(r'<title>([^<]+)</title>', webpage, 'title')
|
||||
title = self._html_search_regex(r'<h1>([^<]+)</h1>', webpage, 'title')
|
||||
```
|
||||
|
||||
Incorrect:
|
||||
|
||||
```python
|
||||
TITLE_RE = r'<title>([^<]+)</title>'
|
||||
TITLE_RE = r'<h1>([^<]+)</h1>'
|
||||
# ...some lines of code...
|
||||
title = self._html_search_regex(TITLE_RE, webpage, 'title')
|
||||
```
|
||||
|
Reference in New Issue
Block a user