Email or username:

Password:

Forgot your password?
1 comment
huch

@NaiJi @tennoseremel seems like a less than perfect solution, here’s a script that takes a directory and searches for the image sources to put it in ${filename}.source

./script.sh yourdirectory

(be careful I wrote it very quickly, also you might want to add a sleep in the for loop to avoid flooding gelbooru and getting banned :cirnoWink: )

#!/bin/sh

if [ -z "$1" ]; then
    echo "no directory provided"
    exit
fi

for i in $1/*; do
    md=$(md5sum $i | sed 's/ .*$//')
    gel=$(curl --silent "https://gelbooru.com/index.php?page=post&s=list&tags=md5%3a${md}" | grep -e "https.*id=" | sed 's/amp.//g;s/^.*https/https/;s/.tags.*//;1q')
    if [ -n "$gel" ]; then
        src=$(curl --silent "$gel" | grep Source | sed 's/amp;//g;s/^.*href..//;s/. rel.*//;1q')
        echo "$src"
        echo "$src" > "${i}.source"
    fi
done

@NaiJi @tennoseremel seems like a less than perfect solution, here’s a script that takes a directory and searches for the image sources to put it in ${filename}.source

./script.sh yourdirectory

(be careful I wrote it very quickly, also you might want to add a sleep in the for loop to avoid flooding gelbooru and getting banned :cirnoWink: )

Go Up