add option to enable/disable specific downloader modules
... and write URLs with no (active) downloader to unsupported-file
This commit is contained in:
@@ -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
|
downloader.ytdl.logging
|
||||||
-----------------------
|
-----------------------
|
||||||
=========== =====
|
=========== =====
|
||||||
|
|||||||
@@ -259,6 +259,7 @@ class DownloadJob(Job):
|
|||||||
downloader = self.get_downloader(scheme)
|
downloader = self.get_downloader(scheme)
|
||||||
if downloader:
|
if downloader:
|
||||||
return downloader.download(url, self.pathfmt)
|
return downloader.download(url, self.pathfmt)
|
||||||
|
self._write_unsupported(url)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_downloader(self, scheme):
|
def get_downloader(self, scheme):
|
||||||
@@ -271,7 +272,7 @@ class DownloadJob(Job):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
klass = downloader.find(scheme)
|
klass = downloader.find(scheme)
|
||||||
if klass:
|
if klass and config.get(("downloader", scheme, "enable"), True):
|
||||||
instance = klass(self.extractor, self.out)
|
instance = klass(self.extractor, self.out)
|
||||||
else:
|
else:
|
||||||
instance = None
|
instance = None
|
||||||
|
|||||||
Reference in New Issue
Block a user