summary refs log tree commit diff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-05-30 23:16:14 +0600
committerSergey M․ <dstftw@gmail.com>2015-05-30 23:16:14 +0600
commit339516072be6865bf7e9316be81704ae69296c6b (patch)
tree1a59c561df574602f6041ebb261164ab3a487f0b
parent931bc3c3a719fe33101c05b9fdc4e6ad8eb08bdc (diff)
downloadyoutube-dl-339516072be6865bf7e9316be81704ae69296c6b.tar.gz
youtube-dl-339516072be6865bf7e9316be81704ae69296c6b.tar.xz
youtube-dl-339516072be6865bf7e9316be81704ae69296c6b.zip
[extractor/generic] Unescape video_id and title extracted from URL
-rw-r--r--youtube_dl/extractor/generic.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py
index 9a7b0d25d..c9c92d686 100644
--- a/youtube_dl/extractor/generic.py
+++ b/youtube_dl/extractor/generic.py
@@ -894,7 +894,7 @@ class GenericIE(InfoExtractor):
             force_videoid = smuggled_data['force_videoid']
             video_id = force_videoid
         else:
-            video_id = os.path.splitext(url.rstrip('/').split('/')[-1])[0]
+            video_id = os.path.splitext(compat_urllib_parse.unquote(url.rstrip('/').split('/')[-1]))[0]
 
         self.to_screen('%s: Requesting header' % video_id)
 
@@ -927,7 +927,7 @@ class GenericIE(InfoExtractor):
                 head_response.headers.get('Last-Modified'))
             return {
                 'id': video_id,
-                'title': os.path.splitext(url_basename(url))[0],
+                'title': os.path.splitext(compat_urllib_parse.unquote(url_basename(url)))[0],
                 'direct': True,
                 'formats': [{
                     'format_id': m.group('format_id'),
@@ -953,7 +953,7 @@ class GenericIE(InfoExtractor):
                 head_response.headers.get('Last-Modified'))
             return {
                 'id': video_id,
-                'title': os.path.splitext(url_basename(url))[0],
+                'title': os.path.splitext(compat_urllib_parse.unquote(url_basename(url)))[0],
                 'direct': True,
                 'url': url,
                 'upload_date': upload_date,