diff --git a/scripts/shell/ffmpeg-get-video-res.sh b/scripts/shell/ffmpeg-get-video-res.sh index e73741d..479f229 100755 --- a/scripts/shell/ffmpeg-get-video-res.sh +++ b/scripts/shell/ffmpeg-get-video-res.sh @@ -5,6 +5,11 @@ if [ $# -ne 1 ]; then exit 1 fi +if ! command -v "ffprobe" &> /dev/null; then + echo 'The "ffprobe" command is necessary in order to run the script, but was not found.' + exit 1 +fi + input_file="$1" ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "$input_file" diff --git a/scripts/shell/ffmpeg-helper.sh b/scripts/shell/ffmpeg-helper.sh index e41eba7..3c0c04f 100755 --- a/scripts/shell/ffmpeg-helper.sh +++ b/scripts/shell/ffmpeg-helper.sh @@ -105,6 +105,10 @@ fi ffmpeg_command="ffmpeg -i \"$input_file\"" +# if command -v ffmpeg.exe &> /dev/null; then +# ffmpeg_command="ffmpeg.exe -hwaccel d3d11va" +# fi + if [ "$remove_audio" = true ]; then ffmpeg_command+=" -an" fi diff --git a/scripts/shell/gdl-twitter-thread.sh b/scripts/shell/gdl-twitter-thread.sh index cefd413..338fd56 100755 --- a/scripts/shell/gdl-twitter-thread.sh +++ b/scripts/shell/gdl-twitter-thread.sh @@ -1 +1,6 @@ +if ! command -v "gallery-dl" &> /dev/null; then + echo 'The "gallery-dl" command is necessary in order to run the script, but was not found.' + exit 1 +fi + gallery-dl -o conversations=1 --filter "author['name']==locals().get('reply_to')" $1 diff --git a/scripts/shell/gdl-update-todo.sh b/scripts/shell/gdl-update-todo.sh index 8cdab33..94a215c 100755 --- a/scripts/shell/gdl-update-todo.sh +++ b/scripts/shell/gdl-update-todo.sh @@ -1,8 +1,8 @@ #!/bin/bash -gallery_dl_path=/mnt/e/home/Documents/Data\ hoarding +gallery_dl_path=/mnt/e/home/Documents/data-hoarding cd "$gallery_dl_path" -urls=($(grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" -i "$gallery_dl_path/todo.txt")) +urls=($(grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" -i "$gallery_dl_path/todo.md")) for url in ${urls[@]}; do gallery-dl $url; done diff --git a/scripts/shell/gdl.sh b/scripts/shell/gdl.sh index 03bfa80..43ea7b7 100755 --- a/scripts/shell/gdl.sh +++ b/scripts/shell/gdl.sh @@ -1,4 +1,9 @@ -#!/bin/bash +#!/usr/bin/zsh + +if ! command -v "gallery-dl" &> /dev/null; then + echo 'The "gallery-dl" command is necessary in order to run the script, but was not found.' + exit 1 +fi media_url=$1 diff --git a/scripts/shell/image-indexer.sh b/scripts/shell/images-indexer.sh similarity index 79% rename from scripts/shell/image-indexer.sh rename to scripts/shell/images-indexer.sh index 711e10e..bb81085 100755 --- a/scripts/shell/image-indexer.sh +++ b/scripts/shell/images-indexer.sh @@ -1,11 +1,38 @@ #!/bin/bash -# TODO: add interative selection of "kind of commission" for output folder +commands_to_check=(gallery-dl gdl.sh) + +commands_not_found=() +for command in ${commands_to_check[@]}; do + if ! command -v "$command" &> /dev/null; then + commands_not_found+=("$command") + fi +done + +if [ ${#commands_not_found[@]} -ne 0 ]; then + echo 'The following commands are necessary in order to run the script, but were not found:' + + for command in ${commands_not_found[@]}; do + echo " \"$command\"" + done + + exit 1 +fi cur_dir=`pwd` furry_commission_ideas_path=/mnt/e/home/Documents/sync/nextcloud-pudimxyz-cloud/furry-commission-ideas furry_commission_ideas_urls_filename="urls.txt" -scripts_path=~/repos/cloudalb/personal-devboot/scripts/shell +scripts_path=/home/cloud/repos/personal-devboot/scripts/shell + +if [ ! -d $furry_commission_ideas_path ]; then + echo "[ERROR] The ideas folder was not found (\"$furry_commission_ideas_path\")" + exit 1 +fi + +if [ ! -d $scripts_path ]; then + echo "[ERROR] The scripts folder was not found (\"$scripts_path\")" + exit 1 +fi input_media_url() { read -p "[INFO] Please inform the media's url: " media_url diff --git a/scripts/shell/run-streamlink.sh b/scripts/shell/run-streamlink.sh deleted file mode 100755 index 10993ca..0000000 --- a/scripts/shell/run-streamlink.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Check if a parameter is provided -if [ -z "$1" ]; then - echo "Usage: $0 " - exit 1 -fi - -# Assign the parameter to a variable -FOO="$1" - -# Run the streamlink command -streamlink.exe "$FOO" best diff --git a/scripts/shell/scrcpy-wifi.sh b/scripts/shell/scrcpy-wifi.sh deleted file mode 100755 index 2f5061d..0000000 --- a/scripts/shell/scrcpy-wifi.sh +++ /dev/null @@ -1,3 +0,0 @@ -# ADB_PATH="/mnt/c/Users/cloud/AppData/Roaming/NexusTools/adb.exe" -# ADB=$ADB_PATH scrcpy --turn-screen-off --stay-awake --power-off-on-close -scrcpy --turn-screen-off --stay-awake --power-off-on-close diff --git a/scripts/shell/scrcpy.sh b/scripts/shell/scrcpy.sh index 1db126e..600a470 100755 --- a/scripts/shell/scrcpy.sh +++ b/scripts/shell/scrcpy.sh @@ -1,2 +1,8 @@ -ADB_PATH="/mnt/e/programs/scrcpy-win64-v2.4" -$ADB_PATH/scrcpy.exe --turn-screen-off --stay-awake --power-off-on-close --max-size=1024 +SCRCPY_PATH="/mnt/e/programs/scrcpy-win64-v2.4" + +if [ ! -d "$SCRCPY_PATH" ]; then + echo "The program's path does not exist ($SCRCPY_PATH)." + exit 1 +fi + +$SCRCPY_PATH/scrcpy.exe --turn-screen-off --stay-awake --power-off-on-close --max-size=1024