1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-04 13:24:40 -04:00

Allow specifying path in --external-downloader

This commit is contained in:
pukkandan
2021-02-27 16:52:27 +05:30
parent 86878b6cd9
commit 7f7de7f94d
4 changed files with 11 additions and 10 deletions

View File

@@ -53,7 +53,7 @@ def get_suitable_downloader(info_dict, params={}, default=HttpFD):
external_downloader = params.get('external_downloader')
if external_downloader is not None:
ed = get_external_downloader(external_downloader)
if ed.can_download(info_dict):
if ed.can_download(info_dict, external_downloader):
return ed
if protocol.startswith('m3u8'):

View File

@@ -85,16 +85,16 @@ class ExternalFD(FileDownloader):
return self.params.get('external_downloader')
@classmethod
def available(cls):
return check_executable(cls.get_basename(), [cls.AVAILABLE_OPT])
def available(cls, path=None):
return check_executable(path or cls.get_basename(), [cls.AVAILABLE_OPT])
@classmethod
def supports(cls, info_dict):
return info_dict['protocol'] in cls.SUPPORTED_PROTOCOLS
@classmethod
def can_download(cls, info_dict):
return cls.available() and cls.supports(info_dict)
def can_download(cls, info_dict, path=None):
return cls.available(path) and cls.supports(info_dict)
def _option(self, command_option, param):
return cli_option(self.params, command_option, param)