Skip to content

Commit

Permalink
show warning if extractor doesn't yield any results (#1759)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Aug 16, 2021
1 parent d320ee6 commit bdfdabf
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions gallery_dl/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,16 @@ def __init__(self, extr, parent=None):

def run(self):
"""Execute or run the job"""
sleep = self.extractor.config("sleep-extractor")
extractor = self.extractor
log = extractor.log
msg = None

sleep = extractor.config("sleep-extractor")
if sleep:
time.sleep(sleep)

try:
log = self.extractor.log
for msg in self.extractor:
for msg in extractor:
self.dispatch(msg)
except exception.StopExtraction as exc:
if exc.message:
Expand All @@ -100,8 +104,13 @@ def run(self):
except BaseException:
self.status |= 1
raise
else:
if msg is None:
log.warning("No results for %s", extractor.url)
self.status |= 8
finally:
self.handle_finalize()

return self.status

def dispatch(self, msg):
Expand Down

0 comments on commit bdfdabf

Please sign in to comment.