From b249277fb5f02424fadf7812d476a9c4515b9dbd Mon Sep 17 00:00:00 2001 From: tosu Date: Thu, 2 Mar 2023 21:37:20 +0100 Subject: [PATCH] Better progress --- download.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/download.sh b/download.sh index 181dc0b..972fb49 100755 --- a/download.sh +++ b/download.sh @@ -72,9 +72,11 @@ for m3u8_manifest_url in ${m3u8_manifest_urls}; do outfile="$(printf '%s' "${OUTFILE_PATTERN}" | sed "s/INDEX/${idx}/g")" - printf '\033[32m%s\033[m\n' "Download video ${idx} of ${total}" - ffmpeg -loglevel 24 -headers "authorization: Bearer ${BASE64_BEARER_TOKEN}" -i "${m3u8_highest_res_url}" -c copy "${outfile}" - printf '\033[33m%s\033[m\n' "Done" + printf '\033[32m%s\033[m\n' "Download '${outfile}' (${idx}/${total})" + + ffmpeg -hide_banner -loglevel error -headers "authorization: Bearer ${BASE64_BEARER_TOKEN}" -i "${m3u8_highest_res_url}" -progress - -c copy "${outfile}" | grep --line-buffered 'out_time=' | sed -u -e 's/out_time=//g' | xargs -I{} printf '{}\r' + + printf '\n\033[33m%s\033[m\n' "Done" idx=$(( idx + 1 )) done