rpms/youtube-dl/devel Home, 1.4, 1.5 youtube-dl, 1.5, 1.6 youtube-dl.spec, 1.7, 1.8

Till Maas till at fedoraproject.org
Fri Jul 23 14:13:46 UTC 2010


Author: till

Update of /cvs/pkgs/rpms/youtube-dl/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv21335

Modified Files:
	Home youtube-dl youtube-dl.spec 
Log Message:
* Fri Jul 23 2010 Till Maas <opensource at till.name> - 2010.07.21-1
- Update to latest release



Index: Home
===================================================================
RCS file: /cvs/pkgs/rpms/youtube-dl/devel/Home,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- Home	15 Jul 2010 17:56:08 -0000	1.4
+++ Home	23 Jul 2010 14:13:45 -0000	1.5
@@ -105,7 +105,7 @@
 		date.setTime(date.getTime() + (365 * 24 * 60 * 60 * 1000));
 		var cookieoptions = { path: '/', expires: date };
 		
-		window._shard = 'fe01 (ID 1)';
+		window._shard = 'bfg02-gunicorn (ID 7)';
 		
 		$(document).ready(function(){
 			$('#toggle-repo-content').click(function(){
@@ -177,7 +177,7 @@
 		
 			
 				<li class="ui-tabs-nav-issues">
-					<a href="/rg3/youtube-dl/issues?status=new&amp;status=open"><span>Issues (12) &raquo;</span></a>
+					<a href="/rg3/youtube-dl/issues?status=new&amp;status=open"><span>Issues (17) &raquo;</span></a>
 					<ul>
 						<li><a href="/rg3/youtube-dl/issues?status=new">New issues</a></li>
 						<li><a href="/rg3/youtube-dl/issues?status=new&amp;status=open">Open issues</a></li>
@@ -196,11 +196,11 @@
 		
 		
 		<li class="tabs-right tabs-far-right">
-			<a href="/rg3/youtube-dl/descendants"><span>Forks/Queues (12)</span></a>
+			<a href="/rg3/youtube-dl/descendants"><span>Forks/Queues (11)</span></a>
 		</li>
 		
 		<li class="tabs-right">
-			<a href="/rg3/youtube-dl/zealots"><span>Followers (74)</span></a>
+			<a href="/rg3/youtube-dl/zealots"><span>Followers (78)</span></a>
 		</li>
 	</ul>
 </div>
@@ -235,9 +235,9 @@
 					<ul>
 						
 						
-							<li><a rel="nofollow" href="/rg3/youtube-dl/get/cfa6e63da22f.zip" class="zip">zip</a></li>
-							<li><a rel="nofollow" href="/rg3/youtube-dl/get/cfa6e63da22f.gz" class="compressed">gz</a></li>
-							<li><a rel="nofollow" href="/rg3/youtube-dl/get/cfa6e63da22f.bz2" class="compressed">bz2</a></li>
+							<li><a rel="nofollow" href="/rg3/youtube-dl/get/3c59d266a04b.zip" class="zip">zip</a></li>
+							<li><a rel="nofollow" href="/rg3/youtube-dl/get/3c59d266a04b.gz" class="compressed">gz</a></li>
+							<li><a rel="nofollow" href="/rg3/youtube-dl/get/3c59d266a04b.bz2" class="compressed">bz2</a></li>
 						
 						
 					</ul>
@@ -253,7 +253,7 @@
 					
 					<ul>
 					
-						<li><a href="/rg3/youtube-dl/src/cfa6e63da22f">default</a></li>
+						<li><a href="/rg3/youtube-dl/src/3c59d266a04b">default</a></li>
 					
 					</ul>
 					
@@ -263,9 +263,11 @@
 					
 					<ul>
 					
-						<li><a href="/rg3/youtube-dl/src/cfa6e63da22f">tip</a></li>
+						<li><a href="/rg3/youtube-dl/src/3c59d266a04b">tip</a></li>
 					
-						<li><a href="/rg3/youtube-dl/src/a44566779488">2010.07.14</a></li>
+						<li><a href="/rg3/youtube-dl/src/de50210f6416">2010.07.22</a></li>
+					
+						<li><a href="/rg3/youtube-dl/src/ad0c03e54265">2010.07.14</a></li>
 					
 						<li><a href="/rg3/youtube-dl/src/ebc3c1a8ea94">2010.06.06</a></li>
 					
@@ -293,8 +295,6 @@
 					
 						<li><a href="/rg3/youtube-dl/src/2793d3270ff9">2009.06.29</a></li>
 					
-						<li><a href="/rg3/youtube-dl/src/cfc3202eb7b6">2009.05.30</a></li>
-					
 						<li><a href="/rg3/youtube-dl/src/4bc5ac772e8a">2009.05.25</a></li>
 					
 						<li><a href="/rg3/youtube-dl/src/3f498fb56291">2009.05.23</a></li>
@@ -348,9 +348,9 @@
 					<ul>
 						
 						
-							<li><a rel="nofollow" href="/rg3/youtube-dl/get/cfa6e63da22f.zip" class="zip">zip</a></li>
-							<li><a rel="nofollow" href="/rg3/youtube-dl/get/cfa6e63da22f.gz" class="compressed">gz</a></li>
-							<li><a rel="nofollow" href="/rg3/youtube-dl/get/cfa6e63da22f.bz2" class="compressed">bz2</a></li>
+							<li><a rel="nofollow" href="/rg3/youtube-dl/get/3c59d266a04b.zip" class="zip">zip</a></li>
+							<li><a rel="nofollow" href="/rg3/youtube-dl/get/3c59d266a04b.gz" class="compressed">gz</a></li>
+							<li><a rel="nofollow" href="/rg3/youtube-dl/get/3c59d266a04b.bz2" class="compressed">bz2</a></li>
 						
 						
 					</ul>
@@ -371,7 +371,7 @@
 		
 		<p class="repo-desc-description">youtube-dl is a small command-line program for downloading videos from <a href="http://YouTube.com" rel="nofollow">YouTube.com</a>.</p>
 		
-		<div id="repo-desc-cloneinfo">Clone this repository (size: 287.0 KB): <a href="http://bitbucket.org/rg3/youtube-dl" onclick="$('#clone-url-ssh').hide();$('#clone-url-https').toggle();return(false);"><small>HTTPS</small></a> / <a href="ssh://hg@bitbucket.org/rg3/youtube-dl" onclick="$('#clone-url-https').hide();$('#clone-url-ssh').toggle();return(false);"><small>SSH</small></a><br/>
+		<div id="repo-desc-cloneinfo">Clone this repository (size: 296.3 KB): <a href="http://bitbucket.org/rg3/youtube-dl" onclick="$('#clone-url-ssh').hide();$('#clone-url-https').toggle();return(false);"><small>HTTPS</small></a> / <a href="ssh://hg@bitbucket.org/rg3/youtube-dl" onclick="$('#clone-url-https').hide();$('#clone-url-ssh').toggle();return(false);"><small>SSH</small></a><br/>
 		<pre id="clone-url-https">$ hg clone <a href="http://bitbucket.org/rg3/youtube-dl">http://bitbucket.org/rg3/youtube-dl</a></pre>
 		
 		<pre id="clone-url-ssh" style="display:none;">$ hg clone <a href="ssh://hg@bitbucket.org/rg3/youtube-dl">ssh://hg@bitbucket.org/rg3/youtube-dl</a></pre></div>
@@ -413,7 +413,7 @@
 <h1 id="youtube-dl-download-videos-from-youtubecom">youtube-dl: Download videos from YouTube.com</h1>
 <p>(and more...)</p>
 <h2 id="what-is-it">What is it?</h2>
-<p><em>youtube-dl</em> is a small command-line program to download videos from YouTube.com and a few more sites. It requires the <a href="http://www.python.org/">Python interpreter</a>, version 2.x (x being at least 4), and it's not platform specific. It should work in your Unix box, in Windows or in Mac OS X. The latest version is <strong>2010.07.14</strong>. It's released to the public domain, which means you can modify it, redistribute it or use it however you like.</p>
+<p><em>youtube-dl</em> is a small command-line program to download videos from YouTube.com and a few more sites. It requires the <a href="http://www.python.org/">Python interpreter</a>, version 2.x (x being at least 4), and it's not platform specific. It should work in your Unix box, in Windows or in Mac OS X. The latest version is <strong>2010.07.22</strong>. It's released to the public domain, which means you can modify it, redistribute it or use it however you like.</p>
 <p>I'll try to keep it updated if YouTube.com changes the way you access their videos. After all, it's a simple and short program. However, I can't guarantee anything. If you detect it stops working, check for new versions and/or inform me about the problem, indicating the program version you are using. If the program stops working and I can't solve the problem but you have a solution, I'd like to know it. If that happens and you feel you can maintain the program yourself, tell me. My contact information is at <a href="http://rg03.wordpress.com/contact-me/">rg03.wordpress.com</a>.</p>
 <p>Thanks for all the feedback received so far. I'm glad people find my program useful.</p>
 <h2 id="usage-instructions">Usage instructions</h2>
@@ -438,10 +438,10 @@
 </li></ul>
 <h2 id="download-it">Download it</h2>
 <p>Note that if you directly click on these hyperlinks, your web browser will most likely display the program contents. It's usually better to right-click on it and choose the appropriate option, normally called <em>Save Target As</em> or <em>Save Link As</em>, depending on the web browser you are using.</p>
-<h3 id="httpbitbucketorgrg3youtube-dlraw20100714youtube-dl20100714"><a href="http://bitbucket.org/rg3/youtube-dl/raw/2010.07.14/youtube-dl">2010.07.14</a></h3>
-<ul><li><strong>MD5</strong>: 7808ec7e428d1b3c6a697fb63a51d401
-</li><li><strong>SHA1</strong>: d1ee2a5aa27af89ea8b5d2f3c98fdfe2c75a9460
-</li><li><strong>SHA256</strong>: 7c27bedbfb9ae00dcdc148211c5da612ce4229706b5e5df3f2bf1b263c058d9a
+<h3 id="httpbitbucketorgrg3youtube-dlraw20100722youtube-dl20100722"><a href="http://bitbucket.org/rg3/youtube-dl/raw/2010.07.22/youtube-dl">2010.07.22</a></h3>
+<ul><li><strong>MD5</strong>: d3a69eb8211e0aa7b61e0afbfe507d41
+</li><li><strong>SHA1</strong>: bafb1b4716ddaae506f10da3394ce7672d5f4e42
+</li><li><strong>SHA256</strong>: 0307ec6b7b58ef26e66afd9e260aba314ce706831a9cbaef3cb65705a66289cd
 </li></ul>
 <h2 id="proxy-support">Proxy support</h2>
 <p>youtube-dl supports downloading videos through a proxy, by setting the http_proxy environment variable to the proxy URL, as in <code>http://proxy_machine_name:port/</code>.</p>
@@ -469,12 +469,6 @@
 
 		
 		
-			<br/>
-			<small class="right" style="background: transparent url(http://bitbucket-assets.s3.amazonaws.com/img/icons/fugue/clock_small.png) no-repeat left 50%; padding-left: 16px;">
-				 This revision is from 2010-07-14 18:38
-			</small>
-			<div class="cb"></div>
-		
 	</div>
 
 
@@ -489,8 +483,8 @@
 				<a href="http://www.djangoproject.com/">Django 1.2.1</a> / 
 				<a href="http://bitbucket.org/jespern/django-piston/">Piston 0.2.3rc1</a> / 
 				<a href="http://www.selenic.com/mercurial/">Hg 1.3.1</a> / 
-				<a href="http://www.python.org">Python 2.5.2</a> /
-				r3065| fe01
+				<a href="http://www.python.org">Python 2.7.0</a> /
+				r3099| bfg02
 			</b></small>
 		</div>
 	</div>


Index: youtube-dl
===================================================================
RCS file: /cvs/pkgs/rpms/youtube-dl/devel/youtube-dl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- youtube-dl	15 Jul 2010 17:56:08 -0000	1.5
+++ youtube-dl	23 Jul 2010 14:13:46 -0000	1.6
@@ -27,7 +27,7 @@ except ImportError:
 	from cgi import parse_qs
 
 std_headers = {
-	'User-Agent': 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.6) Gecko/20100627 Firefox/3.6.6',
+	'User-Agent': 'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Firefox/3.6.7',
 	'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
 	'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
 	'Accept-Language': 'en-us,en;q=0.5',
@@ -131,7 +131,7 @@ class PostProcessingError(Exception):
 	"""
 	pass
 
-class UnavailableFormatError(Exception):
+class UnavailableVideoError(Exception):
 	"""Unavailable Format exception.
 
 	This exception will be thrown when a video is requested
@@ -401,7 +401,7 @@ class FileDownloader(object):
 				try:
 					self.verify_url(info_dict['url'].encode('utf-8')).decode('utf-8')
 				except (OSError, IOError, urllib2.URLError, httplib.HTTPException, socket.error), err:
-					raise UnavailableFormatError
+					raise UnavailableVideoError
 
 			# Forced printings
 			if self.params.get('forcetitle', False):
@@ -435,7 +435,7 @@ class FileDownloader(object):
 		try:
 			success = self._do_download(filename, info_dict['url'].encode('utf-8'), info_dict.get('player_url', None))
 		except (OSError, IOError), err:
-			raise UnavailableFormatError
+			raise UnavailableVideoError
 		except (urllib2.URLError, httplib.HTTPException, socket.error), err:
 			self.trouble('ERROR: unable to download video data: %s' % str(err))
 			return
@@ -684,12 +684,12 @@ class YoutubeIE(InfoExtractor):
 	"""Information extractor for youtube.com."""
 
 	_VALID_URL = r'^((?:http://)?(?:youtu\.be/|(?:\w+\.)?youtube\.com/(?:(?:v/)|(?:(?:watch(?:_popup)?(?:\.php)?)?[\?#](?:.+&)?v=))))?([0-9A-Za-z_-]+)(?(1).+)?$'
-	_LANG_URL = r'http://uk.youtube.com/?hl=en&persist_hl=1&gl=US&persist_gl=1&opt_out_ackd=1'
+	_LANG_URL = r'http://www.youtube.com/?hl=en&persist_hl=1&gl=US&persist_gl=1&opt_out_ackd=1'
 	_LOGIN_URL = 'http://www.youtube.com/signup?next=/&gl=US&hl=en'
 	_AGE_URL = 'http://www.youtube.com/verify_age?next_url=/&gl=US&hl=en'
 	_NETRC_MACHINE = 'youtube'
-	# Listed in order of priority for the -b option
-	_available_formats = ['38', '37', '22', '45', '35', '34', '43', '18', '6', '5', '17', '13', None]
+	# Listed in order of quality
+	_available_formats = ['38', '37', '22', '45', '35', '34', '43', '18', '6', '5', '17', '13']
 	_video_extensions = {
 		'13': '3gp',
 		'17': 'mp4',
@@ -812,124 +812,109 @@ class YoutubeIE(InfoExtractor):
 		if mobj is None:
 			self._downloader.trouble(u'ERROR: invalid URL: %s' % url)
 			return
-
-		# At this point we have a new video
-		if self._downloader is not None:
-			self._downloader.increment_downloads()
 		video_id = mobj.group(2)
 
-		# Downloader parameters
-		best_quality = False
-		all_formats = False
-		format_param = None
-		quality_index = 0
-		if self._downloader is not None:
-			params = self._downloader.params
-			format_param = params.get('format', None)
-			if format_param == '0':
-				format_limit = params.get('format_limit', None)
-				if format_limit is not None:
-					try:
-						# Start at a different format if the user has limited the maximum quality
-						quality_index = self._available_formats.index(format_limit)
-					except ValueError:
-						pass
-				format_param = self._available_formats[quality_index]
-				best_quality = True
-			elif format_param == '-1':
-				format_param = self._available_formats[quality_index]
-				all_formats = True
+		# Get video webpage
+		self.report_video_webpage_download(video_id)
+		request = urllib2.Request('http://www.youtube.com/watch?v=%s&gl=US&hl=en' % video_id, None, std_headers)
+		try:
+			video_webpage = urllib2.urlopen(request).read()
+		except (urllib2.URLError, httplib.HTTPException, socket.error), err:
+			self._downloader.trouble(u'ERROR: unable to download video webpage: %s' % str(err))
+			return
 
-		while True:
-			# Extension
-			video_extension = self._video_extensions.get(format_param, 'flv')
+		# Attempt to extract SWF player URL
+		mobj = re.search(r'swfConfig.*"(http://.*?watch.*?-.*?\.swf)"', video_webpage)
+		if mobj is not None:
+			player_url = mobj.group(1)
+		else:
+			player_url = None
 
-			# Get video webpage
-			self.report_video_webpage_download(video_id)
-			request = urllib2.Request('http://www.youtube.com/watch?v=%s&gl=US&hl=en' % video_id, None, std_headers)
+		# Get video info
+		self.report_video_info_webpage_download(video_id)
+		for el_type in ['&el=embedded', '&el=detailpage', '&el=vevo', '']:
+			video_info_url = ('http://www.youtube.com/get_video_info?&video_id=%s%s&ps=default&eurl=&gl=US&hl=en'
+					   % (video_id, el_type))
+			request = urllib2.Request(video_info_url, None, std_headers)
 			try:
-				video_webpage = urllib2.urlopen(request).read()
+				video_info_webpage = urllib2.urlopen(request).read()
+				video_info = parse_qs(video_info_webpage)
+				if 'token' in video_info:
+					break
 			except (urllib2.URLError, httplib.HTTPException, socket.error), err:
-				self._downloader.trouble(u'ERROR: unable to download video webpage: %s' % str(err))
+				self._downloader.trouble(u'ERROR: unable to download video info webpage: %s' % str(err))
 				return
+		self.report_information_extraction(video_id)
+
+		# uploader
+		if 'author' not in video_info:
+			self._downloader.trouble(u'ERROR: unable to extract uploader nickname')
+			return
+		video_uploader = urllib.unquote_plus(video_info['author'][0])
+
+		# title
+		if 'title' not in video_info:
+			self._downloader.trouble(u'ERROR: unable to extract video title')
+			return
+		video_title = urllib.unquote_plus(video_info['title'][0])
+		video_title = video_title.decode('utf-8')
+		video_title = sanitize_title(video_title)
+
+		# simplified title
+		simple_title = re.sub(ur'(?u)([^%s]+)' % simple_title_chars, ur'_', video_title)
+		simple_title = simple_title.strip(ur'_')
+
+		# thumbnail image
+		if 'thumbnail_url' not in video_info:
+			self._downloader.trouble(u'WARNING: unable to extract video thumbnail')
+			video_thumbnail = ''
+		else:	# don't panic if we can't find it
+			video_thumbnail = urllib.unquote_plus(video_info['thumbnail_url'][0])
 
-			# Attempt to extract SWF player URL
-			mobj = re.search(r'swfConfig.*"(http://.*?watch.*?-.*?\.swf)"', video_webpage)
+		# description
+		video_description = 'No description available.'
+		if self._downloader.params.get('forcedescription', False):
+			mobj = re.search(r'<meta name="description" content="(.*)"(?:\s*/)?>', video_webpage)
 			if mobj is not None:
-				player_url = mobj.group(1)
-			else:
-				player_url = None
+				video_description = mobj.group(1)
 
-			# Get video info
-			self.report_video_info_webpage_download(video_id)
-			for el_type in ['&el=embedded', '&el=detailpage', '&el=vevo', '']:
-				video_info_url = ('http://www.youtube.com/get_video_info?&video_id=%s%s&ps=default&eurl=&gl=US&hl=en'
-						   % (video_id, el_type))
-				request = urllib2.Request(video_info_url, None, std_headers)
-				try:
-					video_info_webpage = urllib2.urlopen(request).read()
-					video_info = parse_qs(video_info_webpage)
-					if 'token' in video_info:
-						break
-				except (urllib2.URLError, httplib.HTTPException, socket.error), err:
-					self._downloader.trouble(u'ERROR: unable to download video info webpage: %s' % str(err))
+		# Decide which formats to download
+		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)
+			if format_limit is not None and format_limit in self._available_formats:
+				format_list = self._available_formats[self._available_formats.index(format_limit):]
+			else:
+				format_list = self._available_formats
+			existing_formats = [x for x in format_list if x in url_map]
+			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
+			elif requested_format == '-1':
+				video_url_list = url_map.items() # All formats
+			else:
+				if requested_format not in existing_formats:
+					self._downloader.trouble(u'ERROR: format not available for video')
 					return
-			self.report_information_extraction(video_id)
+				video_url_list = [(requested_format, url_map[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
 
-			# "t" param
-			if 'token' not in video_info:
-				# Attempt to see if YouTube has issued an error message
-				if 'reason' not in video_info:
-					self._downloader.trouble(u'ERROR: unable to extract "t" parameter for unknown reason')
-					stream = open('reportme-ydl-%s.dat' % time.time(), 'wb')
-					stream.write(video_info_webpage)
-					stream.close()
-				else:
-					reason = urllib.unquote_plus(video_info['reason'][0])
-					self._downloader.trouble(u'ERROR: YouTube said: %s' % reason.decode('utf-8'))
-				return
-			token = urllib.unquote_plus(video_info['token'][0])
-			video_real_url = 'http://www.youtube.com/get_video?video_id=%s&t=%s&eurl=&el=detailpage&ps=default&gl=US&hl=en' % (video_id, token)
-			if format_param is not None:
-				video_real_url = '%s&fmt=%s' % (video_real_url, format_param)
-
-			# Check possible RTMP download
-			if 'conn' in video_info and video_info['conn'][0].startswith('rtmp'):
-				self.report_rtmp_download()
-				video_real_url = video_info['conn'][0]
-
-			# uploader
-			if 'author' not in video_info:
-				self._downloader.trouble(u'ERROR: unable to extract uploader nickname')
-				return
-			video_uploader = urllib.unquote_plus(video_info['author'][0])
-
-			# title
-			if 'title' not in video_info:
-				self._downloader.trouble(u'ERROR: unable to extract video title')
-				return
-			video_title = urllib.unquote_plus(video_info['title'][0])
-			video_title = video_title.decode('utf-8')
-			video_title = sanitize_title(video_title)
-
-			# simplified title
-			simple_title = re.sub(ur'(?u)([^%s]+)' % simple_title_chars, ur'_', video_title)
-			simple_title = simple_title.strip(ur'_')
-
-			# thumbnail image
-			if 'thumbnail_url' not in video_info:
-				self._downloader.trouble(u'WARNING: unable to extract video thumbnail')
-				video_thumbnail = ''
-			else:	# don't panic if we can't find it
-				video_thumbnail = urllib.unquote_plus(video_info['thumbnail_url'][0])
+		for format_param, video_real_url in video_url_list:
+			# At this point we have a new video
+			self._downloader.increment_downloads()
 
-			# description
-			video_description = 'No description available.'
-			if self._downloader.params.get('forcedescription', False):
-				mobj = re.search(r'<meta name="description" content="(.*)"(?:\s*/)?>', video_webpage)
-				if mobj is not None:
-					video_description = mobj.group(1)
+			# Extension
+			video_extension = self._video_extensions.get(format_param, 'flv')
 
+			# Find the video URL in fmt_url_map or conn paramters
 			try:
 				# Process video information
 				self._downloader.process_info({
@@ -944,32 +929,8 @@ class YoutubeIE(InfoExtractor):
 					'description':	video_description.decode('utf-8'),
 					'player_url':	player_url,
 				})
-
-				if all_formats:
-					quality_index += 1
-					if quality_index == len(self._available_formats):
-						# None left to get
-						return
-					else:
-						format_param = self._available_formats[quality_index]
-						continue
-				return
-
-			except UnavailableFormatError, err:
-				if best_quality or all_formats:
-					quality_index += 1
-					if quality_index == len(self._available_formats):
-						# I don't ever expect this to happen
-						if not all_formats:
-							self._downloader.trouble(u'ERROR: no known formats available for video')
-						return
-					else:
-						self.report_unavailable_format(video_id, format_param)
-						format_param = self._available_formats[quality_index]
-						continue
-				else: 
-					self._downloader.trouble('ERROR: format not available for video')
-					return
+			except UnavailableVideoError, err:
+				self._downloader.trouble(u'ERROR: unable to download video')
 
 
 class MetacafeIE(InfoExtractor):
@@ -1043,8 +1004,7 @@ class MetacafeIE(InfoExtractor):
 			return
 
 		# At this point we have a new video
-		if self._downloader is not None:
-			self._downloader.increment_downloads()
+		self._downloader.increment_downloads()
 
 		simple_title = mobj.group(2).decode('utf-8')
 		video_extension = 'flv'
@@ -1101,8 +1061,8 @@ class MetacafeIE(InfoExtractor):
 				'format':	u'NA',
 				'player_url':	None,
 			})
-		except UnavailableFormatError:
-			self._downloader.trouble(u'ERROR: format not available for video')
+		except UnavailableVideoError:
+			self._downloader.trouble(u'ERROR: unable to download video')
 
 
 class DailymotionIE(InfoExtractor):
@@ -1136,8 +1096,7 @@ class DailymotionIE(InfoExtractor):
 			return
 
 		# At this point we have a new video
-		if self._downloader is not None:
-			self._downloader.increment_downloads()
+		self._downloader.increment_downloads()
 		video_id = mobj.group(1)
 
 		simple_title = mobj.group(2).decode('utf-8')
@@ -1190,8 +1149,8 @@ class DailymotionIE(InfoExtractor):
 				'format':	u'NA',
 				'player_url':	None,
 			})
-		except UnavailableFormatError:
-			self._downloader.trouble(u'ERROR: format not available for video')
+		except UnavailableVideoError:
+			self._downloader.trouble(u'ERROR: unable to download video')
 
 class GoogleIE(InfoExtractor):
 	"""Information extractor for video.google.com."""
@@ -1224,8 +1183,7 @@ class GoogleIE(InfoExtractor):
 			return
 
 		# At this point we have a new video
-		if self._downloader is not None:
-			self._downloader.increment_downloads()
+		self._downloader.increment_downloads()
 		video_id = mobj.group(1)
 
 		video_extension = 'mp4'
@@ -1300,8 +1258,8 @@ class GoogleIE(InfoExtractor):
 				'format':	u'NA',
 				'player_url':	None,
 			})
-		except UnavailableFormatError:
-			self._downloader.trouble(u'ERROR: format not available for video')
+		except UnavailableVideoError:
+			self._downloader.trouble(u'ERROR: unable to download video')
 
 
 class PhotobucketIE(InfoExtractor):
@@ -1335,8 +1293,7 @@ class PhotobucketIE(InfoExtractor):
 			return
 
 		# At this point we have a new video
-		if self._downloader is not None:
-			self._downloader.increment_downloads()
+		self._downloader.increment_downloads()
 		video_id = mobj.group(1)
 
 		video_extension = 'flv'
@@ -1382,8 +1339,8 @@ class PhotobucketIE(InfoExtractor):
 				'format':	u'NA',
 				'player_url':	None,
 			})
-		except UnavailableFormatError:
-			self._downloader.trouble(u'ERROR: format not available for video')
+		except UnavailableVideoError:
+			self._downloader.trouble(u'ERROR: unable to download video')
 
 
 class YahooIE(InfoExtractor):
@@ -1420,8 +1377,7 @@ class YahooIE(InfoExtractor):
 			return
 
 		# At this point we have a new video
-		if self._downloader is not None and new_video:
-			self._downloader.increment_downloads()
+		self._downloader.increment_downloads()
 		video_id = mobj.group(2)
 		video_extension = 'flv'
 
@@ -1540,8 +1496,8 @@ class YahooIE(InfoExtractor):
 				'description':	video_description,
 				'player_url':	None,
 			})
-		except UnavailableFormatError:
-			self._downloader.trouble(u'ERROR: format not available for video')
+		except UnavailableVideoError:
+			self._downloader.trouble(u'ERROR: unable to download video')
 
 
 class GenericIE(InfoExtractor):
@@ -1568,8 +1524,7 @@ class GenericIE(InfoExtractor):
 
 	def _real_extract(self, url):
 		# At this point we have a new video
-		if self._downloader is not None:
-			self._downloader.increment_downloads()
+		self._downloader.increment_downloads()
 
 		video_id = url.split('/')[-1]
 		request = urllib2.Request(url)
@@ -1640,8 +1595,8 @@ class GenericIE(InfoExtractor):
 				'format':	u'NA',
 				'player_url':	None,
 			})
-		except UnavailableFormatError:
-			self._downloader.trouble(u'ERROR: format not available for video')
+		except UnavailableVideoError, err:
+			self._downloader.trouble(u'ERROR: unable to download video')
 
 
 class YoutubeSearchIE(InfoExtractor):
@@ -2109,7 +2064,7 @@ if __name__ == '__main__':
 		# Parse command line
 		parser = optparse.OptionParser(
 			usage='Usage: %prog [options] url...',
-			version='2010.06.06',
+			version='2010.07.22',
 			conflict_handler='resolve',
 		)
 
@@ -2138,16 +2093,12 @@ if __name__ == '__main__':
 		video_format = optparse.OptionGroup(parser, 'Video Format Options')
 		video_format.add_option('-f', '--format',
 				action='store', dest='format', metavar='FORMAT', help='video format code')
-		video_format.add_option('-b', '--best-quality',
-				action='store_const', dest='format', help='download the best quality video possible', const='0')
 		video_format.add_option('-m', '--mobile-version',
 				action='store_const', dest='format', help='alias for -f 17', const='17')
-		video_format.add_option('-d', '--high-def',
-				action='store_const', dest='format', help='alias for -f 22', const='22')
 		video_format.add_option('--all-formats',
 				action='store_const', dest='format', help='download all available video formats', const='-1')
 		video_format.add_option('--max-quality',
-				action='store', dest='format_limit', metavar='FORMAT', help='highest quality format limit for -b')
+				action='store', dest='format_limit', metavar='FORMAT', help='highest quality format to download')
 		parser.add_option_group(video_format)
 
 		verbosity = optparse.OptionGroup(parser, 'Verbosity / Simulation Options')


Index: youtube-dl.spec
===================================================================
RCS file: /cvs/pkgs/rpms/youtube-dl/devel/youtube-dl.spec,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- youtube-dl.spec	15 Jul 2010 17:56:08 -0000	1.7
+++ youtube-dl.spec	23 Jul 2010 14:13:46 -0000	1.8
@@ -1,5 +1,5 @@
 Name:           youtube-dl
-Version:        2010.07.14
+Version:        2010.07.22
 Release:        1%{?dist}
 Summary:        Small command-line program to download videos from YouTube
 Summary(pl):    Tekstowy program do pobierania filmów z youtube.com
@@ -39,6 +39,9 @@ rm -rf $RPM_BUILD_ROOT
 %doc index.html
 
 %changelog
+* Fri Jul 23 2010 Till Maas <opensource at till.name> - 2010.07.21-1
+- Update to latest release
+
 * Thu Jul 15 2010 Till Maas <opensource at till.name> - 2010.07.14-1
 - Update to latest release
 



More information about the scm-commits mailing list