summary refs log tree commit diff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-05-31 01:23:58 +0600
committerSergey M․ <dstftw@gmail.com>2015-05-31 01:23:58 +0600
commit1ddb9456c4a63a207ec40bd74cdf0b36d8c68409 (patch)
tree00f4c20ba5f01fcc6f7b96952203ae402e419474
parent58bde34a236ff98f25fc109a94b3d393f0bbc9ee (diff)
downloadyoutube-dl-1ddb9456c4a63a207ec40bd74cdf0b36d8c68409.tar.gz
youtube-dl-1ddb9456c4a63a207ec40bd74cdf0b36d8c68409.tar.xz
youtube-dl-1ddb9456c4a63a207ec40bd74cdf0b36d8c68409.zip
[extractor/generic] Use compat_urllib_parse_unquote for unquoting video_id and title from URL
-rw-r--r--youtube_dl/extractor/generic.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py
index ec1d9abbe..d9116ce10 100644
--- a/youtube_dl/extractor/generic.py
+++ b/youtube_dl/extractor/generic.py
@@ -9,9 +9,10 @@ from .common import InfoExtractor
 from .youtube import YoutubeIE
 from ..compat import (
     compat_urllib_parse,
+    compat_urllib_parse_unquote,
+    compat_urllib_request,
     compat_urlparse,
     compat_xml_parse_error,
-    compat_urllib_request,
 )
 from ..utils import (
     determine_ext,
@@ -895,7 +896,7 @@ class GenericIE(InfoExtractor):
             force_videoid = smuggled_data['force_videoid']
             video_id = force_videoid
         else:
-            video_id = os.path.splitext(compat_urllib_parse.unquote(url.rstrip('/').split('/')[-1]))[0]
+            video_id = compat_urllib_parse_unquote(os.path.splitext(url.rstrip('/').split('/')[-1])[0])
 
         self.to_screen('%s: Requesting header' % video_id)
 
@@ -930,7 +931,7 @@ class GenericIE(InfoExtractor):
                 head_response.headers.get('Last-Modified'))
             return {
                 'id': video_id,
-                'title': os.path.splitext(compat_urllib_parse.unquote(url_basename(url)))[0],
+                'title': compat_urllib_parse_unquote(os.path.splitext(url_basename(url))[0]),
                 'direct': True,
                 'formats': [{
                     'format_id': m.group('format_id'),
@@ -966,7 +967,7 @@ class GenericIE(InfoExtractor):
                 head_response.headers.get('Last-Modified'))
             return {
                 'id': video_id,
-                'title': os.path.splitext(compat_urllib_parse.unquote(url_basename(url)))[0],
+                'title': compat_urllib_parse_unquote(os.path.splitext(url_basename(url))[0]),
                 'direct': True,
                 'url': url,
                 'upload_date': upload_date,