sensible output if no extractor found
This commit is contained in:
@@ -44,6 +44,7 @@ class DownloadJob():
|
|||||||
self.mngr = mngr
|
self.mngr = mngr
|
||||||
self.extractor, self.info = extractor.find(url)
|
self.extractor, self.info = extractor.find(url)
|
||||||
if self.extractor is None:
|
if self.extractor is None:
|
||||||
|
print(url, ": No extractor found", sep="", file=sys.stderr)
|
||||||
return
|
return
|
||||||
self.directory = mngr.get_base_directory()
|
self.directory = mngr.get_base_directory()
|
||||||
self.downloaders = {}
|
self.downloaders = {}
|
||||||
@@ -60,7 +61,7 @@ class DownloadJob():
|
|||||||
def run(self):
|
def run(self):
|
||||||
"""Execute/Run the download job"""
|
"""Execute/Run the download job"""
|
||||||
if self.extractor is None:
|
if self.extractor is None:
|
||||||
return # TODO: error msg
|
return
|
||||||
|
|
||||||
for msg in self.extractor:
|
for msg in self.extractor:
|
||||||
if msg[0] == Message.Url:
|
if msg[0] == Message.Url:
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ def find(url):
|
|||||||
match = re.match(pattern, url)
|
match = re.match(pattern, url)
|
||||||
if match:
|
if match:
|
||||||
return klass(match), module.info
|
return klass(match), module.info
|
||||||
|
return None, None
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# internals
|
# internals
|
||||||
|
|||||||
Reference in New Issue
Block a user