Skip to content

Commit

Permalink
[YouPornIE] Make webpage download more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhxeo committed Oct 26, 2013
1 parent 7df2865 commit 6e76104
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion youtube_dl/extractor/youporn.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
)

class YouPornIE(InfoExtractor):
_VALID_URL = r'^(?:https?://)?(?:\w+\.)?youporn\.com/watch/(?P<videoid>[0-9]+)/(?P<title>[^/]+)'
_VALID_URL = r'^(?:https?://)?(?:www\.)?(?P<url>youporn\.com/watch/(?P<videoid>[0-9]+)/(?P<title>[^/]+))'
_TEST = {
u'url': u'http://www.youporn.com/watch/505835/sex-ed-is-it-safe-to-masturbate-daily/',
u'file': u'505835.mp4',
Expand All @@ -34,6 +34,7 @@ class YouPornIE(InfoExtractor):
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('videoid')
url = 'http://www.' + mobj.group('url')

req = compat_urllib_request.Request(url)
req.add_header('Cookie', 'age_verified=1')
Expand Down

0 comments on commit 6e76104

Please sign in to comment.