From 0ead96f03e81abd70f3c25a745ce7062f72e7c8b Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Wed, 4 Nov 2015 21:10:15 +0100 Subject: [PATCH] Log all errors, and exit with failure if no video found Fixes #301 --- lib/svtplay_dl/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/svtplay_dl/__init__.py b/lib/svtplay_dl/__init__.py index 798050b..4157b8f 100644 --- a/lib/svtplay_dl/__init__.py +++ b/lib/svtplay_dl/__init__.py @@ -215,9 +215,11 @@ def get_one_media(stream, options): if options.force_subtitle: return - if len(videos) == 0: - if len(error) > 0: - log.error(error[0].args[0]) + for exc in error: + log.error(str(exc)) + if (len(videos) == 0): + sys.exit(2) + else: if options.list_quality: list_quality(videos)