[ard] Quote path part instead of whole URL encode
authorSergey M․ <dstftw@gmail.com>
Thu, 31 Jul 2014 14:23:15 +0000 (21:23 +0700)
committerSergey M․ <dstftw@gmail.com>
Thu, 31 Jul 2014 14:23:15 +0000 (21:23 +0700)
youtube_dl/extractor/ard.py

index 7ee2ef46314d41ba08f96cacf834f63bcbd263ea..957bdefcbec7666473530815df9e3eb5dc88e096 100644 (file)
@@ -8,6 +8,8 @@ from ..utils import (
     determine_ext,
     ExtractorError,
     qualities,
+    compat_urllib_parse_urlparse,
+    compat_urllib_parse,
 )
 
 
@@ -44,7 +46,10 @@ class ARDIE(InfoExtractor):
         else:
             video_id = m.group('video_id')
 
-        webpage = self._download_webpage(url.encode('utf-8'), video_id)
+        urlp = compat_urllib_parse_urlparse(url)
+        url = urlp._replace(path=compat_urllib_parse.quote(urlp.path.encode('utf-8'))).geturl()
+
+        webpage = self._download_webpage(url, video_id)
 
         title = self._html_search_regex(
             [r'<h1(?:\s+class="boxTopHeadline")?>(.*?)</h1>',