Browse Source

[pornhub:playlistbase] Do not include videos not from playlist

master
Sergey M․ 8 years ago
parent
commit
3a23bae9cc
1 changed files with 6 additions and 3 deletions
  1. 9
      youtube_dl/extractor/pornhub.py

9
youtube_dl/extractor/pornhub.py

@ -150,9 +150,12 @@ class PornHubIE(InfoExtractor):
class PornHubPlaylistBaseIE(InfoExtractor): class PornHubPlaylistBaseIE(InfoExtractor):
def _extract_entries(self, webpage): def _extract_entries(self, webpage):
return [ 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): def _real_extract(self, url):

Loading…
Cancel
Save