diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-06-13 03:24:36 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-06-13 03:24:36 +0600 |
commit | 9fcbd5db2abb5a56beefe4a64486da692705ad12 (patch) | |
tree | 8f75a07057bd470dc18f14a0eb0fdd1a5969bce6 /youtube_dl | |
parent | 4f3bf679f5a764f7a26d3c45c82be43e34a3cc4d (diff) |
[pornhub] Add support for embeds
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/pornhub.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/youtube_dl/extractor/pornhub.py b/youtube_dl/extractor/pornhub.py index daa284ea2..3c99b4def 100644 --- a/youtube_dl/extractor/pornhub.py +++ b/youtube_dl/extractor/pornhub.py @@ -19,7 +19,7 @@ from ..aes import ( class PornHubIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?pornhub\.com/view_video\.php\?viewkey=(?P<id>[0-9a-f]+)' + _VALID_URL = r'https?://(?:www\.)?pornhub\.com/(?:view_video\.php\?viewkey=|embed/)(?P<id>[0-9a-f]+)' _TEST = { 'url': 'http://www.pornhub.com/view_video.php?viewkey=648719015', 'md5': '882f488fa1f0026f023f33576004a2ed', @@ -39,7 +39,8 @@ class PornHubIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) - req = compat_urllib_request.Request(url) + req = compat_urllib_request.Request( + 'http://www.pornhub.com/view_video.php?viewkey=%s' % video_id) req.add_header('Cookie', 'age_verified=1') webpage = self._download_webpage(req, video_id) |