aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/common.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-04-04 13:57:35 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-04-04 15:13:30 +0530
commit04f3fd2c8948621612d852f8f68ef549a484bfb6 (patch)
tree236ab487dfe39d699b052daf06c62b71ea7daf6e /yt_dlp/extractor/common.py
parent85e801a9dbc671f97af92aebea18170e6a384374 (diff)
downloadhypervideo-pre-04f3fd2c8948621612d852f8f68ef549a484bfb6.tar.lz
hypervideo-pre-04f3fd2c8948621612d852f8f68ef549a484bfb6.tar.xz
hypervideo-pre-04f3fd2c8948621612d852f8f68ef549a484bfb6.zip
[cleanup] Use `_html_extract_title`
Diffstat (limited to 'yt_dlp/extractor/common.py')
-rw-r--r--yt_dlp/extractor/common.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py
index af964c527..81688eb54 100644
--- a/yt_dlp/extractor/common.py
+++ b/yt_dlp/extractor/common.py
@@ -1329,9 +1329,8 @@ class InfoExtractor(object):
def _og_search_description(self, html, **kargs):
return self._og_search_property('description', html, fatal=False, **kargs)
- def _og_search_title(self, html, **kargs):
- kargs.setdefault('fatal', False)
- return self._og_search_property('title', html, **kargs)
+ def _og_search_title(self, html, *, fatal=False, **kargs):
+ return self._og_search_property('title', html, fatal=fatal, **kargs)
def _og_search_video_url(self, html, name='video url', secure=True, **kargs):
regexes = self._og_regexes('video') + self._og_regexes('video:url')
@@ -1342,9 +1341,8 @@ class InfoExtractor(object):
def _og_search_url(self, html, **kargs):
return self._og_search_property('url', html, **kargs)
- def _html_extract_title(self, html, name, **kwargs):
- return self._html_search_regex(
- r'(?s)<title>(.*?)</title>', html, name, **kwargs)
+ def _html_extract_title(self, html, name='title', *, fatal=False, **kwargs):
+ return self._html_search_regex(r'(?s)<title>([^<]+)</title>', html, name, fatal=fatal, **kwargs)
def _html_search_meta(self, name, html, display_name=None, fatal=False, **kwargs):
name = variadic(name)