From 8e9bd1d793330248b97af1eff528d89b5da9b3cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 6 Nov 2015 13:21:53 +0100 Subject: [PATCH] sensible output if no extractor found --- gallery_dl/download.py | 3 ++- gallery_dl/extractor/__init__.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gallery_dl/download.py b/gallery_dl/download.py index ceee8dd3..0e737efb 100644 --- a/gallery_dl/download.py +++ b/gallery_dl/download.py @@ -44,6 +44,7 @@ class DownloadJob(): self.mngr = mngr self.extractor, self.info = extractor.find(url) if self.extractor is None: + print(url, ": No extractor found", sep="", file=sys.stderr) return self.directory = mngr.get_base_directory() self.downloaders = {} @@ -60,7 +61,7 @@ class DownloadJob(): def run(self): """Execute/Run the download job""" if self.extractor is None: - return # TODO: error msg + return for msg in self.extractor: if msg[0] == Message.Url: diff --git a/gallery_dl/extractor/__init__.py b/gallery_dl/extractor/__init__.py index ce6b63ce..7dbdd1f9 100644 --- a/gallery_dl/extractor/__init__.py +++ b/gallery_dl/extractor/__init__.py @@ -41,6 +41,7 @@ def find(url): match = re.match(pattern, url) if match: return klass(match), module.info + return None, None # -------------------------------------------------------------------- # internals