[pornhub] Use compat_urllib_parse.unquote_plus (#2531)
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sun, 9 Mar 2014 18:16:25 +0000 (19:16 +0100)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sun, 9 Mar 2014 18:16:25 +0000 (19:16 +0100)
youtube_dl/extractor/pornhub.py

index 6d1ffe6761300e07101ad1326e56bc7e84fd526c..834fe7266c4e0bd4bc56bcd9807ec80c2cee7f05 100644 (file)
@@ -44,7 +44,7 @@ class PornHubIE(InfoExtractor):
 
         video_urls = list(map(compat_urllib_parse.unquote , re.findall(r'"quality_[0-9]{3}p":"([^"]+)', webpage)))
         if webpage.find('"encrypted":true') != -1:
-            password = compat_urllib_request.unquote(self._html_search_regex(r'"video_title":"([^"]+)', webpage, 'password').replace('+', ' '))
+            password = compat_urllib_parse.unquote_plus(self._html_search_regex(r'"video_title":"([^"]+)', webpage, 'password'))
             video_urls = list(map(lambda s: aes_decrypt_text(s, password, 32).decode('utf-8'), video_urls))
 
         formats = []