Skip to content

Instantly share code, notes, and snippets.

@jadedgnome
Created August 9, 2014 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jadedgnome/b409c0c2d897a598a083 to your computer and use it in GitHub Desktop.
Save jadedgnome/b409c0c2d897a598a083 to your computer and use it in GitHub Desktop.
download imagebam galleries
#!/bin/bash/
# usage : ./imagebam-dl.sh <URL>
for i in `curl -s "$1" |grep 'a href'| egrep -o "http.*" |grep /image/ | cut -d "'" -f1 | cut -d '"' -f1` ; do FOLDER=$(echo $1 | cut -d '/' -f 5) ; curl -s "$i" | grep 'img id' | grep -o "http.*" | cut -d '"' -f1 | xargs wget -nv -nc -P imagebam_"$FOLDER"/ ; done
@Thoughtyness
Copy link

I'm not sure it works anymore :(. Could someone try updating this or send me in the direction of a functioning one as of summer 2017?

@NotExist
Copy link

for i in curl http://www.imagebam.com/gallery/alskdjflaskdjflaksjdlfkjasldkfj|grep "a href"|grep none|cut -d "'" -f2; do FOLDER=$(echo $1 |cut -d '/' -f 5); curl -s "$i"|grep 'download=1'|grep -v " "|grep -o "http.*"|cut -d '"' -f1 |xargs curl -O -J;done
Dont have wget on Mac, curl instead, no subfolder

@slrslr
Copy link

slrslr commented May 30, 2021

it is not working, even after removing last "/" in #!/bin/bash/
it complains wget: missing URL
My input URL ($1) was like https://www.imagebam.com/gallery/stringhere
When i add "set -ex" intot he script beginning, it says:
+ xargs wget -nv -nc -P imagebam_stringhere/
@NotExist Your syntax does not appear to work either. Do you mind trying?

UPDATE: i think that the fix is to replace 'img id' by 'main-image' but script still likely need improving

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment