Add gallery-dl shell scripts

This commit is contained in:
Matheus Albino
2023-10-22 18:48:28 -03:00
parent d21a718ab3
commit 47e0ddb0cf
2 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
#!/bin/bash
# Initialize variables for output files
success_log="success_log.txt"
failure_log="failure_log.txt"
# Parse command line arguments
while getopts "f:c:" opt; do
case $opt in
f)
queue_file="$OPTARG"
;;
c)
command="$OPTARG"
;;
\?)
echo "Usage: $0 -f <queue_file> -c <command>"
exit 1
;;
esac
done
# Check if both parameters are provided
if [ -z "$queue_file" ] || [ -z "$command" ]; then
echo "Usage: $0 -f <queue_file> -c <command>"
exit 1
fi
# Check if the queue file exists
if [ ! -f "$queue_file" ]; then
echo "Queue file not found: $queue_file"
exit 1
fi
# Process the queue
while IFS= read -r line; do
# Execute the command with the line as an argument
$command "$line"
# Check the exit status of the command
if [ $? -eq 0 ]; then
echo "Command: $command $line - SUCCESS" >> "$success_log"
else
echo "Command: $command $line - FAILURE" >> "$failure_log"
fi
done < "$queue_file"
echo "Script completed. Successful commands logged in $success_log. Failed commands logged in $failure_log."

View File

@@ -0,0 +1 @@
gallery-dl -o conversations=1 --filter "author['name']==locals().get('reply_to')" $1