[downloader/http] Remove gruesome import
[youtube-dl] / youtube_dl / downloader / external.py
index faac11805cafb0adb2c0a6609cf195ab92783eef..51c41c70462674ee3a07aae6f645c06ae7c88c71 100644 (file)
@@ -46,11 +46,10 @@ class ExternalFD(FileDownloader):
         return info_dict['protocol'] in ('http', 'https', 'ftp', 'ftps')
 
     def _source_address(self, command_option):
-        command_part = []
         source_address = self.params.get('source_address')
-        if source_address:
-            command_part = [command_option, source_address]
-        return command_part
+        if source_address is None:
+            return []
+        return [command_option, source_address]
 
     def _call_downloader(self, tmpfilename, info_dict):
         """ Either overwrite this or implement _make_cmd """
@@ -76,7 +75,7 @@ class ExternalFD(FileDownloader):
 
 class CurlFD(ExternalFD):
     def _make_cmd(self, tmpfilename, info_dict):
-        cmd = [self.exe, '-o', tmpfilename]
+        cmd = [self.exe, '--location', '-o', tmpfilename]
         for key, val in info_dict['http_headers'].items():
             cmd += ['--header', '%s: %s' % (key, val)]
         cmd += self._source_address('--interface')