aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2020-08-15 17:12:35 +0200
committerneodarz <neodarz@neodarz.net>2020-08-15 17:13:12 +0200
commit7d94b679a37e6c0dd84bf3234416790a0a6243f5 (patch)
treef2f952178ab4d3d13fbb8fa349b71c3d21001cbd
parente2099a3e5c8f38c8bae88d862950b0c2bf5b1d13 (diff)
downloadmusic_downloader-7d94b679a37e6c0dd84bf3234416790a0a6243f5.tar.xz
music_downloader-7d94b679a37e6c0dd84bf3234416790a0a6243f5.zip
Add an end reports when no extractor was found
-rw-r--r--main.py15
1 files changed, 15 insertions, 0 deletions
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()