1.6 log fix

This commit is contained in:
RandomNinjaAtk 2023-07-19 16:35:13 -04:00 committed by GitHub
parent 8218acc449
commit 0a5f1c0aeb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
#!/usr/bin/env bash
scriptVersion="1.5"
scriptVersion="1.6"
ytdlpExtraOpts="--user-agent facebookexternalhit/1.1"
scriptName="YoutubeSeriesDownloader"
@ -11,7 +11,9 @@ log () {
logfileSetup () {
# auto-clean up log file to reduce space usage
if [ -f "/config/logs/$scriptName.txt" ]; then
find /config/logs -type f -name "$scriptName.txt" -size +1024k -delete
if find /config/logs -type f -name "$scriptName.txt" -size +1024k | read; then
echo "" > /config/logs/$scriptName.txt
fi
fi
if [ ! -f "/config/logs/$scriptName.txt" ]; then
@ -75,22 +77,6 @@ verifyApiAccess () {
done
}
# auto-clean up log file to reduce space usage
if [ -f "/config/logs/YoutubeSeriesDownloader.txt" ]; then
find /config/logs -type f -name "YoutubeSeriesDownloader.txt" -size +1024k -delete
fi
if [ ! -f "/config/logs/YoutubeSeriesDownloader.txt" ]; then
touch "/config/logs/YoutubeSeriesDownloader.txt"
chmod 666 "/config/logs/YoutubeSeriesDownloader.txt"
fi
exec &> >(tee -a "/config/logs/YoutubeSeriesDownloader.txt")
if [ "$arrEventType" == "Test" ]; then
log "Tested Successfully"
exit 0
fi
CookiesCheck () {
# Check for cookies file
if [ -f /config/cookies.txt ]; then