summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-05-22 22:00:05 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-05-22 22:00:05 +0200
commitc81e3a6d65b846031d2bb464ce6d6a5b8d22f8f1 (patch)
treecb15de91cce3a38a5cd8407f5a3606a1dfd0c48f
parent3709f3670144edb5b61429ecacdcb71eb520dda1 (diff)
downloadnixos-c81e3a6d65b846031d2bb464ce6d6a5b8d22f8f1.tar
nixos-c81e3a6d65b846031d2bb464ce6d6a5b8d22f8f1.tar.gz
nixos-c81e3a6d65b846031d2bb464ce6d6a5b8d22f8f1.tar.bz2
nixos-c81e3a6d65b846031d2bb464ce6d6a5b8d22f8f1.tar.xz
nixos-c81e3a6d65b846031d2bb464ce6d6a5b8d22f8f1.zip
...
-rw-r--r--odin/strm/download_youtube7
1 files changed, 2 insertions, 5 deletions
diff --git a/odin/strm/download_youtube b/odin/strm/download_youtube
index d2aa069d..3f578371 100644
--- a/odin/strm/download_youtube
+++ b/odin/strm/download_youtube
@@ -174,7 +174,6 @@ printf ">>> %s <<<\n %s\n" "${msgId}" "${message}"
174 # mv -v ${filename} ${newFilename} && filename=${newFilename} 174 # mv -v ${filename} ${newFilename} && filename=${newFilename}
175 # fi 175 # fi
176 176
177 ffmpegResult=0
178 if [[ -n "${filename}" && -e "${filename}" && ${ytResult} -eq 0 ]]; then 177 if [[ -n "${filename}" && -e "${filename}" && ${ytResult} -eq 0 ]]; then
179 max_vol=$( \ 178 max_vol=$( \
180 pv -N "$(trimName "vol:" ${title})" ${filename} | ffmpeg -i pipe:0 -af "volumedetect" -vn -f null /dev/null 2>&1 | \ 179 pv -N "$(trimName "vol:" ${title})" ${filename} | ffmpeg -i pipe:0 -af "volumedetect" -vn -f null /dev/null 2>&1 | \
@@ -292,7 +291,6 @@ printf ">>> %s <<<\n %s\n" "${msgId}" "${message}"
292 291
293 print -- ${cargs} ${p2args} 292 print -- ${cargs} ${p2args}
294 ffmpeg ${args} ${cargs} ${p2args} -- "${filename}" 293 ffmpeg ${args} ${cargs} ${p2args} -- "${filename}"
295 ffmpegResult=$?
296 294
297 cd ${oldPwd} 295 cd ${oldPwd}
298 else 296 else
@@ -300,12 +298,11 @@ printf ">>> %s <<<\n %s\n" "${msgId}" "${message}"
300 298
301 print -- ${cargs} ${p2args} 299 print -- ${cargs} ${p2args}
302 pv -N "$(trimName "trans:" ${title})" ${tempfile} | ffmpeg ${args} ${cargs} ${p2args} -- "${filename}" 300 pv -N "$(trimName "trans:" ${title})" ${tempfile} | ffmpeg ${args} ${cargs} ${p2args} -- "${filename}"
303 ffmpegResult=${pipestatus[2]}
304 fi 301 fi
305 fi 302 fi
306 fi 303 fi
307 304
308 if [[ -n "${filename}" && -e "${filename}" && ${ytResult} -eq 0 && ${ffmpegResult} -eq 0 ]]; then 305 if [[ -n "${filename}" && -e "${filename}" && ${ytResult} -eq 0 ]]; then
309 chmod -v 644 "${filename}" 306 chmod -v 644 "${filename}"
310 tmpFile=$(mktemp --tmpdir=/home/gkleen/rss/tmp .insertUrl.$$.XXXXXX) 307 tmpFile=$(mktemp --tmpdir=/home/gkleen/rss/tmp .insertUrl.$$.XXXXXX)
311 relUrl=$(realpath --relative-to=/srv/media ${filename}) 308 relUrl=$(realpath --relative-to=/srv/media ${filename})
@@ -332,7 +329,7 @@ printf ">>> %s <<<\n %s\n" "${msgId}" "${message}"
332 print "Message vanished from inbox" >&2 329 print "Message vanished from inbox" >&2
333 fi 330 fi
334 else 331 else
335 printf "An error occured while downloading video at ā€˜%sā€™ (youtube-dl: %d) (ffmpeg: %d)\n" ${url} ${ytResult} ${ffmpegResult} >&2 332 printf "An error occured while downloading video at ā€˜%sā€™ (youtube-dl: %d)\n" ${url} ${ytResult} >&2
336 # notmuch tag +failed -- ${msgId} 333 # notmuch tag +failed -- ${msgId}
337 # exit $? 334 # exit $?
338 fi 335 fi