Friday, March 13, 2015

Bath download photos

First install tgrab by pip:

# apt-get update
# apt-get install python-pip
# pip install tgrab

Then create a script to run it in bath:


# Working Folder

# Array storage the tumblr accounts:
# Example: cars for
array=( cars computerhistorymuseum computer macdesks )

for i in "${array[@]}"
echo "*****$i*****"
mkdir -p $WORK_DIR/$i
cd $WORK_DIR/$i
ls|wc -l
tgrab -n $i -p 100 > download.log 2>&1 &


The script will go through the array then download all photos for the first 100 pages back.
Each tgrab job will running at background, the downloads will be under each folder.

Appreciate the works on tgrab.
And Pythong Rocks!

No comments:

Post a Comment