Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # ---------------------------------------------------------
- # WikiCommonsDongdoders
- # @author: gibrain.wordpress.com
- #
- # A simple script to mirror all image (full resolution)
- # from Wikimedia Commons Search Results.
- #
- # Usage
- # ./WikiCommonsDongdoders [short url]
- #
- # Examples
- # Download all 500 image from http://commons.wikimedia.org/w/index.php?title=
- # Special:Search&limit=900&offset=0&redirs=0&profile=default&search=buitenzorg
- #
- # 1. Shorten the url, ex: http://pendek.in/1ank
- # 2. Create new directory for download ex: mkdir ~/Buitenzorg
- # 3. cd ~/Buintezorg/
- # 4. ./WikiCommonsDongdoders http://pendek.in/1ank
- # 5. tail unduhan.txt and wget-log to see the download progress.
- #
- # ---------------------------------------------------------
- if [ $# -lt 1 ]; then
- echo 'usage: '$(basename $0)' <short url>'
- #head -n 22 $(basename $0)
- exit
- fi
- echo "Start parsing the page.... (Please be patient)"
- url=$1
- #Parse and cleaning image url
- wget -q $url -O - | grep -o -P '//upload.*?jpg' | sed -e 's/\(thumb\/\)//g' |
- sed -e 's/^/http:/g' > unduhan.txt
- echo "Downloading...."
- #Download clean url and show the status
- #wget -bc -i unduhan.txt | grep -o -P "wget.*\.[0-9]+" | xargs tailf
- wget -bc -i unduhan.txt | tailf wget-log
- echo "Done !. Alhamdulillahirobbil'alamin..."
Add Comment
Please, Sign In to add comment