]> jfr.im git - yt-dlp.git/commitdiff
Allow specifying path in `--external-downloader`
authorpukkandan <redacted>
Sat, 27 Feb 2021 11:22:27 +0000 (16:52 +0530)
committerpukkandan <redacted>
Sat, 27 Feb 2021 11:22:27 +0000 (16:52 +0530)
README.md
yt_dlp/downloader/__init__.py
yt_dlp/downloader/external.py
yt_dlp/options.py

index 2d40b6a9aabdf5d93d88fee7d0d2ba48f790a415..69813c2b75e89b549bfb8eef4368d8c5957ec414 100644 (file)
--- a/README.md
+++ b/README.md
@@ -326,9 +326,10 @@ ## Download Options:
     --no-hls-use-mpegts              Do not use the mpegts container for HLS
                                      videos. This is default when not
                                      downloading live streams
-    --external-downloader NAME       Use the specified external downloader.
-                                     Currently supports aria2c, avconv, axel,
-                                     curl, ffmpeg, httpie, wget
+    --external-downloader NAME       Name or path of the external downloader to
+                                     use. Currently supports aria2c, avconv,
+                                     axel, curl, ffmpeg, httpie, wget
+                                     (Recommended: aria2c)
     --downloader-args NAME:ARGS      Give these arguments to the external
                                      downloader. Specify the downloader name and
                                      the arguments separated by a colon ":". You
index a15e3fd45ec17bcd98a7cf59d70fd5c4b846a89c..c2e155c0ac120c7f59937fe621cca865fa7b6e06 100644 (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'):
index 5d9639076ba224f1d6e93f6b58dce9d299e07064..0e2bbdb862bc32b26c985ee9b1d6c189a40f9138 100644 (file)
@@ -85,16 +85,16 @@ def exe(self):
         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)
index 88f74ff36dc5dba182be9bb8e73a5e2df9bac37b..5f200fb8f7e39e151912d53976c40b64d6524883 100644 (file)
@@ -650,8 +650,8 @@ def _dict_from_multiple_values_options_callback(
         '--external-downloader',
         dest='external_downloader', metavar='NAME',
         help=(
-            'Use the specified external downloader. '
-            'Currently supports %s' % ', '.join(list_external_downloaders())))
+            'Name or path of the external downloader to use. '
+            'Currently supports %s (Recommended: aria2c)' % ', '.join(list_external_downloaders())))
     downloader.add_option(
         '--downloader-args', '--external-downloader-args',
         metavar='NAME:ARGS', dest='external_downloader_args', default={}, type='str',