]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[youporn] Fix title extraction (closes #13456)
authorSergey M․ <dstftw@gmail.com>
Wed, 21 Jun 2017 17:20:45 +0000 (00:20 +0700)
committerSergey M․ <dstftw@gmail.com>
Wed, 21 Jun 2017 17:20:45 +0000 (00:20 +0700)
youtube_dl/extractor/youporn.py

index 34ab878a4167580b50ef5b3d5bee94e58b02fe41..7bc2cefc736e3cc226564f95116768c15c712239 100644 (file)
@@ -68,9 +68,12 @@ class YouPornIE(InfoExtractor):
         webpage = self._download_webpage(request, display_id)
 
         title = self._search_regex(
-            [r'(?:video_titles|videoTitle)\s*[:=]\s*(["\'])(?P<title>.+?)\1',
-             r'<h1[^>]+class=["\']heading\d?["\'][^>]*>([^<])<'],
-            webpage, 'title', group='title')
+            [r'(?:video_titles|videoTitle|title)\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 = []