remove token
This commit is contained in:
+7
-7
@@ -3,7 +3,7 @@
|
|||||||
# ==========================================
|
# ==========================================
|
||||||
# CONFIGURATION (Edit these!)
|
# CONFIGURATION (Edit these!)
|
||||||
# ==========================================
|
# ==========================================
|
||||||
GOTIFY_TOKEN="AH5NXt3g0lSCyfT" # <--- Paste your token here
|
GOTIFY_TOKEN= # <--- Paste your token here
|
||||||
GOTIFY_URL="https://gotify.marlow.quest"
|
GOTIFY_URL="https://gotify.marlow.quest"
|
||||||
SRC_DIR="$HOME/Videos/Compress"
|
SRC_DIR="$HOME/Videos/Compress"
|
||||||
OUT_DIR="$SRC_DIR/Complete"
|
OUT_DIR="$SRC_DIR/Complete"
|
||||||
@@ -80,20 +80,20 @@ for f in "${files[@]}"; do
|
|||||||
# Spinner & Handbrake
|
# Spinner & Handbrake
|
||||||
gum spin --spinner minidot --spinner.foreground 208 --title "Encoding: $filename ($old_mb MB)..." -- \
|
gum spin --spinner minidot --spinner.foreground 208 --title "Encoding: $filename ($old_mb MB)..." -- \
|
||||||
bash -c 'HandBrakeCLI -i "$IN_FILE" -o "$OUT_FILE" -e svt_av1 --encoder-preset 8 -q "$QUALITY" --vfr -l 1080 -E opus -B 128 > /dev/null 2>&1'
|
bash -c 'HandBrakeCLI -i "$IN_FILE" -o "$OUT_FILE" -e svt_av1 --encoder-preset 8 -q "$QUALITY" --vfr -l 1080 -E opus -B 128 > /dev/null 2>&1'
|
||||||
|
|
||||||
if [ $? -eq 0 ] && [ -f "$OUT_FILE" ]; then
|
if [ $? -eq 0 ] && [ -f "$OUT_FILE" ]; then
|
||||||
new_size=$(wc -c < "$OUT_FILE")
|
new_size=$(wc -c < "$OUT_FILE")
|
||||||
new_mb=$(awk "BEGIN {printf \"%.1f\", $new_size/1048576}")
|
new_mb=$(awk "BEGIN {printf \"%.1f\", $new_size/1048576}")
|
||||||
saved_mb=$(awk "BEGIN {printf \"%.1f\", $old_mb - $new_mb}")
|
saved_mb=$(awk "BEGIN {printf \"%.1f\", $old_mb - $new_mb}")
|
||||||
|
|
||||||
gum style --foreground 76 "✓ $filename"
|
gum style --foreground 76 "✓ $filename"
|
||||||
gum style --foreground 245 " ↳ Size: ${old_mb}MB → ${new_mb}MB (Saved: ${saved_mb}MB)"
|
gum style --foreground 245 " ↳ Size: ${old_mb}MB → ${new_mb}MB (Saved: ${saved_mb}MB)"
|
||||||
|
|
||||||
TOTAL_OLD_BYTES=$((TOTAL_OLD_BYTES + old_size))
|
TOTAL_OLD_BYTES=$((TOTAL_OLD_BYTES + old_size))
|
||||||
TOTAL_NEW_BYTES=$((TOTAL_NEW_BYTES + new_size))
|
TOTAL_NEW_BYTES=$((TOTAL_NEW_BYTES + new_size))
|
||||||
((FILE_COUNT++))
|
((FILE_COUNT++))
|
||||||
else
|
else
|
||||||
gum style --foreground 196 "✗ Failed: $filename"
|
gum style --foreground 196 "✗ Failed: $filename"
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
done
|
done
|
||||||
@@ -110,11 +110,11 @@ gum style \
|
|||||||
|
|
||||||
if [ "$GOTIFY_ENABLED" = true ] && [ $FILE_COUNT -gt 0 ]; then
|
if [ "$GOTIFY_ENABLED" = true ] && [ $FILE_COUNT -gt 0 ]; then
|
||||||
MESSAGE="Finished processing $FILE_COUNT videos. Total space saved: $TOTAL_SAVED_MB MB."
|
MESSAGE="Finished processing $FILE_COUNT videos. Total space saved: $TOTAL_SAVED_MB MB."
|
||||||
|
|
||||||
curl -s -S "$GOTIFY_URL/message?token=$GOTIFY_TOKEN" \
|
curl -s -S "$GOTIFY_URL/message?token=$GOTIFY_TOKEN" \
|
||||||
-F "title=✅ Video Encoding Complete" \
|
-F "title=✅ Video Encoding Complete" \
|
||||||
-F "message=$MESSAGE" \
|
-F "message=$MESSAGE" \
|
||||||
-F "priority=5" > /dev/null
|
-F "priority=5" > /dev/null
|
||||||
|
|
||||||
gum style --foreground 240 " (Gotify notification sent)"
|
gum style --foreground 240 " (Gotify notification sent)"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user