aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-02-21 18:00:25 +0600
committerSergey M․ <dstftw@gmail.com>2015-02-21 18:00:25 +0600
commitfad6768bd1a67dccbb153ac371d3e82575321ea9 (patch)
treed541ab2981d462ba9c3087b0d26a5cfbcf1751b3
parenta78125f925a1d350dbc1edee0e348f84e105be52 (diff)
downloadyoutube-dl-fad6768bd1a67dccbb153ac371d3e82575321ea9.tar.xz
[vimeo] Fix password protected videos (Closes #5001)
-rw-r--r--youtube_dl/extractor/vimeo.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py
index 78d287e0e..5f8649e35 100644
--- a/youtube_dl/extractor/vimeo.py
+++ b/youtube_dl/extractor/vimeo.py
@@ -4,6 +4,7 @@ from __future__ import unicode_literals
import json
import re
import itertools
+import hashlib
from .common import InfoExtractor
from .subtitles import SubtitlesInfoExtractor
@@ -225,6 +226,10 @@ class VimeoIE(VimeoBaseInfoExtractor, SubtitlesInfoExtractor):
if mobj.group('pro') or mobj.group('player'):
url = 'http://player.vimeo.com/video/' + video_id
+ password = self._downloader.params.get('videopassword', None)
+ if password:
+ headers['Cookie'] = '%s_password=%s' % (video_id, hashlib.md5(password).hexdigest())
+
# Retrieve video webpage to extract further information
request = compat_urllib_request.Request(url, None, headers)
try: