Created
December 23, 2014 07:05
-
-
Save wonderflow/b1a35ce3fa0c6d7512dd to your computer and use it in GitHub Desktop.
download book from http://book.xjpvictor.info/
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
URL=book.xjpvictor.info | |
ANS="" | |
for (( i=1; ; i++ )) | |
do | |
if [ $i = 1 ] | |
then | |
INDEX=`curl $URL | grep item | cut -f4 -d '"'` | |
ANS="$ANS $INDEX" | |
else | |
INDEX=`curl $URL/page/$i | grep item | cut -f4 -d '"'` | |
ANS="$ANS $INDEX" | |
fi | |
if [ ! "$INDEX" ] | |
then | |
break | |
fi | |
done | |
for j in $ANS | |
do | |
bookurl=`curl $URL/book/$j | grep epub | cut -f8 -d '"' ` | |
bookurl=`echo $bookurl | sed -e "s/\&\;/\&/g" ` | |
bookurl=`echo $bookurl | sed -e "s/\?/\\\?/g"` | |
bookurl=`echo $bookurl | sed -e "s/\=/\\\=/g"` | |
bookurl=`echo $bookurl | sed -e "s/\&/\\\&/g"` | |
name=`curl $URL/book/$j | grep title | grep name | cut -f2 -d '<' | cut -f2 -d '>'` | |
name=`echo $name` | |
wget -O "$name".epub $bookurl | |
echo $name done. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment