]> Raphaël G. Git Repositories - youtubedl/commitdiff
Imported Upstream version 2010.07.24
authorRogério Brito <rbrito@ime.usp.br>
Sat, 18 Jun 2011 05:16:56 +0000 (02:16 -0300)
committerRogério Brito <rbrito@ime.usp.br>
Sat, 18 Jun 2011 05:16:56 +0000 (02:16 -0300)
.hg_archival.txt
.hgtags
LATEST_VERSION
youtube-dl

index 90bb24d2a985f5f214882a835f88bdd01ac9f140..9cc379583bd23b55d6d8298a8f0c34f64d67f961 100644 (file)
@@ -1,2 +1,2 @@
 repo: f87cf8f2527c4adda57b14bd79a354f815164a41
-node: de50210f6416533d848b341642ad0c8193e22213
+node: 09a81c91ccebf3d9539c171e43e6e45e1dfbe6b8
diff --git a/.hgtags b/.hgtags
index 59e611dbb2b6a41c5c21deb2d3f9f152a3a653e7..ee712c19c6cc137a4be9851309dd20c81f4cd7a4 100644 (file)
--- a/.hgtags
+++ b/.hgtags
@@ -50,3 +50,4 @@ a44566779488ca70b9e1e7cf163e623744139a28 2010.07.14
 0000000000000000000000000000000000000000 2010.07.14
 0000000000000000000000000000000000000000 2010.07.14
 ad0c03e542656d8831c4ed3acda7de11d1c3f1c6 2010.07.14
+de50210f6416533d848b341642ad0c8193e22213 2010.07.22
index f3f4e8fab377a31e1bf3cffcdf5534dada3788a1..960388100cc27f156b671d4aa4da9f1dcd1e269b 100644 (file)
@@ -1 +1 @@
-2010.07.22
+2010.07.24
index 5fd331e79720bb0e50d92efaa336cad01706f6d0..48c13b701cce6d13382eae08e84b25cf60396600 100755 (executable)
@@ -878,7 +878,13 @@ class YoutubeIE(InfoExtractor):
                        if mobj is not None:
                                video_description = mobj.group(1)
 
+               # token
+               video_token = urllib.unquote_plus(video_info['token'][0])
+
                # Decide which formats to download
+               requested_format = self._downloader.params.get('format', None)
+               get_video_template = 'http://www.youtube.com/get_video?video_id=%s&t=%s&eurl=&el=&ps=&asv=&fmt=%%s' % (video_id, video_token)
+
                if 'fmt_url_map' in video_info:
                        url_map = dict(tuple(pair.split('|')) for pair in video_info['fmt_url_map'][0].split(','))
                        format_limit = self._downloader.params.get('format_limit', None)
@@ -890,19 +896,17 @@ class YoutubeIE(InfoExtractor):
                        if len(existing_formats) == 0:
                                self._downloader.trouble(u'ERROR: no known formats available for video')
                                return
-                       requested_format = self._downloader.params.get('format', None)
                        if requested_format is None:
-                               video_url_list = [(existing_formats[0], url_map[existing_formats[0]])] # Best quality
+                               video_url_list = [(existing_formats[0], get_video_template % existing_formats[0])] # Best quality
                        elif requested_format == '-1':
-                               video_url_list = url_map.items() # All formats
+                               video_url_list = [(f, get_video_template % f) for f in existing_formats] # All formats
                        else:
-                               if requested_format not in existing_formats:
-                                       self._downloader.trouble(u'ERROR: format not available for video')
-                                       return
-                               video_url_list = [(requested_format, url_map[requested_format])] # Specific format
+                               video_url_list = [(requested_format, get_video_template % requested_format)] # Specific format
+
                elif 'conn' in video_info and video_info['conn'][0].startswith('rtmp'):
                        self.report_rtmp_download()
                        video_url_list = [(None, video_info['conn'][0])]
+
                else:
                        self._downloader.trouble(u'ERROR: no fmt_url_map or conn information found in video info')
                        return
@@ -930,7 +934,7 @@ class YoutubeIE(InfoExtractor):
                                        'player_url':   player_url,
                                })
                        except UnavailableVideoError, err:
-                               self._downloader.trouble(u'ERROR: unable to download video')
+                               self._downloader.trouble(u'ERROR: unable to download video (format may not be available)')
 
 
 class MetacafeIE(InfoExtractor):
@@ -2064,7 +2068,7 @@ if __name__ == '__main__':
                # Parse command line
                parser = optparse.OptionParser(
                        usage='Usage: %prog [options] url...',
-                       version='2010.07.22',
+                       version='2010.07.24',
                        conflict_handler='resolve',
                )