add option to enable/disable specific downloader modules

... and write URLs with no (active) downloader to unsupported-file
This commit is contained in:
Mike Fährmann
2018-11-13 18:06:36 +01:00
parent 14ee6bf611
commit 8ef84a6823
2 changed files with 11 additions and 1 deletions

View File

@@ -838,6 +838,15 @@ Description Certificate validation during file downloads.
=========== =====
downloader.*.enable
-------------------
=========== =====
Type ``bool``
Default ``true``
Description Enable/Disable this downloader module.
=========== =====
downloader.ytdl.logging
-----------------------
=========== =====

View File

@@ -259,6 +259,7 @@ class DownloadJob(Job):
downloader = self.get_downloader(scheme)
if downloader:
return downloader.download(url, self.pathfmt)
self._write_unsupported(url)
return False
def get_downloader(self, scheme):
@@ -271,7 +272,7 @@ class DownloadJob(Job):
pass
klass = downloader.find(scheme)
if klass:
if klass and config.get(("downloader", scheme, "enable"), True):
instance = klass(self.extractor, self.out)
else:
instance = None