about summary refs log tree commit diff
path: root/youtube_dl/YoutubeDL.py
diff options
context:
space:
mode:
authordirkf <fieldhouse@gmx.net>2022-02-22 11:24:06 +0000
committerdirkf <fieldhouse@gmx.net>2022-03-25 14:47:26 +0000
commit49c5293014bc11ec8c009856cd63cffa6296c1e1 (patch)
tree887fb5ffc9c9c8356dc65855d5ce53c7f0b3459e /youtube_dl/YoutubeDL.py
parent6508688e88c83bb811653083db9351702cd39a6a (diff)
downloadyoutube-dl-49c5293014bc11ec8c009856cd63cffa6296c1e1.tar.gz
youtube-dl-49c5293014bc11ec8c009856cd63cffa6296c1e1.tar.xz
youtube-dl-49c5293014bc11ec8c009856cd63cffa6296c1e1.zip
Ignore --external-downloader-args if --external-downloader was rejected
... and generate warning
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rwxr-xr-xyoutube_dl/YoutubeDL.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index 69736acff..019e309cb 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -1906,8 +1906,17 @@ class YoutubeDL(object):
 
         if not self.params.get('skip_download', False):
             try:
+                def checked_get_suitable_downloader(info_dict, params):
+                    ed_args = params.get('external_downloader_args')
+                    dler = get_suitable_downloader(info_dict, params)
+                    if ed_args and not params.get('external_downloader_args'):
+                        # external_downloader_args was cleared because external_downloader was rejected
+                        self.report_warning('Requested external downloader cannot be used: '
+                                            'ignoring --external-downloader-args.')
+                    return dler
+
                 def dl(name, info):
-                    fd = get_suitable_downloader(info, self.params)(self, self.params)
+                    fd = checked_get_suitable_downloader(info, self.params)(self, self.params)
                     for ph in self._progress_hooks:
                         fd.add_progress_hook(ph)
                     if self.params.get('verbose'):