Last active
December 22, 2015 13:59
-
-
Save chenkaie/6483032 to your computer and use it in GitHub Desktop.
Description: 無名小站相片打包程式 (download_wretch_album.sh)
Ref: http://www.wretch.cc/blog/WretchFAQ/13637278
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Modify below 2 variables if needed | |
ALBUM_NUM=50 | |
ALBUM_FOLDER="./SambaGhost-data/album/" | |
cd ${ALBUM_FOLDER} | |
for (( i = 1; i <= ${ALBUM_NUM}; i++ )); do | |
echo "==> Create folder ${i}" | |
mkdir ${i} | |
cd ${i} | |
echo "==> Download album ${i}.txt" | |
wget -q -i ../${i}.txt | |
echo "==> Batch file rename" | |
for pic in `ls`; do | |
mv $pic $(echo $pic | cut -d '?' -f 1) | |
done | |
cd - | |
done | |
echo "==> Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment