X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fdownloader%2Fexternal.py;h=51c41c70462674ee3a07aae6f645c06ae7c88c71;hb=3037b91e05e68a4ab3420cbbdb23cfb0739011d3;hp=3d6554fe460c592b88fa62964edc788c10a12f27;hpb=6a66904f8ed469a547d8781fd61b26a97a6ae7aa;p=youtube-dl diff --git a/youtube_dl/downloader/external.py b/youtube_dl/downloader/external.py index 3d6554fe4..51c41c704 100644 --- a/youtube_dl/downloader/external.py +++ b/youtube_dl/downloader/external.py @@ -46,10 +46,10 @@ class ExternalFD(FileDownloader): return info_dict['protocol'] in ('http', 'https', 'ftp', 'ftps') def _source_address(self, command_option): - command_part = [] - if self.ydl.params['source_address'] is not None: - command_part = [command_option, self.ydl.params['source_address']] - return command_part + source_address = self.params.get('source_address') + 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 """ @@ -75,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')