about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>2010-01-09 23:53:47 +0100
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>2010-10-31 11:25:08 +0100
commit60f8049d05ff18d3cedaa80bcb9b089a0d4b3e4c (patch)
tree19f861a021ab56f50c1118be56effef4e77abfed
parent49c0028a7a1cb3c2f37770e4749a48ef0146fdfe (diff)
downloadyoutube-dl-60f8049d05ff18d3cedaa80bcb9b089a0d4b3e4c.tar.gz
youtube-dl-60f8049d05ff18d3cedaa80bcb9b089a0d4b3e4c.tar.xz
youtube-dl-60f8049d05ff18d3cedaa80bcb9b089a0d4b3e4c.zip
Only verify the URL when it's an HTTP download
-rwxr-xr-xyoutube-dl10
1 files changed, 6 insertions, 4 deletions
diff --git a/youtube-dl b/youtube-dl
index 732ebce1d..fac624e06 100755
--- a/youtube-dl
+++ b/youtube-dl
@@ -316,10 +316,12 @@ class FileDownloader(object):
 		"""Process a single dictionary returned by an InfoExtractor."""
 		# Do nothing else if in simulate mode
 		if self.params.get('simulate', False):
-			try:
-				info_dict['url'] = self.verify_url(info_dict['url'].encode('utf-8')).decode('utf-8')
-			except (OSError, IOError, urllib2.URLError, httplib.HTTPException, socket.error), err:
-				raise UnavailableFormatError
+			# Verify URL if it's an HTTP one
+			if info_dict['url'].startswith('http'):
+				try:
+					info_dict['url'] = self.verify_url(info_dict['url'].encode('utf-8')).decode('utf-8')
+				except (OSError, IOError, urllib2.URLError, httplib.HTTPException, socket.error), err:
+					raise UnavailableFormatError
 
 			# Forced printings
 			if self.params.get('forcetitle', False):