]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[pornhub] Don't override session cookies (closes #15697)
authorEitan Postavsky <35902204+epostavs@users.noreply.github.com>
Fri, 9 Mar 2018 16:57:32 +0000 (11:57 -0500)
committerSergey M <dstftw@gmail.com>
Fri, 9 Mar 2018 16:57:32 +0000 (23:57 +0700)
youtube_dl/extractor/pornhub.py

index 281a4f05e4600829a42bce31de8271f588aeae46..a7099bbbffe85e09659ec79acd2c384746c18e60 100644 (file)
@@ -114,13 +114,14 @@ class PornHubIE(InfoExtractor):
 
     def _real_extract(self, url):
         video_id = self._match_id(url)
+        
+        self._set_cookie('pornhub.com', 'age_verified', '1')
 
         def dl_webpage(platform):
+            self._set_cookie('pornhub.com', 'platform', platform)
             return self._download_webpage(
                 'http://www.pornhub.com/view_video.php?viewkey=%s' % video_id,
-                video_id, headers={
-                    'Cookie': 'age_verified=1; platform=%s' % platform,
-                })
+                video_id)
 
         webpage = dl_webpage('pc')