Exit grabtitle, if nothing was read. - annna - Annna the nice friendly bot.
(HTM) git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
---
(DIR) commit 57726e0f7ff167940380738fe63f552184355bd2
(DIR) parent d6dfa7226b2784fcfda280592216f3d2f0b903f5
(HTM) Author: Annna Robert-Houdin <annna@bitreich.org>
Date: Sun, 19 Apr 2020 22:20:24 +0200
Exit grabtitle, if nothing was read.
Diffstat:
M subtitle-paste | 2 ++
1 file changed, 2 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/subtitle-paste b/subtitle-paste
@@ -16,6 +16,8 @@ tmpfile="$(mktemp -u p-XXXXXXXXXXXXX)"
youtube-dl -q --write-sub --skip-download -o "${tmpfile}" "${url}"
ofile="$(basename $(find . -name "${tmpfile}.*"))"
+[ -z "${ofile}" ] && exit 1
+
if [ $(stat -c%s "${ofile}") -eq 0 ];
then
rm "${ofile}"