From b8070a9f1887d0a46637bad8614d14204c9ede0a Mon Sep 17 00:00:00 2001 From: msglm Date: Sun, 30 Jul 2023 22:48:35 -0500 Subject: add deviantart support and use case instead of if-else chain --- stashley | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/stashley b/stashley index b24df37..a3adfc5 100755 --- a/stashley +++ b/stashley @@ -5,21 +5,22 @@ do then tomlq -r ".$site.urls[]" "$1" | while IFS= read -r url; do - if [ "$site" = "youtube" ] - then - yt-dlp --write-info-json --write-description --write-thumbnail --write-annotations --all-subs --ignore-error -f 'bestvideo[height>=720][fps>=60]+bestaudio/bestvideo+bestaudio/best' -o 'YouTube/%(uploader|author)s/%(title)s.%(ext)s' "$url" - elif [ "$site" = "website" ] - then - wget --mirror --warc-file="echo $url|sed -e '//\//slash/g'" - elif [ "$site" = "toyhouse" ] || [ "$site" = "instagram" ] || [ "$site" = "twitter" ] - then - gallery-dl --write-metadata "$url" - else - gallery-dl --write-metadata "$site":"$url" - fi + case "$site" in + youtube) + yt-dlp --write-info-json --write-description --write-thumbnail --write-annotations --all-subs --ignore-error -f 'bestvideo[height>=720][fps>=60]+bestaudio/bestvideo+bestaudio/best' -o 'YouTube/%(uploader|author)s/%(title)s.%(ext)s' "$url" + ;; + website) + wget --mirror --warc-file="echo $url|sed -e '//\//slash/g'" + ;; + toyhouse | instagram | twitter | deviantart) + gallery-dl --write-metadata "$url" + ;; + *) + gallery-dl --write-metadata "$site":"$url" + ;; + esac done fi - done fdupes -dIr . -- cgit v1.2.3