[downloader/external] Simplify source_address
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 2 Feb 2015 19:33:23 +0000 (20:33 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 2 Feb 2015 19:33:25 +0000 (20:33 +0100)
'' might actually be passed in, so check for None.

youtube_dl/downloader/external.py

index faac11805cafb0adb2c0a6609cf195ab92783eef..ff031d2e04253b775e517347866fe3ee75a666c6 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 """