From 7d94b679a37e6c0dd84bf3234416790a0a6243f5 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 15 Aug 2020 17:12:35 +0200 Subject: Add an end reports when no extractor was found --- main.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/main.py b/main.py index 7cc352a..f2ef67f 100644 --- a/main.py +++ b/main.py @@ -37,6 +37,8 @@ if args.update: urls_cache = read_file(cache_file) + urls_failed = [] + for url in urls_cache: try: args.extractor = url.split(',')[1] @@ -48,6 +50,11 @@ if args.update: except NoExtractorException as exc: logging.error(exc) + if urls_failed: + print("There was no extractors for the following urls:") + for url_failed in urls_failed: + print(url_failed) + if args.url: print('Downloading from url...') try: @@ -61,6 +68,8 @@ if args.file: urls = read_file(args.file) + urls_failed = [] + for url in urls: if url: try: @@ -68,6 +77,12 @@ if args.file: dl_job.run() except NoExtractorException as exc: logging.error(exc) + urls_failed.append(exc) + + if urls_failed: + print("There was no extractors for the following urls:") + for url_failed in urls_failed: + print(url_failed) if not args.url and not args.update and not args.file: parser.print_help() -- cgit v1.2.1