mirror of
https://github.com/l1ving/youtube-dl
synced 2020-11-18 19:53:54 -08:00
[YouPorn] Make title regex more specific.
Safe to drop _search_regex? _og_search_title also finds the correct title.
This commit is contained in:
parent
de0359c0af
commit
89df890214
@ -68,13 +68,13 @@ class YouPornIE(InfoExtractor):
|
||||
request.add_header('Cookie', 'age_verified=1')
|
||||
webpage = self._download_webpage(request, display_id)
|
||||
|
||||
title = self._search_regex(
|
||||
[r'(?:video_titles|videoTitle)\s*[:=]\s*(["\'])(?P<title>(?:(?!\1).)+)\1',
|
||||
r'<h1[^>]+class=["\']heading\d?["\'][^>]*>(?P<title>[^<]+)<'],
|
||||
webpage, 'title', group='title',
|
||||
default=None) or self._og_search_title(
|
||||
webpage, default=None) or self._html_search_meta(
|
||||
'title', webpage, fatal=True)
|
||||
title = self._search_regex([
|
||||
r'[=:]\s*(["\'])video[\._-]titles?\1[^>]*>\s*<\s*h1[^>]+class=["\']heading\d?["\'][^>]*>(?P<title>[^<]+)<',
|
||||
r'(?:video_titles|videoTitle)\s*[:=]\s*(["\'])(?P<title>(?:(?!\1).)+)\1',
|
||||
#r'<h1[^>]+class=["\']heading\d?["\'][^>]*>(?P<title>[^<]+)<',
|
||||
], webpage, 'title', group='title', default=None) \
|
||||
or self._og_search_title(webpage, default=None) \
|
||||
or self._html_search_meta('title', webpage, fatal=True)
|
||||
|
||||
links = []
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user