aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-04-24 14:44:27 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-04-24 14:44:27 +0200
commita980bc4324094e6869e05b8ddf22c7d4d87088cf (patch)
tree0b8cfdb7f161594a56f4319facee7308dbed977b /youtube_dl/extractor
parent4b10aadffc120b0b6ee8f150f1f319e1cce853a7 (diff)
[vimeo] Fix logging in python 3.x
The POST data must be a bytes object.
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/vimeo.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py
index bb08c6150..8befb4a4f 100644
--- a/youtube_dl/extractor/vimeo.py
+++ b/youtube_dl/extractor/vimeo.py
@@ -17,6 +17,7 @@ from ..utils import (
RegexNotFoundError,
std_headers,
unsmuggle_url,
+ urlencode_postdata,
)
@@ -119,12 +120,13 @@ class VimeoIE(SubtitlesInfoExtractor):
login_url = 'https://vimeo.com/log_in'
webpage = self._download_webpage(login_url, None, False)
token = self._search_regex(r'xsrft: \'(.*?)\'', webpage, 'login token')
- data = compat_urllib_parse.urlencode({'email': username,
- 'password': password,
- 'action': 'login',
- 'service': 'vimeo',
- 'token': token,
- })
+ data = urlencode_postdata({
+ 'email': username,
+ 'password': password,
+ 'action': 'login',
+ 'service': 'vimeo',
+ 'token': token,
+ })
login_request = compat_urllib_request.Request(login_url, data)
login_request.add_header('Content-Type', 'application/x-www-form-urlencoded')
login_request.add_header('Cookie', 'xsrft=%s' % token)