]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[pornhub:playlistbase] Do not include videos not from playlist
authorSergey M․ <dstftw@gmail.com>
Sun, 27 Mar 2016 18:32:57 +0000 (00:32 +0600)
committerSergey M․ <dstftw@gmail.com>
Sun, 27 Mar 2016 18:32:57 +0000 (00:32 +0600)
youtube_dl/extractor/pornhub.py

index 670e9294a81ac18c09db9469e124f6d2911572c9..b3bf81a13c6b5996329eef575bca29bc12dce1eb 100644 (file)
@@ -150,9 +150,12 @@ class PornHubIE(InfoExtractor):
 class PornHubPlaylistBaseIE(InfoExtractor):
     def _extract_entries(self, webpage):
         return [
-            self.url_result('http://www.pornhub.com/%s' % video_url, PornHubIE.ie_key())
-            for video_url in orderedSet(re.findall(
-                r'href="/?(view_video\.php\?.*\bviewkey=[\da-z]+[^"]*)"', webpage))
+            self.url_result(
+                'http://www.pornhub.com/%s' % video_url,
+                PornHubIE.ie_key(), video_title=title)
+            for video_url, title in orderedSet(re.findall(
+                r'href="/?(view_video\.php\?.*\bviewkey=[\da-z]+[^"]*)"[^>]*\s+title="([^"]+)"',
+                webpage))
         ]
 
     def _real_extract(self, url):