Advertisement
Guest User

Untitled

a guest
Sep 28th, 2017
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.52 KB | None | 0 0
  1. #!/bin/bash
  2. TAG=$1
  3. PAGES=$(lynx -dump -listonly -nonumbers "https://derpibooru.org/tags/$TAG" | grep 'page=' | tail -n 1 | grep -o '[[:digit:]]*')
  4. for PAGE in $(seq "$PAGES"); do
  5.     echo "Parsing page $PAGE of $PAGES"
  6.     URLS=$(lynx -dump -listonly -nonumbers "https://derpibooru.org/tags/$TAG/?page=$PAGE" | grep '#comments' | sort -u)
  7.     for URL in $URLS; do
  8.         echo "Parsing $URL"
  9.         IMGURL=$(lynx -dump -listonly -nonumbers "$URL" | grep download | tail -n 1)
  10.         echo "Getting $IMGURL"
  11.         wget -c "$IMGURL"
  12.         sleep 1
  13.     done
  14. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement