Add gallery-dl shell scripts
This commit is contained in:
47
my-scripts/shell/gallery-dl-queuer.sh
Executable file
47
my-scripts/shell/gallery-dl-queuer.sh
Executable 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."
|
||||||
1
my-scripts/shell/gallery-dl-twitter-thread.sh
Executable file
1
my-scripts/shell/gallery-dl-twitter-thread.sh
Executable file
@@ -0,0 +1 @@
|
|||||||
|
gallery-dl -o conversations=1 --filter "author['name']==locals().get('reply_to')" $1
|
||||||
Reference in New Issue
Block a user