1
0
Fork 0
mirror of https://gitlab.com/dstftw/youtube-dl.git synced 2020-11-16 09:42:26 +00:00

[dumpert] Add nsfw cookie (Closes #5382)

This commit is contained in:
Sergey M․ 2015-04-09 19:53:00 +06:00
parent ce73839fe4
commit aa2af7ba74

View file

@ -4,6 +4,7 @@ from __future__ import unicode_literals
import base64 import base64
from .common import InfoExtractor from .common import InfoExtractor
from ..compat import compat_urllib_request
from ..utils import qualities from ..utils import qualities
@ -23,7 +24,10 @@ class DumpertIE(InfoExtractor):
def _real_extract(self, url): def _real_extract(self, url):
video_id = self._match_id(url) video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
req = compat_urllib_request.Request(url)
req.add_header('Cookie', 'nsfw=1')
webpage = self._download_webpage(req, video_id)
files_base64 = self._search_regex( files_base64 = self._search_regex(
r'data-files="([^"]+)"', webpage, 'data files') r'data-files="([^"]+)"', webpage, 'data files')