about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-08-02 12:21:28 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-08-02 12:21:28 +0200
commit03cc7c20c1baae0e3642b85e8b0f240ff2105c38 (patch)
treeb17632ae8a041be8d8ff66aa821121aa31143c37
parent4075311d94dbc3d7d8b1f1afb5ebedbbf60253fc (diff)
downloadyoutube-dl-03cc7c20c1baae0e3642b85e8b0f240ff2105c38.tar.gz
youtube-dl-03cc7c20c1baae0e3642b85e8b0f240ff2105c38.tar.xz
youtube-dl-03cc7c20c1baae0e3642b85e8b0f240ff2105c38.zip
[youtube] show which formats are in 3D with "-F" and in the format field
-rw-r--r--youtube_dl/extractor/youtube.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index c08387c27..31c5bebdc 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -221,6 +221,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
         '132': '240p',
         '151': '72p',
     }
+    _3d_itags = ['85', '84', '102', '83', '101', '82', '100']
     IE_NAME = u'youtube'
     _TESTS = [
         {
@@ -467,7 +468,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
     def _print_formats(self, formats):
         print('Available formats:')
         for x in formats:
-            print('%s\t:\t%s\t[%s]' %(x, self._video_extensions.get(x, 'flv'), self._video_dimensions.get(x, '???')))
+            print('%s\t:\t%s\t[%s]%s' %(x, self._video_extensions.get(x, 'flv'),
+                                        self._video_dimensions.get(x, '???'),
+                                        ' (3D)' if x in self._3d_itags else ''))
 
     def _extract_id(self, url):
         mobj = re.match(self._VALID_URL, url, re.VERBOSE)
@@ -751,8 +754,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
             # Extension
             video_extension = self._video_extensions.get(format_param, 'flv')
 
-            video_format = '{0} - {1}'.format(format_param if format_param else video_extension,
-                                              self._video_dimensions.get(format_param, '???'))
+            video_format = '{0} - {1}{2}'.format(format_param if format_param else video_extension,
+                                              self._video_dimensions.get(format_param, '???'),
+                                              ' (3D)' if format_param in self._3d_itags else '')
 
             results.append({
                 'id':       video_id,