Refresh and added usage tracking

This commit is contained in:
Hannes
2026-04-24 00:47:51 +02:00
parent 8519d9f62e
commit 477b1bf985
45 changed files with 726 additions and 166 deletions
+37
View File
@@ -0,0 +1,37 @@
#!/bin/bash
# Get the path to the Python script (adjust if needed)
PYTHON_SCRIPT="$HOME/.bin/extract_audio.py"
# Check if the Python script exists
if [ ! -f "$PYTHON_SCRIPT" ]; then
echo "Error: Python script '$PYTHON_SCRIPT' not found."
exit 1
fi
# Check if arguments are provided
if [ "$#" -eq 0 ]; then
echo "No arguments provided. Attempting to process all video files in the current directory."
# Initialize a flag to track if any files are processed
files_processed=0
# Find all video files in the current directory
for video_file in *.mp4 *.mkv *.avi *.mov; do
# Check if the file exists (in case no matches were found)
if [ -e "$video_file" ]; then
echo "Processing: $video_file"
python "$PYTHON_SCRIPT" "$video_file"
files_processed=1
fi
done
# If no files were processed, print a message
if [ "$files_processed" -eq 0 ]; then
echo "No video files found in the current directory."
exit 1
fi
else
# Run the Python script with the provided arguments
python "$PYTHON_SCRIPT" "$@"
fi