Stats (downloaded and errored)
This commit is contained in:
parent
83552731d8
commit
019c8308f4
1 changed files with 25 additions and 2 deletions
27
autoytdlp.sh
27
autoytdlp.sh
|
@ -3,6 +3,8 @@
|
||||||
debug=0
|
debug=0
|
||||||
watching=1
|
watching=1
|
||||||
links=()
|
links=()
|
||||||
|
success=0
|
||||||
|
error=0
|
||||||
|
|
||||||
# -------
|
# -------
|
||||||
# Helpers
|
# Helpers
|
||||||
|
@ -113,7 +115,15 @@ dlwith_piped () {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Downloading with wget"
|
echo "Downloading with wget"
|
||||||
wget -O "$video_file" "$stream_url"
|
|
||||||
|
if wget -O "$video_file" "$stream_url"
|
||||||
|
then
|
||||||
|
bold "OK"
|
||||||
|
success=$(( success + 1 ))
|
||||||
|
else
|
||||||
|
bold "Error"
|
||||||
|
error=$(( error + 1 ))
|
||||||
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
|
@ -160,7 +170,15 @@ dlwith_ytdlp () {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Downloading with yt-dlp"
|
echo "Downloading with yt-dlp"
|
||||||
yt-dlp -f "$format" -o "$video_file" -P ./files/ "$newlink"
|
|
||||||
|
if yt-dlp -f "$format" -o "$video_file" -P ./files/ "$newlink"
|
||||||
|
then
|
||||||
|
bold "OK"
|
||||||
|
success=$(( success + 1 ))
|
||||||
|
else
|
||||||
|
bold "Error"
|
||||||
|
error=$(( error + 1 ))
|
||||||
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
|
@ -234,6 +252,11 @@ main() {
|
||||||
dlwith_ytdlp
|
dlwith_ytdlp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Show result
|
||||||
|
bold "Downloaded: $success"
|
||||||
|
bold "Errors: $error"
|
||||||
|
echo
|
||||||
|
|
||||||
# Waiting for the response
|
# Waiting for the response
|
||||||
echo 'Press Ctrl+C to exit'
|
echo 'Press Ctrl+C to exit'
|
||||||
while true; do :; done
|
while true; do :; done
|
||||||
|
|
Reference in a new issue