From 1ca20f68847a1239dee32ee87c59ca09d760ecc1 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 16 Dec 2020 18:13:16 +0100 Subject: [PATCH] Exit on youtube-dl error. --- download-yt-feeds | 2 ++ 1 file changed, 2 insertions(+) diff --git a/download-yt-feeds b/download-yt-feeds index 86e180f..cff0735 100755 --- a/download-yt-feeds +++ b/download-yt-feeds @@ -3,6 +3,7 @@ # Error codes: # 1 = Could not read file or directory. # 2 = Configuration option not set. +# 3 = youtube-dl error. function die() { @@ -64,6 +65,7 @@ function main() --format "${ytdl_format}" \ ${=ytdl_extra_args} \ "${feed}" + [[ ${?} -eq 0 ]] || die 3 "youtube-dl returned an error." done files_after="$(find "${download_dir}" -type f)" while read file; do