diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-06-13 03:36:16 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-06-13 03:36:16 +0600 |
commit | 65d161c480e9964026e618a2e95f9fc9eb8119e7 (patch) | |
tree | 9fdd23a7198b55e555dedc4b584c3c7dd6aa1519 /youtube_dl/extractor/pornhub.py | |
parent | 9fcbd5db2abb5a56beefe4a64486da692705ad12 (diff) |
[extractor/generic] Add support for pornhub embeds
Diffstat (limited to 'youtube_dl/extractor/pornhub.py')
-rw-r--r-- | youtube_dl/extractor/pornhub.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/youtube_dl/extractor/pornhub.py b/youtube_dl/extractor/pornhub.py index 3c99b4def..8565d7551 100644 --- a/youtube_dl/extractor/pornhub.py +++ b/youtube_dl/extractor/pornhub.py @@ -32,6 +32,13 @@ class PornHubIE(InfoExtractor): } } + @classmethod + def _extract_url(cls, webpage): + mobj = re.search( + r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?pornhub\.com/embed/\d+)\1', webpage) + if mobj: + return mobj.group('url') + def _extract_count(self, pattern, webpage, name): return str_to_int(self._search_regex( pattern, webpage, '%s count' % name, fatal=False)) |