Only verify the URL when it's an HTTP download
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sat, 9 Jan 2010 22:53:47 +0000 (23:53 +0100)
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>
Sun, 31 Oct 2010 10:25:08 +0000 (11:25 +0100)
youtube-dl

index 732ebce1d3283e2ec7b365eccc9a33e86394cd33..fac624e06485a4b53a5bb012cf625db7db865c52 100755 (executable)
@@ -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):