Exit on youtube-dl error.
This commit is contained in:
parent
568775eaba
commit
1ca20f6884
|
@ -3,6 +3,7 @@
|
||||||
# Error codes:
|
# Error codes:
|
||||||
# 1 = Could not read file or directory.
|
# 1 = Could not read file or directory.
|
||||||
# 2 = Configuration option not set.
|
# 2 = Configuration option not set.
|
||||||
|
# 3 = youtube-dl error.
|
||||||
|
|
||||||
function die()
|
function die()
|
||||||
{
|
{
|
||||||
|
@ -64,6 +65,7 @@ function main()
|
||||||
--format "${ytdl_format}" \
|
--format "${ytdl_format}" \
|
||||||
${=ytdl_extra_args} \
|
${=ytdl_extra_args} \
|
||||||
"${feed}"
|
"${feed}"
|
||||||
|
[[ ${?} -eq 0 ]] || die 3 "youtube-dl returned an error."
|
||||||
done
|
done
|
||||||
files_after="$(find "${download_dir}" -type f)"
|
files_after="$(find "${download_dir}" -type f)"
|
||||||
while read file; do
|
while read file; do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user